Просмотр файла superkat/adminka/adms.php

Размер файла: 38.98Kb
<? header ("Content-type:text/vnd.wap.wml; charset=utf-8");
header("Cache-Control: no-cache");
   echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
   <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";?>

<?php
include "../xconf.php";
include "fo.php";
$where_data=$_GET['c'];
$kolich_adm=10;



echo "<wml><card title=\"A&#x0434;&#x043C;&#x0438;&#x043D;&#x043A;a\">";
 if ($log <> $log_a){
	print "<p>He&#x0432;ep&#x043D;&#x044B;&#x0439; &#x043B;o&#x0433;&#x0438;&#x043D;</p></card></wml>";
	exit;}
	if ($pass <> $pass_a){
	print "<p>He&#x0432;ep&#x043D;&#x044B;&#x0439; &#x043F;apo&#x043B;&#x044C;</p></card></wml>";
	exit;} 
	
	
	If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$res=mysql_query("select * from `cool_site` order by `tin` desc ");
$kol=mysql_num_rows($res);
}

else { 
$resax=mysql_query("select * from `cool_raz` where id='$where_data' ");
$row=mysql_num_rows($resax);
if ($row=="0")
{
print "<p><small>O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">Ha&#x0437;a&#x0434;</a><br/></small></p></card></wml>";
exit;
}

$res=mysql_query("select * from `cool_site` where category='$where_data' order by `tin` desc ");
$kol=mysql_num_rows($res);
}

switch ($mode){
case "cats": //список категорий

print "<p><small>";
$q=mysql_query("select * from `cool_raz` where 1 order by por asc");
while($data = @mysql_fetch_array($q)){
$catid=$data['id'];
$i=@mysql_fetch_array($qs);
$qs=@mysql_query("select count(*) from `cool_site` where category='$catid' ");

$i=@mysql_fetch_array($qs);
print " <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$catid\">".$data['text']."</a>(".$i['count(*)'].") <br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=delkat&amp;c=$catid\">&#x0423;&#x0434;a&#x043B;&#x0438;&#x0442;&#x044C;</a>  ||  <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=edkat&amp;c=$catid\">&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;</a><br/>-----<br/>";

unset($catid);unset($qs);unset($i);}
print "<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></small></p>";
/*
echo "<p>
B&#x0432;e&#x0434;&#x0438;&#x0442;e
ID:<br/><input type=\"text\" name=\"id\" maxlength=\"6\" emptyok=\"true\" format=\"*N\"/><br/>
<anchor>
OK
<go href=\"id_spisok.php\" method=\"get\">
<postfield name=\"log\" value=\"$log\"/>
<postfield name=\"pass\" value=\"$pass\"/>
<postfield name=\"mode\" value=\"user_info_ok\"/>
<postfield name=\"idi\" value=\"$(id)\"/>
</go>
</anchor>
<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/>
</p>
";*/

break;

case "vkat": //список категорий

$where_data=$_GET['c'];

echo "<p><small>";

If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$res=mysql_query("select * from `cool_site` order by `tin` desc ");
$kol=mysql_num_rows($res);
}

