|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/abtechsci/mmc15/ezupload/cp/ |
Upload File : |
<?php
require("header.php");
$name=$_POST["name"];
$email=$_POST["email"];
$pass1=$_POST["pass1"];
$fname=$_POST["fname"];
$lname=$_POST["lname"];
$uid=$_POST["uid"];
if ($uid==""){ $uid=$_GET["uid"]; }
$submit=trim($_POST["submit"]);
//echo $name . "----------->" . $email . "----------->" . $pass1 . "----------->" . $pass2 . "----------->" . $uid ;
if($submit != "" )
{
if($submit == "Send Message" )
{
}
else
{
if($name=="" || $email=="" || $pass1=="" )
{
//print("<font color=red ><b>Cannot save. all fields are required </b></font>");
$error="Cannot save. all fields are required";
}
else
{
$user=new user();
if($submit=="Add New" )
{
$user->insert( $name, $email, $pass1,$fname,$lname);
}
else
{
if($submit=="Delete")
{
$user->delete( $uid );
}
else
{
$user->update( $name, $email, $pass1,$fname,$lname, $uid );
}
}
if (!headers_sent())
{
header("location: usr.php");
exit;
}
else
{
echo "Error while redirecting, for now please click this <a " .
"href=\"usr.php\">link</a> instead\n";
exit;
}
}
}
}
else
{
if($uid !="" )
{
$user=new user();
$temp=$user->get($uid);
$name=$temp[0]->name;
$email=$temp[0]->email;
$pass1=$temp[0]->pass1;
$fname=$temp[0]->fname;
$lname=$temp[0]->lname;
$uid=$temp[0]->uid;
}
}
?>
<HTML><HEAD><TITLE>Control Panel</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<LINK href="f_files/global.css" type=text/css rel=stylesheet>
<script language="javascript" type="text/javascript" src="js/main.js"></script>
</HEAD>
<BODY <?php if($error !=""){ echo "onLoad=\"alert('$error')\"" ; } ?> >
<div align="center">
<table width="100" cellpadding="0" cellspacing="0" class="main_table" id="table1">
<tr>
<td>
<TABLE height="410" cellSpacing=0 cellPadding=0 width="770" id="table2" bgcolor="#FFFFFF">
<?php require("cp_header.php")?>
<tr>
<TD height=234 bgcolor="#FFFFFF">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="748" id="table3" height="208">
<tr>
<td height="14" width="748"></td>
</tr>
<tr>
<td height="14" width="748"></td>
</tr>
<tr>
<td height="187">
<div align="center">
<table width="583" border="1" align="center" cellpadding="0" cellspacing="0" class="main_table" id="table4"><form method="POST" action="usr.php">
<tr>
<td width="579" colspan="5" valign="middle" bgcolor="#C1D1FF" class="t_header"><div class="div_1">Manage Users</div></td>
</tr>
<tr>
<td width="120" align="center" class="t_sub_header"> Username </td>
<td width="114" align="center" class="t_sub_header"> Password </td>
<td width="118" align="center" class="t_sub_header"> Email </td>
<td width="111" align="center" class="t_sub_header"> First name </td>
<td width="108" align="center" class="t_sub_header"> Last name</td>
</tr>
<?php
$user=new user();
$temp=$user->get("");
for( $a=0; $a < count($temp) ; $a++ )
{
$name1=$temp[$a]->name;
$email1=$temp[$a]->email;
$pass11=$temp[$a]->pass1;
$fname1=$temp[$a]->fname;
$lname1=$temp[$a]->lname;
$uid1=$temp[$a]->uid;
?>
<tr onClick="window.location.href='usr.php?uid=<?php echo $uid1; ?>'" onMouseOver="this.style.cursor='hand';tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td width="120" align="left" class="td_1"> <?php echo $name1 ; ?></td>
<td width="114" align="left" class="td_2"> <?php echo $pass11 ; ?></td>
<td width="150" align="left" class="td_1"> <?php echo $email1 ; ?> </td>
<td width="111" align="left" class="td_2"> <?php echo $fname1 ; ?> </td>
<td width="111" align="left" class="td_1"> <?php echo $lname1 ; ?> </td>
</tr>
<?php
}
?>
</table>
<div align="center"><br>
<table width="395" height="138" border="1" cellpadding="0" cellspacing="0" bordercolor="#8FABFF" class="main_table" id="table5">
<tr>
<td height="27" colspan="4" valign="middle" bgcolor="#C1D1FF" class="t_header">User Details</td>
</tr>
<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td height="26" colspan="2" align="left" bgcolor="#EAEFFF" class="td_1">
<div class="div_1">Username</div></td>
<td height="26" colspan="2" align="left" bgcolor="#EAEFFF" class="td_2"><input type=hidden value="<?php echo $uid ; ?>" name=uid>
<div class="div_1"><input name=name value="<?php echo $name ; ?>" size="20" ></div></td>
</tr>
<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td height="26" colspan="2" align="left" valign="middle" class="td_1">
<div class="div_1">Password</div></td>
<td height="26" colspan="2" align="left" bgcolor="#FFFFFF" class="td_2">
<div class="div_1"><input type="password" name=pass1 value="<?php echo $pass1 ; ?>" size="20" ></div></td>
</tr>
<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td height="26" colspan="2" align="left" bgcolor="#EAEFFF" class="td_1">
<div class="div_1">Email</div></td>
<td height="26" colspan="2" align="left" bgcolor="#EAEFFF" class="td_2">
<div class="div_1"><input name=email value="<?php echo $email ; ?>" size="20" ></div></td>
</tr>
<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td height="31" colspan="2" align="left" bgcolor="#FFFFFF" class="td_1">
<div class="div_1">First name</div></td>
<td height="31" colspan="2" align="left" bgcolor="#FFFFFF" class="td_2">
<div class="div_1"><input name=fname value="<?php echo $fname ; ?>" size="20" ></div></td>
</tr>
<tr onMouseOver="tplTrOver(this)" onMouseOut="tplTrOut(this)">
<td height="31" colspan="2" align="left" bgcolor="#EAEFFF" class="td_1">
<div class="div_1">Last name</div></td>
<td height="31" colspan="2" align="left" bgcolor="#EAEFFF" class="td_2">
<div class="div_1"><input name=lname value="<?php echo $lname ; ?>" size="20"></div></td>
</tr>
<tr>
<td height="31" width="93" align="center" bordercolor="#FFFFFF">
<input name="submit" type="submit" class="button" value=" Add New " ></td>
<td height="31" width="95" align="center" bordercolor="#FFFFFF">
<input name="submit" type="submit" class="button" value=" Update " ></td>
<td height="31" width="97" align="center" bordercolor="#FFFFFF">
<input name="submit" type="submit" class="button" onClick="return confirm("Are you sure you want to delete this user permanently?");" value=" Delete "></td>
<td height="31" width="100" align="center" bordercolor="#FFFFFF"><input name="submit" type="submit" class="button" value="Deselect" ></td>
</tr>
</form>
</table>
</div> </td>
</tr>
<tr>
<td>
<p align="center"> </p>
<p align="center"><a href="emailist.php">Back </a><br>
</td>
</tr>
</table>
</div> </TD>
</tr>
</TABLE> </td>
</tr>
<?php include("footer.php"); ?>
</table>
</div>
</BODY></HTML>