View file guest/admin.php

File size: 4.91Kb
<?
	/////////// Powered by Giga!!! /////////
	/////////// http://gwap.net.ru /////////
	/////////// [email protected] /////////
	Error_Reporting(E_ALL & ~E_NOTICE);
	include "set.php";
	include "header.php";
if (!$act)
{
	  echo "<p class=\"class1\">$title<br />$site<br />админ-панель</p>";

	echo '<form action="admin.php?act=prov" method="post">
		<p class="class2">
пароль админа
		<br />
<input type="password" name="admin_pass" />
        <br />
	<input type="submit" value="вход" />
		</p>
	</form>';
echo "<p class=\"class1\"><a href=\"./\">гостевая</a><br /><a href=\"http://$site\">$site</a></p>";
  }
if ($act=="prov")
{
	  echo "<p class=\"class1\">$title<br />$site<br />админ-панель</p>";

	if($pas==$admin_pass)
 {
                       echo "<p class=\"class2\">
 пароль верный!<br />

<a href=\"?act=view&amp;pass=$admin_pass\">администрирование</a><br />
</p>";}
else 
{
echo "<p class=\"class2\"><span class=\"red\">ошибка авторизации</span><br /><a href=\"./admin.php\">еще раз?</a></p>";
};
echo "<p class=\"class1\"><a href=\"./\">гостевая</a><br /><a href=\"http://$site\">$site</a></p>";
  }
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 "<p class=\"class1\">$title<br />$site<br />админ-панель</p>";
    echo "<p class=\"class1\">";

  if ($count > $start + $pp) $count = $start + $pp;
  if ($start != 0)
  {
    echo "<a href=\"admin.php?act=view&amp;pass=$pass&amp;start=".($start - $pp)."\">назад</a>:";
  }
  echo "<a href=\"add.php\">добавить</a>";
  if ($count1 > $start + $pp)
  {
    echo ":<a href=\"admin.php?act=view&amp;pass=$pass&amp;start=".($start + $pp)."\">далее</a> \n";
  }
  echo "</p>";
   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]);
   echo "<p class=\"class2\">$name:<br />";
    if (!empty($time)) echo " $time<br />";
    if (!empty($email)) echo "<a href=\"mailto:$email\">$email</a><br />\n";
    if (!empty($url)) echo "<a href=\"http://$url\">$url</a><br />";
    echo "№: $date<br />";
        echo "</p>";
        echo "<p class=\"class3\">";
    echo "$msg";
    if (!empty($answer))
    {
      echo "<br /><span class=\"red\">Админ: $answer</span><br />\n";
    } 
        echo "</p>";
  
    echo "<p class=\"class2\">
    	<a href=\"del.php?rf=rec.$entry&amp;pass=$pass\"><span class=\"red\">[удалить]</span></a>&nbsp;:&nbsp;<a href=\"?act=otv&amp;re=rec.$entry&amp;komu=$name&amp;pass=$pass\"><span class=\"red\">[ответить]</span></a>
    </p>";
  }
    echo "<p class=\"class1\">";
  if ($count > $start + $pp) $count = $start + $pp;
  if ($start != 0)
  {
    echo "<a href=\"admin.php?act=view&amp;pass=$pass&amp;start=".($start - $pp)."\">назад</a>:";
  }
  echo "<a href=\"add.php\">добавить</a>";
  if ($count1 > $start + $pp)
  {
    echo ":<a href=\"admin.php?act=view&amp;pass=$pass&amp;start=".($start + $pp)."\">далее</a> \n";
  }
echo "<p class=\"class1\"><a href=\"./\">гостевая</a><br /><a href=\"http://$site\">$site</a></p>";
}
	else 
{
echo "<p class=\"class2\"><span class=\"red\">ошибка авторизации</span><br /><a href=\"./admin.php\">еще раз?</a></p>";
};
}
if ($act=="otv")
  {	
   	  echo "<p class=\"class1\">$title<br />$site<br />админ-панель</p>";

  	    if($pass==$pas)
 {
  	  $rf=$re;
  	  echo "<p class=\"class2\">ответ на сообщение<br /> $komu</p>";
  	  echo "<form action=\"otv.php\" metod=\"post\">
  	  	  <p class=\"class2\">
  	  	  <input type=\"hidden\" name=\"rf\" value=\"$rf\" />
  	  	  	  <input type=\"hidden\" name=\"pass\" value=\"$pass\">
  	  <input type=\"text\" name=\"answer\" maxlength=\"160\" value=\"\">
  	  	  <br />
  	  <input type=\"submit\" value=\"ответить\" />
  	  </p>
  	  </form>";
  echo "<p class=\"class1\"><a href=\"admin.php?act=view&amp;pass=$pas\">адмир-панель</a></p>";
  }
  else 
{
echo "<p class=\"class2\"><span class=\"red\">ошибка авторизации</span><br /><a href=\"./admin.php\">еще раз?</a></p>";
};
echo "<p class=\"class1\"><a href=\"./\">гостевая</a><br /><a href=\"http://$site\">$site</a></p>";

}
  echo '</body></html>';
    		?>