<?php

$PageSecurity = 4;
$title = _('NRGP');
$_SESSION['modid']=$_REQUEST['modid'];
$_SESSION['frmid']=$_REQUEST['frmid'];
$frmpermission= $px->GetFileAccess($_SESSION['modid'],$_SESSION['frmid'],$_SESSION['ACGRoleId']);
$_SESSION['frmAdd']=$frmpermission[0];
$_SESSION['frmEdit']=$frmpermission[1];
$_SESSION['frmDelete']=$frmpermission[2];
$_SESSION['frmView']=$frmpermission[3];
?>
<?php

	if($_REQUEST['action']=='delete' && !empty($_REQUEST['fid']))
	{
		if($s->DeleteRecord('nrgp_challan',"id=".$_REQUEST['fid']))
		{
			
			$_SESSION['success_msg']="Delete Successfully";
		
		}
	}

if($_REQUEST['Cancel']!='')
{
	unset($_REQUEST);
}
?>



<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="padding:5px"><!-- General details -->
      <table width="100%" cellspacing="0" cellpadding="0" border="0" class="small">
        <tr>
          <td style="padding:5px; text-align:right;" colspan="4" align="center">

		
		
        </tr>
        
        <tr>
          <td class="detailedViewHeader"  style="text-align:center;" colspan="4"><b>Fixed Asset Definition</b></td>
        </tr>
        <?php //if($_SESSION['frmAdd']=='1') {?>
<div align="center"><a href="index.php?route=ADD_NRGP&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&NewReturn=yes">Add NRGP</a></div>
<?php //}?>
       
   <tr>
	<td ><table width="100%" border="1" cellspacing="1" cellpadding="5" align="center">
  	<tr>
  		<th><strong>Sl. No.</strong></th>
	  	<th><strong>Branch</strong></th>
	  	<th><strong>Godown</strong></th>
	   
	   	<th><strong>NRGP No.</strong></th>
	   	<th><strong>Challan Date </strong></th>
	   	<th><strong>Form No. </strong></th>
	   	
	   	
	   	<th colspan="2"><strong>Action</strong></th>
   </tr>
              <tr>
              	<?php 
              	$record=$s->GetRecordById('nrgp_challan',1);
              	// $record=DB_query("select * from tpl_fixed_asset_definition",$db);
  					$i=0;
					while($row=DB_fetch_array($record))
					{
						$i++;
						extract($row);
						
              	?>
	           	<td><?php  echo "<b>". $i." : </b>";?></td>
	            <td><?php  echo $site;?> </td>
	            <td><?php  echo $store;?> </td>
	            <td><?php  echo $NRGP_no;?> </td>
	           
               
                <td><?php  if($challan_date!='') echo date('d/m/y',strtotime($challan_date)); else echo ""; ?> </td>
                             
				<td><?php  echo $form_no; ?> </td>
				
                 <td><a href="<?php echo $url_add;?>&action=edit&fid=<?php echo $id;?>"><img src="images/icon-edit.png" width="10" height="10"></a> </td><td>
				<a href="<?php echo $url_cancel;?>&action=delete&fid=<?php echo $id;?>"><img src="images/Icon_Delete.png" width="10" height="10" onClick="return confirm('Are you sure you wish to delete this Record?')"></a></td>
              </tr><?php 
				} 
              ?>
            
            </table></td>
        </tr>
        <tr>
          <td style="padding:5px; text-align:right;" colspan="4" align="right"></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php if(isset($_SESSION['success_msg']))
{ ?>
	<script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
}	unset($_SESSION['success_msg']);
?>
