<?php 
/*Realism Clan Manager - Best for extra management of Realism Gaming Clans/Community.
    Copyright (C) 2013  Michael Woods aka Blood_Wolf89

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, version 3 of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/ */

include_once '../include/admin_processes.php';

$Admin_Process = new Admin_Process;
$Admin_Process->check_status($_SERVER['SCRIPT_NAME']);
$New = $Admin_Process->Register($_POST, $_POST['add_user']);
$Suspend = $Admin_Process->suspend_user($_POST, $_POST['Suspend']);
$Change = $Admin_Process->update_user($_POST, $_POST['Change']);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Realsim Clan Manager - Admin</title>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<body>
<?php include('header.php')?>
<div id="main">
  <div class="container"><center>
<h1>Admin Center: <? echo $_SESSION['username']; ?><br />
</h1>

<div align="center"><a href="../main.php">Return to Main
  
</a></div>
<div class="red" align="center">
<?php  echo $_GET['alert']; ?></div>

<br />
</center>
</div>
</div>

<div id="main">
  <div align="center" class="container">
<h1>
<a name="active" id="active"></a>		Active Users </h1>
<?	$Admin_Process->active_users_table()  ?>
</div></div>

<div id="main">
  <div class="container">
<div align="center">
<h1> <a name="suspended" id="suspended"></a> Suspended Users </h1>
<?	$Admin_Process->suspended_users_table()  ?>
</div><br>

</div>
</div>

<div id="main">
  <div class="container">
<?php 
if(Admin_Approvial == true) {
echo '
<div align="center">
<h1> <a name="pending" id="pending"></a> Users Awating Approval </h1>';
$Admin_Process->pending_users_table();
echo '</div><br>';
}
?>
</center>
</div>
</div>

<div id="main">
  <div class="container"><center>
<div style="width:980px; margin:0 auto;">

<a name="add" id="add"></a>
<form action="<?php echo $_SERVER['PHP_SELF']."#add"; ?>" method="post" style="float:center; margin-top:0px;">
<h1> Add User</h1>

<div class="content"><?php echo $New; ?></div>

<div class="label">First Name:</div>
<input name="first_name" type="text" class="field" value="<? echo $_POST['first_name']; ?>" />
<br />

<div class="label">Last Name:</div>
<input name="last_name" type="text" class="field" value="<? echo $_POST['last_name']; ?>" />
<br />

<div class="label">Email Address:</div>
<input name="email_address" type="text" class="field" value="<? echo $_POST['email_address']; ?>" />
<br />

<div class="label">Information:</div>
<input name="info" type="text" class="field" value="<? echo $_POST['info']; ?>" />
<br />
<br />

<div class="label">Password:</div>
<input name="pass1" type="password" class="field"/>
<br />

<div class="label">Repeat Password:</div>
<input name="pass2" type="password" class="field"/>
<br />
<br />

<div class="label">Username:</div>
<input name="username" type="text" class="field" value="<? echo $_POST['username']; ?>" />
<br />


<div class="right">
		<input name="add_user" type="submit" id="add_user" value="Add User" />
</div>
</form>
<br />
</div></div>

<div id="main">
  <div class="container"><center>
<a name="change" id="change"></a>
<form action="<?php echo $_SERVER['PHP_SELF']."#change"; ?>" method="post" style="float:center; margin-top:0px;">

<h1> Change User Level</h1>
<div class="red"><?php echo $Change; ?> </div>
<div class="label">Username Name:</div>
<?php $Admin_Process->list_users() ?><br><br>
<div class="label">Username Level:</div>

<select name="level" id="level">
                                  <option value="1">1</option>
                                  <option value="2">2</option>
                                  <option value="3">3</option>
                                  <option value="4">4</option>
                                  <option value="5">5</option>
                                </select>

<div class="right">
<input name="Change" type="submit" class="textfield" value="Update" />
</div>

</form><br />

</div>
</div>

<div id="main">
  <div class="container"><center>

<a name="suspend" id="suspend"></a>
<form action="<?php echo $_SERVER['PHP_SELF']."#suspend"; ?>" method="post" style="float:center; margin-top:20px;">
<h1> Suspend User</h1>
<div class="red"><?php echo $Suspend; ?> </div>
<div class="label">Username Name:</div>
<?php $Admin_Process->list_users() ?><br><br>

<div class="label">Status</div>
<select name="level" id="level">
                                  <option value="suspended">Suspended</option>
                                  <option value="live">Live</option>
                                </select>


<div class="right">
<input name="Suspend" type="submit" class="textfield" value="Update" />
</div>

</form>
<br />
</div>


<?php include('../include/footer.php')?>

