View file web/adminrequest.php

File size: 5.29Kb
<?php
include("config.php");
include("core.php");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//header('Content-type: application/vnd.wap.xhtml+xml'); 
echo "<?xml version=\"1.0\"?>";
echo "<!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">
<?php
$bcon = connectdb();
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];

if (!$bcon)
{
    echo "<head>";
    echo "<title>Error!!!</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
    echo "</head>";
    echo "<body>";
    echo "<p align=\"center\">";
    echo "<img src=\"../images/notok.gif\" alt=\"!\"/><br/>";
    echo "<b><strong>Error! Cannot Connect To Database...</strong></b><br/><br/>";
    echo "This error happens usually when backing up the database, please be patient...";
    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
}
$brws = explode("/",$HTTP_USER_AGENT);
$ubr = $brws[0];
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];
$uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$sqlthing = mysql_query("SELECT * FROM ibwf_users WHERE id='$uid'");
   $name=(mysql_result($sqlthing,0,"name"));
cleardata();

if(($action != "") && ($action!="terms"))
{
    $uid = getuid_sid($sid);
    if((islogged($sid)==false)||($uid==0))
    {
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    } 
}
//echo isbanned($uid);
if(isbanned($uid))
    {
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
      echo "<b>You are Banned</b><br/><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
	$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "<b>Time Left: </b>$rmsg<br/>";
      $nick = getnick_uid($banto[2]);
      echo "<b>By: </b>$nick<br/>";
      echo "<b>Reason: </b>$banto[1]";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
$res = mysql_query("UPDATE ibwf_users SET browserm='".$brws4."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////MAIN PAGE
if($action=="main")
{
  addvisitor();
  $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
  addonline(getuid_sid($sid),"admin request ($mmsg)","");
  //saveuinfo($sid);

  echo "<head>";
  echo "<title>Shop</title>";
  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
  echo "</head>";
  echo "<body>";

  echo "<p align=\"center\">";
  echo "This is to request an admin job:</p>";
  echo "<p align=\"center\">";
  echo "An Inbox will be sent to the owner:</p>";
  echo "<p align=\"center\">";

    echo "<p align=\"center\">";
    echo "REQUEST AN ADMIN JOB<br/>";

    echo "</p>"; 
    echo "<p align=\"center\">";
    echo "<form action=\"adminrequest.php?action=admin&amp;sid=$sid&amp;whoid=$uid\" method=\"post\">";

    echo "<center><input type=\"Submit\" Name=\"Submit\" Value=\"REQUEST\"></center></form>";
    echo "</p>";    

/*    

*/
  echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p>";
  echo "</body>";
}

else if($action=="admin")
{
  echo "<head>";
  echo "<title>Admin Request</title>";
  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
  echo "</head>";
  echo "<body>";
    echo "<p align=\"center\">";
    $ownid[0]=1;
    $who=$_GET["whoid"];
    $whoid=$_GET["who"];
  $message = $_POST["message"];
  $message3 = "AUTOMATED PM-This user has requested to be site admin, please contact them directly regarding this matter";


    mysql_query("INSERT INTO ibwf_private SET text='".$message3."', byuid='".$uid."', touid='".$ownid[0]."', unread='1', timesent='".time()."'");
	echo "You have requested an admin job, The site owner will contact you as soon as possible regarding your request<br/>";


    echo "<p align=\"center\">";
  echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p>";
    echo "</body>";
}

?>


</html>