else { 
$resax=mysql_query("select * from `cool_raz` where id='$where_data' ");
$row=mysql_num_rows($resax);
if ($row=="0")
{
print "O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"katalog.php\">Ha&#x0437;a&#x0434;</a><br/></small></p></card></wml>";
exit;
}

$res=mysql_query("select * from `cool_site` where category='$where_data' order by `tin` desc ");
$kol=mysql_num_rows($res);
}

  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;
}else $page=$HTTP_GET_VARS['page'];
for ($i=($page-1)*$kolich_adm;$i<($kolich_adm*$page);$i++){
If ($i>=$kol) break;


$idss=mysql_result($res,$i,"id");
$link=mysql_result($res,$i,"link");
$title=mysql_result($res,$i,"title");
$about=mysql_result($res,$i,"about");
$tin=mysql_result($res,$i,"tin");
$toout=mysql_result($res,$i,"toout");
$ins=mysql_result($res,$i,"ins");
$outs=mysql_result($res,$i,"outs");
$act=mysql_result($res,$i,"activ");

echo "<b>id - $idss <a href=\"../out.php?go=$idss\">$title</a></b><br/>[$link]     <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usinfo&amp;c=$where_data&amp;page=$page&amp;id=$idss\">[&#x0418;&#x043D;&#x0444;o]</a><br/>$about<br/>
<u>&#x0417;a &#x043C;ec&#x044F;&#x0446;:    B: $ins | &#x0418;&#x0437;: $outs</u><br/><u>Ce&#x0433;o&#x0434;&#x043D;&#x044F;:    B: $tin | &#x0418;&#x0437;: $toout</u><br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usdel&amp;c=$where_data&amp;page=$page&amp;id=$idss\">del</a>  ||"; if ($act==1) { echo"<b>Active</b>|| <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usban&amp;c=$where_data&amp;page=$page&amp;id=$idss\">&#x0417;a&#x0431;a&#x043D;&#x0438;&#x0442;&#x044C;</a><br/>";} 
else {echo"<b>BANNED</b>|| <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usrazban&amp;c=$where_data&amp;page=$page&amp;id=$idss\">Pa&#x0437;&#x0431;a&#x043D;</a><br/>";}  echo"-----<br/>";
}

If ($page>1) {  $pagep=$page-1;  echo "
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$pagep\">Ha&#x0437;a&#x0434;</a><br/>"; }
If ((ceil($kol/$kolich_adm))>$page) { $page++;    echo "

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">&#x0414;a&#x043B;&#x044C;&#x0448;e</a><br/>";}

$totalp=ceil($kol/10);
if ($totalp>1) {
  echo "<br/>страница</small> <input type=\"text\" name=\"pg\" size=\"2\" value=\"$totalp\" format=\"*N\"/><small>
<anchor> перейти
<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data\" method=\"get\">
<postfield name=\"page\" value=\"$(pg)\"/>
</go>
</anchor><br/>Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: $totalp";
  }
  if ($totalp<2) {
 print  'Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: 1'; }

echo "<br/>-----<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></small></p>";

break;




case "usdel": //список категорий
  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;}else $page=$HTTP_GET_VARS['page'];
If (!isset($_GET['id']) || !is_numeric($_GET['id'])  ||  $_GET['id']<0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";


mysql_query ("delete from `cool_site` where id='".$_GET['id']."' ;");
mysql_query ("delete from `oper_in` where idaa='".$_GET['id']."' ;");

echo "Ca&#x0439;&#x0442; yc&#x043F;e&#x0448;&#x043D;o y&#x0434;a&#x043B;e&#x043D;!<br/>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434; &#x0432; &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044E;</a><br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkatn&amp;page=$page\">Ha&#x0437;a&#x0434; &#x043A; &#x043D;ea&#x043A;&#x0442;&#x0438;&#x0432;&#x043D;&#x044B;&#x043C;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "usban": 
  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;}else $page=$HTTP_GET_VARS['page'];
