<?php

session_start();
include "../config.php";
include "../header.php";
include "../style.php";
if( isset($_SESSION["alogin"]) ) {
$useridp = dbput($_POST['userid']);

$query = "SELECT * FROM members where userid='".$useridp."'";

$result = mysql_query ($query)
or die ("Query failed");
while ($line = mysql_fetch_array($result)) {
$namep = dbget($line["name"]);
$lastnamep = dbget($line["lastname"]);
$contact_emailp = dbget($line["contact_email"]);
$subscribed_emailp = dbget($line["subscribed_email"]);
$passwordp = dbget($line["pword"]);
$paypal_emailp = dbget($line["paypal_email"]);
$verifiedp = dbget($line["verified"]);
$referidp= dbget($line["referid"]);
$pointsp= dbget($line["points"]);
$commissionp= dbget($line["commission"]);
$memtypep = dbget($line["memtype"]);
$alertpay_emailp = dbget($line["alertpay_email"]);
$safepay_emailp = dbget($line["safepay_email"]);
$moneybookers_emailp = dbget($line["moneybookers_email"]);
$ticketsp = dbget($line["tickets"]);
$joindatep= $line["joindate"];
$ipp= $line["ip"];
$lastloginp= $line["lastlogin"];
$vacationp = $line["vacation"];
$statusp = $line["status"];

?><table>
<tr>
<td width="15%" valign=top><br>
<? include("adminnavigation.php"); ?>
</td>
<td  valign="top" align="center"><br><br> <?
echo "<font size=2 face='$fonttype' color='$fontcolour'><p><b><center>";
?>

<center>
<form method="POST" action="editnow.php">
Userid:&nbsp;<font color=BLUE><b><? echo $userid; ?></b></font><br><br>
Join Date:<br><? echo $joindatep; ?><br><br>
Last Login:<br><? echo $lastloginp; ?><br><br>
IP Address:<br><? echo $ipp; ?><br><br>
Membership Type:&nbsp;<font color=BLUE><b><br>
<? echo $memtypep; ?></b></font><br><br>
<input type="hidden" name="userid" value="<? echo $useridp; ?>">
Name:<br><input type="text" name="name" value="<? echo $namep; ?>"><br>
Last Name:<br><input type="text" name="lastname" value="<? echo $lastnamep; ?>"><br>
Password:<br><input type="text" name="password" value="<? echo $passwordp; ?>"><br>
Email:<br><input type="text" name="contact_email" value="<? echo $contact_emailp; ?>"><br>
Referid:<br><input type="text" name="referid" value="<? echo $referidp; ?>"><br>
<? if ($paypal<>"") { ?>
Paypal Email:<br><input type="text" name="paypal_email" value="<?echo $paypal_emailp; ?>">
<? }
if ($alertpay<>"") { ?><br>
Alertpay Email:<br><input type="text" name="alertpay_email" value="<?echo $alertpay_emailp; ?>">
<? }
if ($safepay_email<>"") { ?><br>
Safepay Email:<br><input type="text" name="safepay_email" value="<?echo $safepay_emailp; ?>">
<? }
if ($moneybookers_email<>"") { ?><br>
Moneybookers Email:<br><input type="text" name="moneybookers_email" value="<?echo $moneybookers_emailp; ?>"><? } ?>
<br>
Commission Owed:<br><input type="text" name="commission" value="<? echo $commissionp; ?>"><br>
Points:<br><input type="text" name="points" value="<? echo $pointsp; ?>"><br>
Tickets:<br><input type="text" name="tickets" value="<? echo $ticketsp; ?>"><br>
Vacation Status:<br>0 is off/ 1 is on<br><input type="text" name="vacation" value="<? echo $vacationp; ?>"><br>
<br>

Verified:  <? if ($verifiedp == 1) {
echo "<font color=blue><b>Yes</b></font>";
}
elseif ($verifiedp == 0) {
echo "<font color=blue><b>Not Yet</b></font>";
}
?>
<br>
<br><input type="submit" value="Save">
</form>
<? if ($memtypep=="PRO") { ?>


<form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="JV MEMBER">


<input type="submit" value="Set to JV Member">


<br>


</form>


<form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="SUPER JV">


<input type="submit" value="Set to Super JV Member">


<br>


</form>

<?


} elseif ($memtypep=="SUPER JV") { ?>


<form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="PRO">


<input type="submit" value="Set to PRO Member">


<br>


</form>


<form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="JV MEMBER">


<input type="submit" value="Set to JV Member">


<br>


</form>


<?


}


else { ?>


<form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="PRO">


<input type="submit" value="Set to PRO Member">


<br>


</form> <form method="POST" action="upgradenow.php">


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="hidden" name="memtype" value="SUPER JV">


<input type="submit" value="Set to Super JV Member">


<br>


</form> <?


}


?>





<form method=POST action=deletethismember.php>


<input type="hidden" name="userid" value="<? echo $userid; ?>">


<input type="submit" value="Delete">


</form>


</center>


<?


}


echo "</td></tr></table>";


}


else  {


echo "Unauthorised Access!";


}





include "../footer.php";


mysql_close($dblink);


?>