<?php
include_once("../include/main.inc.php");
check_session('MyCpanel','index.php');

if($_POST[action]=="Update"){
	@extract($_POST);
	updateTable("admin_details"," name='$name', email='$email', address='$address', phone='$phone' where user_id='".$_SESSION['MyAdminUserID']."' and user_type='".$_SESSION['MyAdminUserType']."'");
	$_SESSION['session_message']="Admin staff details have been updated successfully";
	header("Location:".SITE_ADMIN_URL."/admin_staff_myaccount.php");
	exit;
}

$res=getResult("admin_details"," where user_id='".$_SESSION['MyAdminUserID']."' and user_type='".$_SESSION['MyAdminUserType']."'");
admin_header();
?>
<form name="form1" method="post" action="" onsubmit="return validate(this);">
<h5 align="center">Manage Admin Staff Details</h5>
<table width="60%"  border="0" cellpadding="2" cellspacing="2" class="lightBorder" align="center">
 <?php
 if($_SESSION['session_message']!=""){
	 ?>
	 <tr><td colspan=3 class="lightGrayBg"><?php print_message();?></td></tr>
	 <?php
 }
 ?>
 <tr>
  <td width="120" align="left" class="lightGrayBg"><span class="red">*</span> Your Name</td>
  <td align="center" class="lightGrayBg">:</td>
  <td align="left" class="lightGrayBg"><input name="name" type="text" class="txtfieldadmin" value="<?=$res[name];?>" size="50" id="NOBLANK~Enter Your Name~DM~ALPHA~Please enter only  alphabatical value~DM~"></td>
 </tr>
 <tr>
  <td width="120" align="left" class="lightGrayBg" valign="top"><span class="red">*</span> Your Address</td>
  <td align="center" class="lightGrayBg" valign="top">:</td>
  <td align="left" class="lightGrayBg"><textarea name="address" class="txtfieldadmin" cols="50" rows="3" id="NOBLANK~Please Enter Your Address~DM~"><?=$res[address];?></textarea></td>
 </tr>
 <tr>
  <td width="120" align="left" class="lightGrayBg"><span class="red">*</span> Your Email</td>
  <td align="center" class="lightGrayBg">:</td>
  <td align="left" class="lightGrayBg"><input name="email" type="text" class="txtfieldadmin" value="<?=$res[email];?>" size="50" id="NOBLANK~Enter Your Email-Id~DM~EMAIL~Enter Correct Email-Id~DM~"></td>
 </tr>
 <tr>
  <td width="120" align="left" class="lightGrayBg">&nbsp;&nbsp; Your Phone</td>
  <td align="center" class="lightGrayBg">:</td>
  <td align="left" class="lightGrayBg"><input name="phone" type="text" class="txtfieldadmin" value="<?=$res[phone];?>" size="50"></td>
 </tr>
 <tr>
  <td align="right" class="lightGrayBg">&nbsp;</td>
  <td align="center" class="lightGrayBg">&nbsp;</td>
  <td align="left" class="lightGrayBg">
   <input type="hidden" name="action" value="Update">
   <input name="f2" type="submit" class="button" value="Submit">
  </td>
 </tr>
</table>		
</form>
<?php
admin_footer();
exit;
?>