<script language="javascript" type="text/javascript">
function user_name_print(url)
	{
	onmouseover= window.open(url,'onmouseover','height=600,width=1200,scrollbars=yes,resizable=no,left=50,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no');
	}
</script>

<?php  error_reporting(0);
/***************************** PREVIOUS NEXT CODING ****************************************/
include ("../../include/db.php");

$show = 20;
$num_links = 19;
$from = $_GET['from'];
//echo "test".$from;
if (empty($from))
	 {
		$from = "0";
	 } 
else 
	{
	$html_query = $html_query. "&from=$from";
	}


 $login_user_name=$_SESSION['login_user_name'];
 if($login_user_name=='admin')
 {
 $sql="select * from  user_creation";
 }
else
{
 $sql="select * from  user_creation where user_name='$login_user_name'";
}

$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.";
} 
?>
<table border="0" width="87%"  align="center" cellpadding="0" cellspacing="0" >
<!--<a href="javascript:user_name_print('master_entry/admin/user_name_print.php?')" style="float:right"><img src="img/print_32.png" width="30" height="25" border="0"></a>-->
  <thead>
    <tr>
      <th scope="col" width="78">S.No</th>
      <th scope="col" align="left">User Name</th>
      <th scope="col" width="368" align="left">Active</th>
      <th scope="col" width="109" >Edit</th>
      <th scope="col" width="116">Delete</th>
    </tr>
  </thead>
  <?php

  include ("../../include/db.php");
   $login_user_name=$_SESSION['login_user_name'];
 if($login_user_name=='admin')
 {
 $sql="select * from  user_creation";
 }
else
{
 $sql="select * from  user_creation where user_name='$login_user_name'";
}
    $rs=mysql_query($sql);
	$sno=0;
   while($rsdata=mysql_fetch_array($rs))
  {
   $sno=$sno+1;
   $from=$from+1;
   $user_id=$rsdata['user_id'];
   $user_name=$rsdata['user_name'];
     $password=$rsdata['password'];
  $status=$rsdata['status'];

 ?>
  <tr >
    <td width="78"  align="center"><?php echo $from; ?></td>
    <td width="470" align="left" ><?php echo $user_name;?></td>
    <td align="left" ><?php echo $status;?> </td>
     <td align="center"><a href="main_fram.php?file=user_creation&edit_id=<?php echo $rsdata['user_id']?>"><img src="img/i_edit.png" width="20" height="20" title="Edit"/></a></td>
    <td align="center"><a href="#" onClick="user_creation_delete_row('<?php echo $user_id;?>');"><img src="img/cross_delete.png" width="20" height="20" title="Delete" /></a></td>
    
  </tr>
  <?php } ?>
</table>
<table border="0" width="100%"  align="center" cellpadding="0" cellspacing="0" id="product-table">
 <tr>
  
<th  width="33%" height="19"  colspan="1" align="left" style="font-size:12px;" 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>
