<?
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('adm_mysql',null,'index.php?'.SID);
adm_check();
$set['title']='Голова бота';
include_once '../sys/inc/thead.php';
title();

echo "<a href='/adm_panel/bot_tasks_add.php?".rand(1000,9999)."/'><b>Обновить</b></a>\n";
echo " | <a href='/smiles.php'><b>смайлы</b></a><br />\n";

if (isset($_GET[insert])){


mysql_query("INSERT INTO `bot_tasks` (`words`, `answer`, `time`) VALUES ('$_POST[words]', '$_POST[answer]', '$time')");
msg('Задача успешно добавлена');}
echo "Всего задач в базе: ".mysql_result(mysql_query("SELECT COUNT(*) FROM `bot_tasks`"),0)."<br />\n";


echo "<form action=\"?insert\" method=\"post\">";



echo "Ориентировочные слова:<br />\n";
echo "<input type='text' name='words' /><br />\n";



echo "Ответ бота:<br />\n";
echo "<input type='text' name='answer' /><br />\n";

echo "<input value=\"Научить бота\" type=\"submit\" />\n";
echo "</form>\n";


echo "<a href='bot_tasks.php'><b>Список задач</b></a><br />\n";


echo "* Ввод ориентировочных слов обязателен<br />";
if (user_access('adm_panel_show')){
echo "<div class='foot'>\n";
echo "&laquo;<a href='/adm_panel/'>В админку</a><br />\n";
echo "</div>\n";
}
include_once '../sys/inc/tfoot.php';
?>