<script language="javascript" type="text/javascript">




function user_rights_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_rights  order by user_id DESC LIMIT $from,50 ";
 }
else
{
 $sql="select * from  user_rights where user_name='$login_user_name' order by user_id DESC LIMIT $from,50 ";
}

$html_query = "main_fram.php?file=user_type_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="100%"  align="center" cellpadding="0" cellspacing="0" >
<!--<a href="javascript:user_rights_print('master_entry/admin/user_rights_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">Screen Name</th>
      <th scope="col" width="368" align="left">Form Name</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_rights  order by user_id DESC LIMIT $from,50 ";
 }
else
{
 $sql="select * from  user_rights where user_name='$login_user_name' order by user_id DESC LIMIT $from,50 ";
}
//echo $sql;
 $rs=mysql_query($sql);
			  while($rsdata=mysql_fetch_object($rs))
			  {   $from=$from+1;

			     $user_id=$rsdata->user_id;
				 $user_name=$rsdata->user_name;
				 $user_screen=$rsdata->user_screen;
				 $user_form_name=$rsdata->user_form_name;
			 

 
 ?>
  <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 $user_screen;?></td>
    <td align="left" ><?php echo $user_form_name;?> </td>
    <td align="center"><a href="#" onClick="user_rights_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>
