<?php
echo $edit_id=$_GET['edit_id'];
include ("/../../include/db.php");
 ?>

<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<?php 
if($_GET['edit_id']!='')
{
$table_display_style1='style="display:none;"';
} 
else
{
$table_display_style='style="display:none;"';
}

$sql="select * from  user_creation where user_id='$_GET[edit_id]'";
    $rs=mysql_query($sql);
	$sno=0;
   while($rsdata=mysql_fetch_array($rs))
  {
   $sno=$sno+1;
 
   $user_id=$rsdata['user_id'];
   $user_name=$rsdata['user_name'];
    $password=$rsdata['password'];
  $status=$rsdata['status'];
  $confirm_password=$rsdata['confirm_password'];
}
?>
<form name="user_form"  id="user_form" method="post" action=""  enctype="multipart/form-data">
<div><p class="h_title">User Creation</p><div class="addicon2">
<?php 
 $login_user_name=$_SESSION['login_user_name'];
 if($login_user_name=='admin')
 {
 if($_GET['edit_id']==''){?>
<img src="img/tick.png" name="add_button" id="add_button" title="ADD" onclick="setTable1l(this.title),setTable(this.title);return false" align="top" width="35" height="35" border="0" tabindex="4" style="cursor:pointer;" >

<img src="img/wrong.png" name="cancel_button" id="cancel_button" title="CANCEL" onclick="setTable1l(this.title),setTable(this.title);return false" align="top" width="35" height="35" border="0" style="display:none; cursor:pointer;"  />

<?php } else{?>  
<img src="img/wrong.png" name="cancel_button" id="cancel_button" title="CANCEL" onClick="window.location.href='main_fram.php?file=user_creation'" align="top" width="35" height="35" border="0"/>

<?php } } else { }?></div></div>


<div id="table1"  <?php echo $table_display_style; ?>>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="2" id="table_show"> 
<tr>
  <td height="51" colspan="2">User Name<span style="color:#FF0000;">*</span></td>
    <td width="1%" align="center" ><div align="left">: </div></td>
    <td width="16%"  ><input name="user_name" id="user_name" tabindex="1"  type="text"  style="height:20px;" maxlength="20" onkeyup="user_clear_validate(this.value)"  value="<?php if($_GET[edit_id]!='') { echo $user_name; }?>"  autocomplete="off"/><div  id="user_name_err_design" style="color:#FF0000;" ></div></td>
    <td width="0%"></td>
    <td width="35%" ><div align="center" > Password<span style="color:#FF0000;">*</span></div></td>
    <td width="1%"  align="left">:</td>
   <td colspan="2"> <input type="password" name="password" id="password" tabindex="2" style="height:20px;"  maxlength="20" onkeyup="user_clear_validate(this.value)" value="<?php if($_GET[edit_id]!='') { echo $password; }?>" /><div  id="password_name_err_design" style="color:#FF0000;"></div>     </td><td width="0%"></td>
   <tr>
  <td height="51" colspan="2">Confirm Password<span style="color:#FF0000;">*</span></td>
    <td align="left" >:</td>
        <td><input type="password" name="confirm_password" id="confirm_password" tabindex="3" style="height:20px;"  onkeyup="user_clear_validate(this.value)" value="<?php if($_GET[edit_id]!='') { echo $confirm_password; }?>"/><div  id="confirm_password_err_design" style="color:#FF0000;" ></div></td>
  <td style="color:#FF0000;"></td>
     <td><div align="center">Active<span style="color:#FF0000;">*</span></div></td>
    <td align="center"  ><div align="left">:</div></td>
   <td width="16%">
<select name="user_status" id="user_status" tabindex="4"   onchange="user_clear_validate(this.value)"  style="width:188px; height:30px; border:1px solid #a1a1a1;"/>
                       <option value="" selected="selected">Select-</option>
                           <option value="Yes"<?php if($status == 'Yes') { ?>selected="selected";<?php } ?>value="<?php echo $status;?>">Yes</option>
                      <option <?php if($status=='No'){?> selected="selected" <?php } ?> value="No">No</option> 
                       <?php if($_GET[edit_id]!=''){?>
     <option value="<?php echo $status; ?>"><?php echo $status; ?></option>
	 <?php }?>
                     </select>  <div  id="active_err_designs" style="color:#FF0000"></div>  </td>
  <td width="10%" align="left" style="color:#FF0000;"> </td>
  </tr>
  <tr>
    <td width="3%">&nbsp;</td>
    <td width="18%" height="51">&nbsp;</td>
    <td align="left" >&nbsp;</td>
    <td>&nbsp;</td>
    <td style="color:#FF0000;">&nbsp;</td>
    <td><input type="button" name="action" id="action" tabindex="5" value="<?php if($_GET['edit_id']!=''){echo "EDIT";  } else {echo "ADD";}?>" class="button-primary" onclick="user_add(user_name.value,password.value,confirm_password.value,user_status.value,'<?php echo $edit_id;?>',this.value,'<?php echo $_GET['form']; ?>')"/></td>
    <td align="center"  >&nbsp;</td>
    <td>&nbsp;</td>
    <td align="left" style="color:#FF0000;">&nbsp;</td>
  </tr>


<tr align="center">
    
</tr>
</table>
</div>

  <table width="100%" >
    <tr>
      <td width="100%" align="center"><div id="part_div">
       <?php include("user_creation_list.php"); ?>
     </div> </td>
    </tr>
  </table>
</form>


