bejsser,
--Синтакс--CSSHTMLJavascriptPhpXMLSQL
<?
include_once \'../sys/inc/start.php\';
include_once \'../sys/inc/compress.php\';
include_once \'../sys/inc/sess.php\';
include_once \'../sys/inc/home.php\';
include_once \'../sys/inc/settings.php\';
include_once \'../sys/inc/db_connect.php\';
include_once \'../sys/inc/ipua.php\';
include_once \'../sys/inc/fnc.php\';
include_once \'../sys/inc/adm_check.php\';
include_once \'../sys/inc/user.php\';
user_access(\'actions\',null,\'/index.php?\'.SID);
if (isset($_SESSION[\'adm_auth\']) && $_SESSION[\'adm_auth\']>$time || isset($_SESSION[\'captcha\']) && isset($_POST[\'chislo\']) && $_SESSION[\'captcha\']==$_POST[\'chislo\'])
{
$_SESSION[\'adm_auth\']=$time+600;
if (isset($_GET[\'go\']) && $_GET[\'go\']!=null)
{
header(\'Location: \'.base64_decode($_GET[\'go\']));exit;
}
$actions_list=Array();
$res=mysql_query(\"SELECT * FROM actions_list ORDER BY cost;\"
;
while($row=mysql_fetch_assoc($res))$actions_list[]=$row;
//Обработка формы-------------
if(isset($_POST[\'title\']))
{
$title=my_esc($_POST[\'title\']);
$man_act=my_esc($_POST[\'man_act\']);
$woman_act=my_esc($_POST[\'woman_act\']);
$cost=(int)$_POST[\'cost\'];
mysql_query(\"INSERT INTO actions_list (title,man_act,woman_act,cost) VALUES(\'$title\',\'$man_act\',\'$woman_act\',\'$cost\');\"
;
header(\'location:actions.php\');
exit;
}
if(isset($_POST[\'save\']))
{
foreach($actions_list AS $key=>$val)
{
if(isset($_POST[\'title_\'.$val[\'id\']]) AND isset($_POST[\'cost_\'.$val[\'id\']]))
{
$id=$val[\'id\'];
$title=my_esc($_POST[\'title_\'.$val[\'id\']]);
$man_act=my_esc($_POST[\'man_act_\'.$val[\'id\']]);
$woman_act=my_esc($_POST[\'woman_act_\'.$val[\'id\']]);
$cost=(int)$_POST[\'cost_\'.$val[\'id\']];
mysql_query(\"UPDATE actions_list SET title=\'$title\',man_act=\'$man_act\',woman_act=\'$woman_act\',cost=\'$cost\' WHERE id=\'$id\';\"
;
}
}
header(\'location:actions.php\');
exit;
}
if(isset($_GET[\'del\']))
{
$id=(int)$_GET[\'del\'];
mysql_query(\"DELETE FROM actions_list WHERE id=\'$id\';\"
;
mysql_query(\"DELETE FROM actions WHERE action=\'$id\';\"
;
header(\'location:actions.php\');
exit;
}
//----------------------------
$set[\'title\']=\'Мод действий\';
include_once \'../sys/inc/thead.php\';
title();
err();
aut();
?>
<div>
Добавить действие<br />
<form method=\"post\">
<input type=\"text\" name=\"title\" value=\"Обнять\"/> <input type=\"text\" name=\"man_act\" value=\"Обнял\"/> <input type=\"text\" name=\"woman_act\" value=\"Обняла\"/> <input type=\"text\" name=\"cost\" value=\"10\"/> баллов
<input type=\"submit\" name=\"add\" value=\"Ок\"/>
</form>
</div>
<div>
Созданные действия:<br />
<form method=\"post\">
<input type=\"hidden\" name=\"save\" value=\"1\" />
<?foreach($actions_list AS $key=>$val):?>
<input type=\"text\" name=\"title_<?=$val[\'id\']?>\" value=\"<?=$val[\'title\']?>\" /> <input type=\"text\" name=\"man_act_<?=$val[\'id\']?>\" value=\"<?=$val[\'man_act\']?>\" /> <input type=\"text\" name=\"woman_act_<?=$val[\'id\']?>\" value=\"<?=$val[\'woman_act\']?>\" /> <input type=\"text\" name=\"cost_<?=$val[\'id\']?>\" value=\"<?=$val[\'cost\']?>\" /> баллов <a style=\"color:red\" href=\"actions.php?del=<?=$val[\'id\']?>\">del</a><br />
<?endforeach?>
<input type=\"submit\" value=\"Сохранить\" />
</form>
</div>
<?php
}
else
{
$set[\'title\']=\'Защита от автоматических изменений\';
include_once \'../sys/inc/thead.php\';
title();
err();
aut();
echo \"<form method=\'post\' action=\'?gen=$passgen&\".(isset($_GET[\'go\'])?\"go=$_GET[go]\":null).\"\'>\\n\";
echo \"<img src=\'/captcha.php?$passgen&SESS=$sess\' width=\'100\' height=\'30\' alt=\'Проверочное число\' /><br />\\nВведите число с картинки:<br />\\n<input name=\'chislo\' size=\'5\' maxlength=\'5\' value=\'\' type=\'text\' /><br/>\\n\";
echo \"<input type=\'submit\' value=\'Далее\' />\\n\";
echo \"</form>\\n\";
}
include_once \'../sys/inc/tfoot.php\';
?>
Позиция:
Стр 0, Стлб 0