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

if($_POST[action]=="Update"){
	@extract($_POST);
	updateTable("admin_details"," category_count='$category_count',banner_count='$banner_count', location_count='$location_count', product_count='$product_count', clinic_location_count='$clinic_location_count' where user_type='admin'");
	$_SESSION[session_message]="Admin details have been updated successfully";
	header("Location:".SITE_ADMIN_URL."/manage_limits.php");
	exit;
}

$res=getResult("admin_details"," where user_type='admin'");
admin_header();
?>
<form name="form1" method="post" action="" onsubmit="return validate(this);">
<h5 align="center">Manage Admin Details</h5>
<table width="39%"  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> Allowed Number of Locations</td>
  <td colspan="2" align="center" class="lightGrayBg">
    <input name="location_count" type="text" class="txtfieldadmin" value="<?=$res[location_count];?>" size="50" id="NOBLANK~Enter Your Name~DM~ALPHA~Please enter only  alphabatical value~DM~"></td>
  </tr>
 <tr>
  <tr>
  <td width="120" align="left" class="lightGrayBg"><span class="red">*</span> Allowed Number of Categories</td>
  <td colspan="2" align="center" class="lightGrayBg">
    <input name="category_count" type="text" class="txtfieldadmin" value="<?=$res[category_count];?>" size="50" id="NOBLANK~Enter Your Name~DM~ALPHA~Please enter only  alphabatical value~DM~"></td>
  </tr>
 <tr>
  <tr>
  <td width="120" align="left" class="lightGrayBg"><span class="red">*</span> Allowed Number of Products</td>
  <td colspan="2" align="center" class="lightGrayBg">
    <input name="product_count" type="text" class="txtfieldadmin" value="<?=$res[product_count];?>" 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"><span class="red">*</span> Allowed Number of Clinic Locations</td>
  <td colspan="2" align="center" class="lightGrayBg">
    <input name="clinic_location_count" type="text" class="txtfieldadmin" value="<?=$res[clinic_location_count];?>" 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"><span class="red">*</span>Banners Limit</td>
  <td colspan="2" align="center" class="lightGrayBg">
    <input name="banner_count" type="text" class="txtfieldadmin" value="<?=$res[banner_count];?>" size="50" id="NOBLANK~Enter Your Name~DM~ALPHA~Please enter only  alphabatical value~DM~"></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;
?>