<?php  error_reporting(0);
include ("../../include/db.php");
$show = 20;
$num_links = 19;
$from = $_GET['from'];
if (empty($from))
	 {
		$from = "0";
	 } 
else 
	{
	$html_query = $html_query. "&from=$from";
	}
$sql="select * from  user_creation where delete_status!='1' ";
$html_query = "main_fram.php?file=user_creation ";
$result=mysql_query($sql);
$num_results=mysql_num_rows($result);
if ($num_results == 0) 
{
 $confirmation = "No Records!";
} 
elseif ($num_results == 1) 
{
$confirmation = "Found 1 Records.";
} 
else 
{
$confirmation = "Found $num_results Records.";
} 

/************************ Get User Type Name*****************************************/
function user_type_name($user_type_id)
{
    $sql_user="select * from  user_type where user_type_id='$user_type_id' ";
	$rs_user=mysql_query($sql_user);
	while($rsdata_user=mysql_fetch_object($rs_user))
	{ 
	$user_type=$rsdata_user->user_type;
	}
	return $user_type;
	mysql_close($ConDB);
}
?>
<style type="text/css">
<!--
.style1 {font-size: 16px}
-->
</style>
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="table-responsive">
<div class="CSSTableGenerator">  
<table border="0" width="98%"  align="center" cellpadding="0" cellspacing="0" style="border:1px solid #ddd" >
<thead>
<tr>
    <th  align="center" width="59"   style="border:1px solid #ddd">&nbsp;S.No</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;Staff Name</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;User Name</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;Designation</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;Mob No</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;User Type</th>
    <th  align="left"  style="border:1px solid #ddd">&nbsp;Active</th>
    <th  width="89"  style="border:1px solid #ddd">Edit</th>
    <th  width="106"  style="border:1px solid #ddd">Delete</th>
</tr>
 <?php
include ("../../include/db.php");
$sql="select * from  user_creation where delete_status!='1'";
$rs=mysql_query($sql);
$sno=0;
while($rsdata=mysql_fetch_array($rs))
  {
   $sno=$sno+1;
   $from=$from+1;
   $user_id=$rsdata['user_id'];
   $staff_name=$rsdata['staff_name'];
   $user_name=$rsdata['user_name'];
   $designation=$rsdata['staff_designation'];
   $mob_no=$rsdata['staff_ph_no'];
   $password=$rsdata['password'];
   $user_type_id=$rsdata['user_type'];
   $user_type_name=user_type_name($user_type_id);
   $status=$rsdata['status'];

 ?>
  <tr>
    <td width="59"  align="center"  style="border:1px solid #ddd"><?php echo $from; ?></td>
    <td width="180" align="left"  style="border:1px solid #ddd">&nbsp;<?php echo ucfirst($staff_name);?></td>
    <td width="184" align="left" style="border:1px solid #ddd" >&nbsp;<?php echo ucfirst($user_name);?></td>
    <td width="243" align="left" style="border:1px solid #ddd" >&nbsp;<?php echo ucfirst($designation);?></td>
    <td width="228" align="left"  style="border:1px solid #ddd">&nbsp;<?php echo $mob_no;?></td>
    <td width="167" align="left" style="border:1px solid #ddd" >&nbsp;<?php echo ucfirst($user_type_name);?></td>
    <td width="86" align="left"  style="border:1px solid #ddd">&nbsp;<?php echo $status;?></td>
    <td align="center"  style="border:1px solid #ddd"><img src="img/edit.png" style="cursor:pointer"width="13" height="15" title="EDIT" onclick="javascript:add_staff_name('master_entry/user_name_creation/user_entry.php?edit_id=<?php echo $user_id;?>')"/></td>
    <td align="center" style="border:1px solid #ddd" ><a href="#" onClick="user_creation_delete_row('<?php echo $user_id;?>');"><img src="img/cross_deletes.png" alt="delete" title="DELETE" border="0" width="13px;" height="14px;" /></a>   </td>
  </tr>
  <?php } ?>
  </thead>
</table>
</div>
<table border="0" width="99%"  align="center" cellpadding="0" cellspacing="0" >

 <tr>
    <th height="19" align="left" style="font-size:12px; font-family:sans-serif; padding-top:10px;" scope="col"><?php echo $confirmation;?></th>
	<th scope="cols" width="8%" align="right"><?php  
			  if ($num_results > $show) 
			  {
			  $show;
			include("include/footer_links.php");
			  }
	?></th>
 </tr>
</table>
</div>
</div>
</div>

