<?php
$PageSecurity = 1;
include('includes/DefinePaymentClass.php');
$title = _('Invoice');
include('includes/SQL_CommonFunctions.inc');
?>
<p><h2 align="center">Tariff Master</h2>
</p>
<?php
if($_REQUEST['action']=='delete')
{
    $delsql = "delete from  tariff_master where id='".$_REQUEST['id']."'";
   $delete_result = DB_query($delsql,$db);
    if(!$delete_result)
  {
    die("error".DB_error_msg($db));
   }
   $s->pageLocation('index.php?route=ViewTariffMaster&modid='.$_REQUEST['modid'].'&frmid='.$_REQUEST['frmid'].'');
 }

 if($_REQUEST['daction'])
{?>
<div class="success">Record <?php echo $_REQUEST['daction'] ?> Successfully </div><br>
<?php }?>

<?php 
  
   
   $cond="1=1";
   $GetRecord=$s->GetRecord("tariff_master",$cond);
   $result=DB_query($GetRecord,$db);
    
  ?>
 <div align="center"> <a href="index.php?route=TariffMaster&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=add">ADD NEW</a></div><br />
 <table width="100%" border="0" cellspacing="2" cellpadding="2"  >
  <tr>
    <th><strong>SNO.</strong></th>
    <th><strong>TARIFF HEADING </strong></th>
    <th><strong>TARIFF DESCRIPTION </strong></th>
    <th><strong>EDIT</strong></th>
    <th><strong>DELETE</strong></th>
  </tr>
  <?php $i=1;
 while( $row=DB_fetch_array($result))
 {
   ?>
  <tr bgcolor="#FFFFFF">
    <td><?php echo $i++;?></td>
    <td><?php echo  $row['tarrif_heading']; ?></td>
     <td><?php echo  $row['tarrif_description']; ?></td>
    <td><a href="index.php?route=TariffMaster&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=edit&id=<?php echo $row['id']?>"><img src="images/icon-edit.png"></a></td>
	<td><a href="index.php?route=ViewTariffMaster&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&action=delete&id=<?php echo $row['id']?>" onclick="return confirm('This tariff will be deleted. Are you sure?')"><img src="images/Icon_Delete.png"></a></td>
  </tr>
 <?php } ?> 
</table>
<?php
include('includes/footer.inc');
?>
