View file Fernus_opros/Admin/edit_golos.php

File size: 3.25Kb
<?php

###########################################################################
##                         -=FERNUS=-                                    ##
##                       ---------------                                 ##
##                      http://sekis.us                                  ##
##                           *-*-*-*                                     ##
##                           *Колян*                                     ##
##                      ICQ: 42-11-04-014                                ##
##                          - - - - -                                    ##
##                 Скрипт: Опроса/Голосований                            ##
##                          - - - - -                                    ##
##   Любые изменения кода скрипта, его перепродажа (СКРИПТ ВЫЛОЖЕН       ##
##       БЕСПЛАТНО)-ЗАПРЕЩЕННО и приследуется Мной и Законом об          ##
##                        Авторских Правах!!!                            ##
###########################################################################

//START TIMER
list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;

//ERROR REPORTING LEVEL
error_reporting(0);

//MySQL
include("./../cfg.php");

//TITLE
$title = "Edit";

@$id = intval($_GET['id']);
@$mod = $_GET['mod'];
///////////////////////////////////////////////////////
//WML VERSION
///////////////////////////////////////////////////////

header("Content-type: text/vnd.wap.wml; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");

echo "<?xml version='1.0' encoding='UTF-8'?>\n";
echo "<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.3//EN' 'http://www.wapforum.org/DTD/wml13.dtd'><wml>\n";
echo "<head><meta http-equiv='Cache-Control' content='no-cache' forua='true'/></head>\n";
echo "<card id='catalogue' title='".$title."'>\n<p align='left'>\n";
if (empty($mod)) $mod="index";
switch ($mod) {
case "index";

$sql = mysql_query("SELECT `name`, `golos` FROM `".$opros."` WHERE `id` = '".$id."';");
if(mysql_affected_rows() == 0) echo "<b>Ошибка!</b><br />\n";
while($sa = mysql_fetch_row($sql)) {

echo "<u>".$sa[0]."</u><br/>- - -<br/>\n";
echo "Голосов: ".$sa[1]."<br/>\n";
echo '<input type="text" name="golos" maxlength="10" value="'.$sa[1].'"/><br/>';
echo "<anchor title=\"send\">Сохранить<go href=\"./edit_golos.php?mod=edit&amp;id=".$id."\" method=\"post\">";
echo "<postfield name=\"golos\" value=\"$(golos)\"/>";
echo "</go></anchor><br/>";
}

break;

case "edit";

$golos = intval($_POST['golos']);

$sql = mysql_query("UPDATE `".$opros."` SET `golos` = '".$golos."' WHERE `id` = '".$id."';");
if(mysql_affected_rows() == 0)
{
echo "Контендент не найден!<br />\n";
}
else
{
echo "Изменено!Мухлюем?=)<br />\n";
}
break;
}
echo "- - -<br/><a href='./index.php'>Админ-панель</a><br/>\n";
//STOP TIMER
list($msec, $sec) = explode(chr(32), microtime());
echo "<small>[".round(($sec + $msec) - $headtime, 5)."]</small><br/>\n";
echo "</p></card></wml>";
?>