View file mafia/change.php

File size: 4.53Kb
<?php
$title='Мафия - Настройки';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";

echo"<div class=\"i\">$title
</div>";
$ref=rand(10000,1000000);

$result = mysql_query ("Select * from mafusers where id_user='$user[id_user]'");

$row = mysql_fetch_array ($result);

$id=$row['id'];

$us=$row["user"];  

$rm=$_GET['rm'];


	if (isset($_POST['save']))

		{

				

				

				if (isset($_POST['avr']) && ($_POST['avr']==0 || $_POST['avr']==10 || $_POST['avr']==15 || $_POST['avr']==15 || $_POST['avr']==25 || $_POST['avr']==30))

				{

				$avr=$_POST['avr'];

				mysql_query("UPDATE mafusers SET avr='$avr' WHERE id='$id' LIMIT 1");} else $err = mysql_error();

				if (isset($_POST['max']) && ($_POST['max']==5 || $_POST['max']==8 || $_POST['max']==10 || $_POST['max']==12 || $_POST['max']==15 || $_POST['max']==20 || $_POST['max']==25 || $_POST['max']==30))

				{

				$max=$_POST['max'];

				mysql_query("UPDATE mafusers SET max='$max' WHERE id='$id' LIMIT 1");} else $err = mysql_error();

				if (isset($_POST['say']) && ($_POST['say']==0 || $_POST['say']==1))

				{

				$say=$_POST['say'];

				mysql_query("UPDATE mafusers SET say='$say' WHERE id='$id' LIMIT 1");} else $err = mysql_error();

				if (isset($_POST['trun']) && ($_POST['trun']==0 || $_POST['trun']==1))

				{

				$trun=$_POST['trun'];

				mysql_query("UPDATE mafusers SET translit='$trun' WHERE id='$id' LIMIT 1");} else $err = mysql_error();

				if (!isset($err)){msg("Ваши настройки изменены");} 

		}			



echo "<div class='menu'>";

echo "<form method='post' action='change.php?id=$id&rm=$rm&ref=$ref'>\n";

echo "Время автообновления(сек):<br/>\n";

echo "<select name=\"avr\">\n";

if($row["avr"]==10)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"10\"$sel>10 сек</option>\n";

if($row["avr"]==15)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"15\"$sel>15 сек</option>\n";

if($row["avr"]==20)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"20\"$sel>20 сек</option>\n";

if($row["avr"]==25)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"25\"$sel>25 сек</option>\n";

if($row["avr"]==30)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"30\"$sel>30 сек</option>\n";

if($row["avr"]==0) $sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"0\"$sel>Отключить</option>\n";

echo "</select><br/>\n";

echo "Кол-во сообшений:<br/>\n";

echo "<select name=\"max\">\n";

if($row["max"]==5)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"5\"$sel>5</option>\n";

if($row["max"]==8)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"8\"$sel>8</option>\n";

if($row["max"]==10)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"10\"$sel>10</option>\n";

if($row["max"]==12)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"12\"$sel>12</option>\n";

if($row["max"]==15)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"15\"$sel>15</option>\n";

if($row["max"]==20)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"20\"$sel>20</option>\n";

if($row["max"]==25)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"25\"$sel>25</option>\n";

if($row["max"]==30)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"30\"$sel>30</option>\n";

echo "</select><br/>\n";

echo "По умолчанию сказать:<br/>\n";

echo "<select name=\"say\">\n";

if($row["say"]==0)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"0\"$sel>Приватно</option>\n";

if($row["say"]==1)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"1\"$sel>Всем</option>\n";

echo "</select><br/>\n";

echo "Транслит:<br/>\n";

echo "<select name=\"trun\">\n";

if($row["translit"]==0)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"0\"$sel>Отключен</option>\n";

if($row["translit"]==1)$sel=' selected="selected"';else $sel=NULL;

echo "<option value=\"1\"$sel>Включен</option>\n";

echo "</select><br/>\n";

echo "<input type='submit' name='save' value='Изменить' />\n";

echo "</form>\n";

echo "*********<br/>\n";

if(isset($rm))echo "<a href=\"maf.php?id=$id&amp;rm=$rm&amp;ref=$ref\">В игру</a>\n";

else echo "<a href=\"?id=$id&amp;ref=$ref\">На улицу</a>\n";

echo "</div>\n";




echo "<a href=\"?id=$id&amp;ref=$ref\">На улицу</a>\n";

require"../system/foot.php";

?>