Просмотр файла guest/admin.php

Размер файла: 7.48Kb
<?
	/////////// Powered by Giga!!! /////////
	/////////// http://gwap.net.ru /////////
	/////////// [email protected] /////////
	include "set.php";
	echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Cache-Control" content="must-revalidate" forua="true"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>
<meta http-equiv="Cache-control" content="max-age=2" forua="true"/>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>';
echo "<title>$site-гостевая</title>";
echo '<link rel="shortcut icon" href="/images/icon.gif"/>
<link rel="home" href="/"/><link rel="up" href="../"/>
<style type="text/css">
	body {background-color:#FFFFFF; margin:0px; padding:0px; font-family: sans-serif; font-size: small;}
	h1 {color: #000000;font-size: medium;}
	h2 {color: #666666; font-size: medium;}
	img {border:0px; border-spacing:0;}
	table.header {border-spacing:0; font-size:0px; }
	td, div {margin: 0 0 0 0; padding: 0 0 0 0;}
	.block {display:block; float: left;}
	a {color: #ff0000; text-decoration: none; font-size: small}
	.UpLink a {text-transform: uppercase;}
</style>
</head>
<body>';
if ($act=="")
{echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"http://$site\"><font size=\"2\" color=\"maroon\">$site</font></a></td></tr>
  </table>
  ";
	echo '<form action="?act=prov" method="post">
пароль админа:<br/>
<input title="pas" name="pasvord"/>
<br/><input value="вход" name="do" type="submit"/></form>';
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"./\"><font size=\"2\" color=\"maroon\">гостевая</font></a></td></tr>
  </table>
  ";
  }
if ($act=="prov")
{echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"http://$site\"><font size=\"2\" color=\"maroon\">$site</font></a></td></tr>
  </table>
  ";
	if($pas==$pasvord)
 {
                       print"<p align=\"center\">
 пароль верный!<br/>

<a href=\"?act=view&amp;pass=$pasvord\">администрирование</a><br/>
</p>";}
else 
{
print "ошибка авторизации<br/><a href=\"./admin.php\">еще раз?</a>";
};
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"./\"><font size=\"2\" color=\"maroon\">гостевая</font></a></td></tr>
  </table>
  ";
  }
if ($act=="view")
{
	if($pass==$pas)
 {
  $dir_rec = dir("rec");
  $i = 0;
  while($entry = $dir_rec->read())
  {
    if (substr($entry,0,3)=="rec")
    {
      $names[$i]=substr($entry,4);
      $i++;
    }
  }
  $dir_rec->close();
  @rsort($names);
  $count = $i;
  $count1 = $count;
  if (empty($start))
  {
    $start = 0;
  }
  $start = intval($start);
  if ($start < 0)
  {
    $start = 0;
  }
  echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"http://$site\"><font size=\"2\" color=\"maroon\">$site</font></a></td></tr>
  <tr align=\"center\"><td>
  ";
  
  if ($count > $start + $pp) $count = $start + $pp;
  if ($start != 0)
  {
    print "<a href=index.php?start=".($start - $pp)."><font size=\"1\">назад</font></a>:";
  }
  print "<a href=add.php><font size=\"1\">добавить</font></a>";
  if ($count1 > $start + $pp)
  {
    print ":<a href=index.php?start=".($start + $pp)."><font size=\"1\">далее</font></a> \n";
  }
  print "</td></tr></table>";
   for ($i = $start; $i < $count; $i++)
  {
    $entry = $names[$i];
    $data = file("rec/rec.".$entry);
    $date = $entry;
    $name = trim($data[0]);
    $time = trim($data[1]);
    $email = trim($data[2]);
    $url = trim($data[3]);
    $msg = trim($data[4]);
    $answer = trim($data[5]);
    print "<table border=0 cellspacing=0 cellpadding=2 width=100%>
    <tr bgcolor=#FFFF99><td>";
    print "<b>$name:</b>";
    if (!empty($time)) print " $time";
    if (!empty($email)) print "/ <a href=mailto:$email><i>$email</i></A>\n";
    if (!empty($url)) print "/ <a href=\"http://$url\">$url</a>";
    print "</td><td align=right>№: $date</td></tr>\n<tr><td>";
    print "<p>".$msg."</p>\n";
    if (!empty($answer))
    {
      print "<P><font color=\"#FF0000\">Админ:$answer</font></P>\n";
    }   
    print "</td></tr></table>\n<br><a href=\"del.php?rf=rec.$entry&amp;pass=$pass\">удалить</a><br>
    <a href=\"?act=otv&amp;re=rec.$entry&amp;komu=$name&amp;pass=$pass\">ответить</a>";
  }
  print "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
<tr align=\"center\"><td>";
  if ($count > $start + $pp) $count = $start + $pp;
  if ($start != 0)
  {
    print "<a href=index.php?start=".($start - $pp)."><font size=\"1\">назад</font></a>:";
  }
  print "<a href=add.php><font size=\"1\">добавить</font></a>";
  if ($count1 > $start + $pp)
  {
    print ":<a href=index.php?start=".($start + $pp)."><font size=\"1\">далее</font></a> \n";
  }
  print "</td></tr><tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"http://$site\"><font size=\"2\" color=\"maroon\">$site</font></a></td></tr>
 </table>";
}
	else 
{
print "ошибка авторизации<br/><a href=\"./admin.php\">еще раз?</a>";
};
}
if ($act=="otv")
  {	
   echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"http://$site\"><font size=\"2\" color=\"maroon\">$site</font></a></td></tr>
  </table>
  ";
  	    if($pass==$pas)
 {
  	  $rf=$re;
  	  echo "ответ на сообщение <b>$komu</b>";
  	  echo "<form action=\"otv.php\" metod=\"post\">
  	  	  <input type=\"hidden\" name=\"rf\" value=\"$rf\">
  	  	  	  <input type=\"hidden\" name=\"pass\" value=\"$pass\">
  	  	 <br/>
  	  <input type=\"text\" name=\"answer\" maxlength=\"160\" value=\"\"><br/>
  	  <input value=\"добавить\" name=\"do\" type=\"submit\"/></form>";
  echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"?act=view&amp;pass=$pas\"><font size=\"2\" color=\"maroon\">адмир-панель</font></a></td></tr>
  </table>";
  }
  else 
{
print "ошибка авторизации<br/><a href=\"./admin.php\">еще раз?</a>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" width=\"100%\" bgcolor=\"#faad1e\">
  <tr bgcolor=\"#fce1ae\" align=\"center\"><td><a href=\"./\"><font size=\"2\" color=\"maroon\">гостевая</font></a></td></tr>
  </table>
  ";
};
}
  echo '</body></html>';
/////////// Лучшая и к тому же беплатная коллекция php скриптов на http://visavi.net !!! /////////
    ////////// Опасайтесь подделок!!! ///////////
    ///////// Удачи!!! ////////
    		?>