<?PHP
//........................

$table = "ADMINS";
$editpage = "admins";
$return = "admins.php";

if (!empty($_GET['id'])) {

        $SQL = "SELECT * from $table WHERE ID = '$_GET[id]'"; 
        $result = mySQL_query( $SQL ); 
        $row = mySQL_fetch_array( $result );

} 

$qt = insert;
if (!empty($_GET['id']))
        $qt = update;

//........................

?>

<h1><?PHP /* (LANGUAGE) */ $t = "Administrators"; $f = "header"; include "langinc.php"; /* (LANGUAGE) */ ?></h1>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr> 

<td style="padding-right:10px;" width="50%" valign="top">

<form name="form" method="post" action="index.php?page=query">

<input type="hidden" name="controller" value="<?php echo $table; ?>~<?php echo $qt; ?>~<?php echo $return; ?>~<?php echo $_GET['id']; ?>">

<h3><?PHP /* (LANGUAGE) */ $t = "Username"; $f = "username"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<input class="fieldbox" type="text" name="USERNAME" value="<?php echo $row[USERNAME]; ?>" style="width: 100%;">

<h3 style="margin-top:15px;"><?PHP /* (LANGUAGE) */ $t = "Password"; $f = "password"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<input class="fieldbox" type="text" name="PASSWORD" value="<?php echo $row[PASSWORD]; ?>" style="width: 100%;">

<h3 style="margin-top:15px;"><?PHP /* (LANGUAGE) */ $t = "Email"; $f = "email"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<input class="fieldbox" type="text" name="EMAIL" value="<?php echo $row[EMAIL]; ?>" style="width: 100%;">

<?php
//........................
if (empty($_GET['id']))
        $add = "Add Administrator";
else
        $add = "Edit Administrator";
//........................
?>

<input style="margin-top: 15px;" type="submit" name="Submit" class="deltabutton" value="<?PHP /* (LANGUAGE) */ $t = "$add"; $f = "addedit"; include "langinc.php"; /* (LANGUAGE) */ ?>">

</form>

</td>

<td style="padding-left:10px;" width="50%" valign="top"> 

<form name="form" method="post" action="index.php?page=<?php echo $editpage; ?>&delete=1">

<h3><?PHP /* (LANGUAGE) */ $t = "Click a Username to Modify, Check to Delete"; $f = "adminbrowsercaption"; include "langinc.php"; /* (LANGUAGE) */ ?></h3>

<?php

include "delete.php";

//........................

if (empty($rowxxx[RECORDS])) $rowxxx[RECORDS] = 10;

$query1 = @mysql_query ("SELECT * FROM $table $where ORDER BY ID DESC"); $numrows = @mysql_num_rows ($query1);

if (!isset ($_GET['show']))
        $display = 1;
else
        $display = $_GET['show'];

$start = (($display * $rowxxx[RECORDS]) - $rowxxx[RECORDS]);
$query2 = @mysql_query ("SELECT * FROM $table $where ORDER BY ID DESC LIMIT $start,$rowxxx[RECORDS]");
while ($row = @mysql_fetch_array ($query2)) {     
        $gotsomerecords = 1;

//........................

?>

<table style="margin-bottom: 15px;" width="100%" cellspacing="0" cellpadding="0">

<tr> 

<td class="primebox" width="100%"> 

<input title="<?PHP /* (LANGUAGE) */ $t = "Check to Delete"; $f = "checkboxtip"; include "langinc.php"; /* (LANGUAGE) */ ?>" style="float: right;" type="checkbox" name="<?php echo $row[ID]; ?>" value="<?php echo $row[ID]; ?>" <?php if ($row[PRIME] == 1) { ?>disabled<?PHP } ?>>

<span class="linklarge"><a href="index.php?page=<?php echo $editpage; ?>&id=<?php echo $row[ID]; ?>"><?php echo $row[USERNAME]; ?></a></span>

</td>

</table>

<?php } include "deletebar.php"; ?>

</form>

</td>

</tr>

</table>