If (!isset($_GET['id']) || !is_numeric($_GET['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";


mysql_query("update `cool_site` set `activ`='0' where id='$id';");


echo "Ca&#x0439;&#x0442; &#x0437;a&#x0431;a&#x043D;e&#x043D;!!!<br/>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;
case "usrazban": 
  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;}else $page=$HTTP_GET_VARS['page'];
If (!isset($_GET['id']) || !is_numeric($_GET['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";


mysql_query("update `cool_site` set `activ`='1' where id='$id';");


echo "Ca&#x0439;&#x0442; yc&#x043F;e&#x0448;&#x043D;o pa&#x0437;&#x0431;a&#x043D;e&#x043D;!<br/>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;


case "usinfo": 

  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;}else $page=$HTTP_GET_VARS['page'];
If (!isset($_GET['id']) || !is_numeric($_GET['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";


$passw=mysql_result($result,0,"pass");
$ltime=mysql_result($result,0,"ltime");
$link=mysql_result($result,0,"link");
$email=mysql_result($result,0,"email");
//$out_all=mysql_result($result,0,"out_all");
$currDate=date("d.m.y", $ltime);
$act=mysql_result($result,0,"activ");

echo "<b>id - $id</b>"; if ($act==1) { echo"<b>Active</b>";} 
else {echo"<b>BANNED</b>";
}
 echo"<br/>&#x0414;a&#x0442;a pe&#x0433;&#x0438;c&#x0442;pa&#x0446;&#x0438;&#x0438;: <u>$currDate</u><br/>
Ca&#x0439;&#x0442;: <u>$link</u><br/>
&#x041F;apo&#x043B;&#x044C;: <u>$passw</u><br/>
E-mail: <u>$email</u><br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=edit&amp;id=$id\">&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;</a><br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;


case "edit": 

If (!isset($_GET['id']) || !is_numeric($_GET['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}


print "<p>";


$passw=mysql_result($result,0,"pass");
$ltime=mysql_result($result,0,"ltime");
$link=mysql_result($result,0,"link");
$email=mysql_result($result,0,"email");
$about=mysql_result($result,0,"about");
$categ=mysql_result($result,0,"category");
$title=mysql_result($result,0,"title");
$currDate=date("d.m.y", $ltime);
echo "Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"title\" maxlength=\"30\" value=\"$title\"/><br/>
		A&#x0434;pec:<br/>
		<input type=\"text\" name=\"link\" maxlength=\"100\" value=\"$link\"/><br/>";
		print"Ka&#x0442;e&#x0433;op&#x0438;&#x044F;:<br/><select name=\"k\" value=\"$categ\">";
		$q=mysql_query("select * from `cool_raz` where 1 order by por asc");
		while($datas = @mysql_fetch_array($q)){
		print"<option value=\"".$datas['id']."\">".$datas['text']."</option>";}
		print"</select><br/>
		O&#x043F;&#x0438;ca&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"about\" maxlength=\"250\" value=\"$about\"/><br/>
		Ho&#x0432;&#x044B;&#x0439; &#x041F;apo&#x043B;&#x044C;:<br/>
		<input type=\"text\" name=\"passw\" maxlength=\"30\" value=\"$passw\"/><br/>
		E-Mail:<br/>
		<input type=\"text\" name=\"email\" maxlength=\"70\" value=\"$email\"/><br/>
	
		<anchor>&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;
		<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=edit_ok\" method=\"post\">
		<postfield name=\"title\" value=\"$(title)\"/>
		<postfield name=\"id\" value=\"$id\"/>
		<postfield name=\"passw\" value=\"$(passw)\"/>
		<postfield name=\"link\" value=\"$(link)\"/>
		<postfield name=\"about\" value=\"$(about)\"/>
		<postfield name=\"email\" value=\"$(email)\"/>
	
		<postfield name=\"k\" value=\"$(k)\"/>
		</go></anchor><br/>";

echo "
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</p>";


break;

case "edit_ok": 

If (!isset($_POST['id']) || !is_numeric($_POST['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_POST['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}


print "<p><small>";
$title=trimcode($title);

//$title=coding_cool(substr(trim($title), 0, 50));
$link=coding_cool(substr(trim($link), 0, 100));
$about=coding_cool(substr(trim($about), 0, 300));
$passw=coding_cool(substr(trim($passw), 0, 30));
$email=coding_cool(substr(trim($email), 0, 70));
mysql_query("update `cool_site` set title='$title',email='$email',pass='$passw',link='$link',about='$about',category='$k' where id='$id';");
echo "Ca&#x0439;&#x0442; yc&#x043F;e&#x0448;&#x043D;o &#x0438;&#x0437;&#x043C;e&#x043D;e&#x043D;!!!<br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;
case "nkat": 


print "<p>";

print" Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
<input type=\"text\" name=\"razd\" maxlength=\"200\" /><br/>
Pac&#x043F;o&#x043B;o&#x0436;e&#x043D;&#x0438;e:<br/>
<input name=\"por\" format=\"*N\" maxlength=\"5\"/><br/>
<anchor title=\"go\">&#x0414;o&#x0431;a&#x0432;&#x0438;&#x0442;&#x044C;<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=nkat_ok\" method=\"post\">
<postfield name=\"razd\" value=\"$(razd)\"/>
<postfield name=\"por\" value=\"$(por)\"/>
</go></anchor><br/>

<small>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ka&#x0442;e&#x0433;op&#x0438;&#x0438;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;


case "nkat_ok": 

If (!isset($_POST['por']) || !is_numeric($_POST['por'])){
echo "<p>
&#x0417;a&#x043F;poc &#x043D;e &#x043F;o&#x043B;&#x043D;&#x044B;&#x0439;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$razd=del($razd);
$razd=trimcode($razd);
if(!$razd)
		{
echo "<p>
&#x0417;a&#x043F;poc &#x043D;e &#x043F;o&#x043B;&#x043D;&#x044B;&#x0439;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}



mysql_query("insert into `cool_raz` values(0, '$por', '$razd')");

echo "<p>";

echo "<small>Ka&#x0442;e&#x0433;op&#x0438;&#x044F; yc&#x043F;e&#x0448;&#x043D;o &#x0434;o&#x0431;a&#x0432;&#x043B;e&#x043D;a!<br/>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ka&#x0442;e&#x0433;op&#x0438;&#x0438;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
echo "</small></p>";


break;
case "delkat": 
If (!isset($_GET['c']) || !is_numeric($_GET['c'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$c=$_GET['c'];
$result=mysql_query("select * from `cool_raz` where id='$c';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";


mysql_query ("delete from `cool_raz` where id='".$_GET['c']."' ;");


echo "Ka&#x0442;e&#x0433;op&#x0438;&#x044F; yc&#x043F;e&#x0448;&#x043D;o y&#x0434;a&#x043B;e&#x043D;a!<br/>-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "edkat": 

If (!isset($_GET['c']) || !is_numeric($_GET['c'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$c=$_GET['c'];
$result=mysql_query("select * from `cool_raz` where id='$c';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}


print "<p>";


$por=mysql_result($result,0,"por");
$text=mysql_result($result,0,"text");
echo "Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"text\" maxlength=\"50\" value=\"$text\"/><br/>
		Pac&#x043F;o&#x043B;o&#x0436;e&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"por\" maxlength=\"5\" value=\"$por\" format=\"*N\"/><br/>
	    <anchor>&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=edkat_ok\" method=\"post\">
		<postfield name=\"text\" value=\"$(text)\"/>
		<postfield name=\"c\" value=\"$c\"/>
		<postfield name=\"por\" value=\"$(por)\"/>
		</go></anchor><br/>";

echo "
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkat&amp;c=$where_data&amp;page=$page\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</p>";


break;


case "edkat_ok": 

If (!isset($_POST['c']) || !is_numeric($_POST['c'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$c=$_POST['c'];
$result=mysql_query("select * from `cool_raz` where id='$c';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;a &#x043A;a&#x0442;e&#x0433;op&#x0438;&#x044F;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
If (!isset($_POST['por']) || !is_numeric($_POST['por'])){
echo "<p>
&#x0417;a&#x043F;poc &#x043D;e &#x043F;o&#x043B;&#x043D;&#x044B;&#x0439;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$por=$_POST['por'];


$text=del($text);
$text=trimcode($text);
if(!$text)
		{
echo "<p>
&#x0417;a&#x043F;poc &#x043D;e &#x043F;o&#x043B;&#x043D;&#x044B;&#x0439;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

print "<p><small>";
$text=trimcode($text);


mysql_query("update `cool_raz` set text='$text', por='$por'  where id='$c';");
echo "Ka&#x0442;e&#x0433;op&#x0438;&#x044F; yc&#x043F;e&#x0448;&#x043D;o &#x0438;&#x0437;&#x043C;e&#x043D;e&#x043D;a!<br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "vkatn": //список категорий

$where_data=$_GET['c'];

echo "<p><small>";

If (!isset($_GET['c']) || !is_numeric($_GET['c']) || $_GET['c']<0) 
{
$res=mysql_query("select * from `cool_site` where ins='0' order by `id` ");
$kol=mysql_num_rows($res);
}

else { 
$resax=mysql_query("select * from `cool_raz` where id='$where_data' ");
$row=mysql_num_rows($resax);
if ($row=="0")
{
print "O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"katalog.php\">Ha&#x0437;a&#x0434;</a><br/></small></p></card></wml>";
exit;
}

$res=mysql_query("select * from `cool_site` where ins='0' order by `id`  ");
$kol=mysql_num_rows($res);
}

  If (!isset($_GET['page']) || (ceil($kol/$kolich_adm))<$_GET['page'] || !is_numeric($_GET['page'])){
$page=1;
}else $page=$HTTP_GET_VARS['page'];
for ($i=($page-1)*$kolich_adm;$i<($kolich_adm*$page);$i++){
If ($i>=$kol) break;


$idss=mysql_result($res,$i,"id");
$link=mysql_result($res,$i,"link");
$title=mysql_result($res,$i,"title");
$about=mysql_result($res,$i,"about");
$tin=mysql_result($res,$i,"tin");
$toout=mysql_result($res,$i,"toout");
$ins=mysql_result($res,$i,"ins");
$outs=mysql_result($res,$i,"outs");
$act=mysql_result($res,$i,"activ");

echo "<b>id - $idss <a href=\"../out.php?go=$idss\">$title</a></b><br/>[$link]     <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usinfo&amp;c=$where_data&amp;page=$page&amp;id=$idss\">[&#x0418;&#x043D;&#x0444;o]</a><br/>$about<br/>
<u>&#x0417;a &#x043C;ec&#x044F;&#x0446;:    B: $ins | &#x0418;&#x0437;: $outs</u><br/><u>Ce&#x0433;o&#x0434;&#x043D;&#x044F;:    B: $tin | &#x0418;&#x0437;: $toout</u><br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usdel&amp;c=$where_data&amp;page=$page&amp;id=$idss\">del</a>  ||"; if ($act==1) { echo"<b>Active</b>|| <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usban&amp;c=$where_data&amp;page=$page&amp;id=$idss\">&#x0417;a&#x0431;a&#x043D;&#x0438;&#x0442;&#x044C;</a><br/>";} 
else {echo"<b>BANNED</b>|| <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=usrazban&amp;c=$where_data&amp;page=$page&amp;id=$idss\">Pa&#x0437;&#x0431;a&#x043D;</a><br/>";}  echo"-----<br/>";
}

If ($page>1) {  $pagep=$page-1;  echo "
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkatn&amp;page=$pagep\">Ha&#x0437;a&#x0434;</a><br/>"; }
If ((ceil($kol/$kolich_adm))>$page) { $page++;    echo "

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkatn&amp;page=$page\">&#x0414;a&#x043B;&#x044C;&#x0448;e</a><br/>";}

$totalp=ceil($kol/10);
if ($totalp>1) {
  echo "<br/>страница</small> <input type=\"text\" name=\"pg\" size=\"2\" value=\"$totalp\" format=\"*N\"/><small>
<anchor> перейти
<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=vkatn\" method=\"get\">
<postfield name=\"page\" value=\"$(pg)\"/>
</go>
</anchor><br/>Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: $totalp";
  }
  if ($totalp<2) {
 print  'Bce&#x0433;o c&#x0442;pa&#x043D;&#x0438;&#x0446;: 1'; }

echo "<br/>-----<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></small></p>";

break;
case "searh_s": 

  echo "
<p> B&#x0432;e&#x0434;&#x0438;&#x0442;e ca&#x0439;&#x0442;:<br/><input type=\"text\" name=\"site\" maxlength=\"100\" value=\"http://\"/><br/>

<anchor>OK

<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=searh_s_ok\" method=\"get\">

<postfield name=\"site\" value=\"$(site)\"/>
</go>
</anchor><br/>-----<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></p>";
break;

case "searh_s_ok": 

$site=$_GET['site'];

$site=del($site);
$site=trimcode($site);
if(!$site)
		{
echo "<p>
He y&#x043A;a&#x0437;a&#x043D; ca&#x0439;&#x0442;!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$result=mysql_query("select * from `cool_site` where link='$site';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
Ta&#x043A;o&#x0433;o ca&#x0439;&#x0442;a &#x043D;e cy&#x0449;ec&#x0442;&#x0432;ye&#x0442;! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

$id=mysql_result($result,0,"id");
$title=mysql_result($result,0,"title");
$link=mysql_result($result,0,"link");
$email=mysql_result($result,0,"email");
$about=mysql_result($result,0,"about");
$outs=mysql_result($result,0,"outs");
$ins=mysql_result($result,0,"ins");
$tin=mysql_result($result,0,"tin");
$cat=mysql_result($result,0,"category");
$toout=mysql_result($result,0,"toout");
$results=mysql_query("select * from `cool_raz` where id='$cat';");
$text=mysql_result($results,0,"text");
print "<p><small>";




echo "<b>id - $id</b> Ka&#x0442;e&#x0433;op&#x0438;&#x044F;: <u>$text</u><br/>  $title<br/><a href=\"$link\">$link</a><br/>$about<br/>
Ce&#x0433;o&#x0434;&#x043D;&#x044F; IN: $tin ||  OUT: $toout<br/>  
&#x0417;a &#x043C;ec&#x044F;&#x0446;  IN: $ins ||  OUT:  $outs<br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "searh_id": 

  echo "
<p> B&#x0432;e&#x0434;&#x0438;&#x0442;e id:<br/><input type=\"text\" name=\"id\" maxlength=\"5\" format=\"*N\"/><br/>

<anchor>OK

<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=searh_id_ok\" method=\"get\">

<postfield name=\"id\" value=\"$(id)\"/>
</go>
</anchor><br/>-----<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></p>";
break;

case "searh_id_ok": 
If (!isset($_GET['id']) || !is_numeric($_GET['id'])){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}


$site=mysql_result($result,0,"site");
$title=mysql_result($result,0,"title");
$link=mysql_result($result,0,"link");
$email=mysql_result($result,0,"email");
$about=mysql_result($result,0,"about");
$outs=mysql_result($result,0,"outs");
$ins=mysql_result($result,0,"ins");
$tin=mysql_result($result,0,"tin");
$cat=mysql_result($result,0,"category");
$toout=mysql_result($result,0,"toout");
$results=mysql_query("select * from `cool_raz` where id='$cat';");
$text=mysql_result($results,0,"text");
print "<p><small>";




echo "<b>id - $id</b> Ka&#x0442;e&#x0433;op&#x0438;&#x044F;: <u>$text</u><br/>  $title<br/><a href=\"$link\">$link</a><br/>$about<br/>
Ce&#x0433;o&#x0434;&#x043D;&#x044F; IN: $tin ||  OUT: $toout<br/>  
&#x0417;a &#x043C;ec&#x044F;&#x0446;  IN: $ins ||  OUT:  $outs<br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=cats\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "ob":
echo "
<p>";
print "Название:<br/><input type=\"text\" name=\"tit\"/><br/>
A&#x0434;pec:<br/><input type=\"text\" name=\"site\" value=\"http://\"/><br/>
<anchor>Добавить<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=mobi\" method=\"post\">

<postfield name=\"tit\" value=\"$(tit)\"/>
<postfield name=\"site\" value=\"$(site)\"/>
</go></anchor><br/><br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/></p>";
break;

case "mobi":

$sites=$_POST['site'];

$sites=del($sites);
$sites=trimcode($sites);
if(!$sites)
		{
echo "<p>
He y&#x043A;a&#x0437;a&#x043D; a&#x0434;pec!<br/>

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob\">Ha&#x0437;a&#x0434;</a>
</p></card></wml>";
exit;
}

$titles=$_POST['tit'];
if(!$titles)
		{
echo "<p>
He &#x0432;&#x0432;e&#x0434;e&#x043D;o &#x043D;a&#x0437;&#x0432;a&#x043D;&#x0438;e!<br/>

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob\">Ha&#x0437;a&#x0434;</a>
</p></card></wml>";
exit;
} 

$titles=trimcode($titles);

echo "<p>";


mysql_query("insert into `obiav` values(0,'$titles','$sites')");
echo "<small>
Pe&#x043A;&#x043B;a&#x043C;a yc&#x043F;e&#x0448;&#x043D;o &#x0434;o&#x0431;a&#x0432;&#x043B;e&#x043D;a!<br/>-----<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/></small>
</p>";
break;

case "ob_d":

$q = mysql_query("select * from `obiav` order by `id` desc ");
$kol=mysql_num_rows($q);
if ($kol==0)
{
print "<p>
Pe&#x043A;&#x043B;a&#x043C;&#x043D;&#x044B;x cc&#x044B;&#x043B;o&#x043A; &#x043D;e o&#x0431;&#x043D;apy&#x0436;e&#x043D;o!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/></p></card></wml>";
exit;
}
else {
echo "<p><small>";
while($arr=mysql_fetch_array($q)) {
echo " ".$arr['title']."<br/>   <a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob_d_ok&amp;mid=".$arr['id']."\">&#x0423;&#x0434;a&#x043B;&#x0438;&#x0442;&#x044C;</a><br/><a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob_ed&amp;mid=".$arr['id']."\">&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;</a><br/><br/>"; }
echo "-----<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/></small></p>"; 
}
break;

case "ob_d_ok":
If (!isset($_GET['mid']) ||  !is_numeric($_GET['mid'])  ||  $_GET['mid']<0){
print "<p>
Pe&#x043A;&#x043B;a&#x043C;&#x043D;&#x044B;x cc&#x044B;&#x043B;o&#x043A; &#x043D;e o&#x0431;&#x043D;apy&#x0436;e&#x043D;o!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass&amp;mode=ob_d\">Ha&#x0437;a&#x0434;</a><br/></p></card></wml>";
exit;
}
$mid=$_GET['mid'];
$q = mysql_query("select * from `obiav` where id='$mid'");
$kol=mysql_num_rows($q);
if ($kol==0)
{
print "<p>
Pe&#x043A;&#x043B;a&#x043C;&#x043D;&#x044B;x cc&#x044B;&#x043B;o&#x043A; &#x043D;e o&#x0431;&#x043D;apy&#x0436;e&#x043D;o!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass&amp;mode=ob_d\">Ha&#x0437;a&#x0434;</a><br/></p></card></wml>";
exit;
}
mysql_query("delete from `obiav` where id='$mid' limit 1");  echo "<p><small>
Cc&#x044B;&#x043B;&#x043A;a yc&#x043F;e&#x0448;&#x043D;o y&#x0434;a&#x043B;e&#x043D;a!<br/>-----<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a><br/></small></p>";
break;

case "ob_ed": 
If (!isset($_GET['mid']) || !is_numeric($_GET['mid'])  ||  $_GET['mid']<0){
echo "<p>
O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$mid=$_GET['mid'];
$result=mysql_query("select * from `obiav` where id='$mid';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
&#x0442;a&#x043A;o&#x0439; cc&#x044B;&#x043B;&#x043A;&#x0438; &#x043D;e cy&#x0449;ec&#x0442;&#x0432;ye&#x0442;! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
print "<p>";
$sites=mysql_result($result,0,"site");
$titl=mysql_result($result,0,"title");
echo "Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"titl\"  value=\"$titl\"/><br/>
		A&#x0434;pec:<br/>
		<input type=\"text\" name=\"sites\" value=\"$sites\"/><br/>
	    <anchor>&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob_ed_ok&amp;mid=$mid\" method=\"post\">
		<postfield name=\"titl\" value=\"$(titl)\"/>		
		<postfield name=\"sites\" value=\"$(sites)\"/>
		</go></anchor><br/>";

echo "
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob_d\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</p>";
break;

case "ob_ed_ok": 
If (!isset($_GET['mid']) || !is_numeric($_GET['mid'])  ||  $_GET['mid']<0){
echo "<p>
O&#x0448;&#x0438;&#x0431;&#x043A;a!<br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$mid=$_GET['mid'];
$result=mysql_query("select * from `obiav` where id='$mid';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
&#x0442;a&#x043A;o&#x0439; cc&#x044B;&#x043B;&#x043A;&#x0438; &#x043D;e cy&#x0449;ec&#x0442;&#x0432;ye&#x0442;! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}

$sites=$_POST['sites'];

$sites=del($sites);
$sites=trimcode($sites);
if(!$sites)
		{
echo "<p>
He y&#x043A;a&#x0437;a&#x043D; a&#x0434;pec!<br/>

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob\">Ha&#x0437;a&#x0434;</a>
</p></card></wml>";
exit;
}

$titl=$_POST['titl'];
if(!$titl)
		{
echo "<p>
He &#x0432;&#x0432;e&#x0434;e&#x043D;o &#x043D;a&#x0437;&#x0432;a&#x043D;&#x0438;e!<br/>

<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob\">Ha&#x0437;a&#x0434;</a>
</p></card></wml>";
exit;
} 

$titl=trimcode($titl);


print "<p><small>";



mysql_query("update `obiav` set title='$titl', site='$sites'  where id='$mid';");
echo "Pe&#x043A;&#x043B;a&#x043C;a yc&#x043F;e&#x0448;&#x043D;o &#x0438;&#x0437;&#x043C;e&#x043D;e&#x043D;a!<br/>
-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=ob_d\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;

case "nakr": 

  echo "
<p> B&#x0432;e&#x0434;&#x0438;&#x0442;e id:<br/><input type=\"text\" name=\"id\" maxlength=\"5\" format=\"*N\"/><br/>
 Ko&#x043B;&#x0438;&#x0447;ec&#x0442;&#x0432;o:<br/><input type=\"text\" name=\"koll\" maxlength=\"5\" format=\"*N\"/><br/>
<anchor>OK

<go href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=nakr_ok\" method=\"get\">

<postfield name=\"id\" value=\"$(id)\"/>
<postfield name=\"koll\" value=\"$(koll)\"/>
</go>
</anchor><br/>-----<br/><a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a></p>";
break;

case "nakr_ok": 
If (!isset($_GET['id']) || !is_numeric($_GET['id'])  ||  $_GET['id']<0 ){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$id=$_GET['id'];
$result=mysql_query("select * from `cool_site` where id='$id';");
$row=mysql_num_rows($result);
if ($row==0){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D; id! <br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
If (!isset($_GET['koll']) || !is_numeric($_GET['koll'])  ||  $_GET['koll']<0 ){
echo "<p>
He&#x0432;ep&#x043D;o y&#x043A;a&#x0437;a&#x043D;o &#x043A;o&#x043B;&#x0438;&#x0447;ec&#x0442;&#x0432;o!<br/>

<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>
</p></card></wml>";
exit;
}
$koll=$_GET['koll'];
$resultss=mysql_query("select `tin`  from `cool_site` where id=$id ");
$ish=mysql_result($resultss,0,"tin");
$ok=$ish+$koll;
    mysql_query("update `cool_site` set `tin`=$ok where id=$id");
    $resultat=mysql_query("select `ins`  from `cool_site` where id=$id ");
$ishs=mysql_result($resultat,0,"ins");
$oks=$ishs+$koll;
mysql_query("update `cool_site` set `ins`=$oks where id=$id");
print "<p><small>


&#x041F;epexo&#x0434;&#x044B; &#x043D;a&#x043A;py&#x0447;e&#x043D;&#x044B;!<br/>

-----<br/>
<a href=\"adms.php?log=$log&amp;pass=$pass&amp;mode=nakr\">Ha&#x0437;a&#x0434;</a><br/>
<a href=\"index.php?log=$log&amp;pass=$pass\">A&#x0434;&#x043C;&#x0438;&#x043D;-&#x041F;a&#x043D;e&#x043B;&#x044C;</a>";
print "</small></p>";


break;


}
echo "</card></wml>";




?>