<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
    $q = $_GET['q'];;
 	$sql=DB_query("select * from modules_form where moduleid='".$q."'",$db);
  ?>
  <?php $i=0;
   while($row=DB_fetch_array($sql))
   {
   $arr=$row['PerAdd'].','.$row['PerEdit'].','.$row['PerDelete'].','.$row['PerView'];
   
 ?>
 	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background:#D7E8FD">
 	  <tr>
	  <td  width="38%">
	  <input name="frmmoduleid[<?php echo $row['id'];?>]" type="hidden" value="<?php echo $q; ?>" />
	  <input name="POPID" type="hidden" id= "POPID_<?php echo $row['id'];?>" value="0">
	  <input name="ARRID" type="hidden" id= "ARRID_<?php echo $row['id'];?>"  value="<?php echo $arr;?>">

	  <?php  //echo $row['id'].$q;?>
	  <input name="frmid[<?php echo $row['id'];?>]" type="checkbox"    value="<?php  echo $row['id'];?>" 
	onClick="select_all(<?php  echo $row['id'];?>,document.getElementById('POPID_'+<?php  echo $row['id'];?>).value,<?php  echo $row['id'];?>,document.getElementById('ARRID_'+<?php  echo $row['id'];?>).value );" checked="checked">
<?php  echo ucwords(strtolower($row['frm_name']));?>
 	  </td>
		<td width="14%"><?php //echo $row['PerAdd'];
 		?>
<input name="<?php  echo $row['id'];?>[0]" type="checkbox" value="<?php  echo $row['PerAdd']?>" 
<?php //echo ($row['PerAdd']==0?"disabled":"");?> checked="checked" >Add
 		</td>
		<td  width="12%"><?php //echo $row['PerEdit']; 		?>
<input name="<?php  echo $row['id'];?>[1]" type="checkbox" value="<?php  echo $row['PerEdit']?>" 
<?php //echo ($row['PerEdit']==0?"disabled":"");?> checked="checked">Edit
		 
		</td>
 <td  width="17%"><?php //echo $row['PerDelete']; 		?> 
<input name="<?php  echo $row['id'];?>[2]" type="checkbox" value="<?php  echo $row['PerDelete']?>" 
<?php //echo $row['PerDelete']==0?"disabled":"";?>  checked="checked" >Delete
 		</td>
 	  
	 <td width="19%"><?php //echo $row['PerDelete']; 		?> 
<input name="<?php  echo $row['id'];?>[3]" type="checkbox" value="<?php  echo $row['PerView']?>" 
<?php //echo $row['PerDelete']==0?"disabled":"";?>  checked="checked" >View
 		</td> 
	 
	 </tr>
  </table>
  <?php $i++; }?>