<?
//*************************FETCH DATA WHEN ACTION VERIFY*************START HERE************************************/
$table_name='sub_ra_bill_preparation';
if($_REQUEST['id']!='')
{
$condition="id='".$_REQUEST['id']."'";
$rec=$s->GetRecordById($table_name, $condition);//FETCH DATA FROM TABLE
$recRow=DB_fetch_array($rec);
extract($recRow);//EXTRACT DATA
}
//*************************FETCH DATA WHEN ACTION VERIFY*************START HERE************************************/




//*************************UPDATE STATUS****************************START HERE************************************/
if($_REQUEST['save'])
{
	if($_REQUEST['verify']!='')
	{
	$dataArray['verify_status']='Verified';
	$cond="id='".$_REQUEST['id']."'";
	$s->RecordEdit($table_name, $dataArray, $cond);// UPDATE STATUS OF RA BILL
	$_SESSION['success_msg']="Successfully Verified";
	$s->pageLocation("index.php?route=SubContractors/RaBill/ra_bill_verification".$rurl);// PAGE REDIRECTION
	}
	else
	{
	echo "<script>alert('Please Check The Button For Verify');</script>";// SCRIPT FOR ALERT MSG
	}
}
//*************************UPDATE STATUS****************************END HERE************************************/


//*************************FETCH DATA WHEN ACTION VIEW*************START HERE************************************/

if($_REQUEST['action']=='view')
{
$table='sub_ra_bill_preparation';
	if($_REQUEST['id']!='')
	{
	$condition1="id='".$_REQUEST['id']."'";
	$rec1=$s->GetRecordById($table, $condition1);//FETCH DATA FROM TABLE
	$recRow1=DB_fetch_array($rec1);
	extract($recRow1);//EXTRACT DATA
	}
}
//*************************FETCH DATA WHEN ACTION VIEW*************END HERE************************************/


//*************************BACH TO PREVIOUS**********************START HERE************************************/
if($_REQUEST['back'])
{
	$s->pageLocation("index.php?route=Subcontractors/RaBill/ra_bill_verification".$rurl);
}

//*************************BACH TO PREVIOUS**********************START HERE************************************/



?>
<link href="css/tender_project.css" rel="stylesheet" type="text/css" />
<div class="tender_main_page">
<? if($_REQUEST['action']=='verify') {?>
<h3>RA BILL Verify</h3>
<form action="" method="post">
<div style="overflow: auto; width:810px;">	
	<table width="100%" border="1" cellpadding="3" >
      <tr>
        <td class="tabledata">Project</strong></td>
        <td class="tabledata">Block</strong></td>
        <td class="tabledata">Contractor</strong></a></td>
        <td class="tabledata">Work Order</strong></td>
        <td class="tabledata">Bill No.</strong></td>
        <td class="tabledata">Bill Ref No</strong></td>
        <td class="tabledata">Ammount</strong></td>
      </tr>
	  <tr>
	  <td><? echo $s->GetFieldValue('locations',"loccode='".$project."'",'locationname'); ?></td>
	  <td><? echo $s->GetFieldValue('sub_block_master',"id='".$block."'",'block_name'); ?></td>
	  <td><? echo $s->GetFieldValue('sub_contractor_definition',"id='".$contractor."'",'contractor_name'); ?></td>
	  <td><? echo $s->GetFieldValue('sub_preparation',"id='".$work_order_no."'",'work_order_no'); ?></td>
	  <td><? echo $bill_no ?></td>
	  <td><? echo $bill_ref_no ?></td>
	  <td><? echo $net_amt ?></td>
	  </tr>
</table>
<br /><br />
<div align="centre">
<input type="radio" name="verify" />Verify<input type="submit" name="save" value="Verified" />
</div>
</form>
<? } else { ?>
<h3>RA BILL View</h3>
<form name="" method="post">
<table width="100%" border="1" cellpadding="3" >
	<tr>
		<td width="19%" class="tabledata">Project</td>
		<td width="25%"><? echo $s->GetFieldValue('locations',"loccode='".$project."'",'locationname'); ?></td>
		<td width="24%" class="tabledata">Block</td>
		<td width="32%"><? echo $s->GetFieldValue('sub_block_master',"id='".$block."'",'block_name'); ?></td>
	</tr>
	<tr>
		<td class="tabledata">Contractor</td>
		<td><? echo $s->GetFieldValue('sub_contractor_definition',"id='".$contractor."'",'contractor_name'); ?></td>
		<td class="tabledata">work Order No.</td>
		<td><? echo $s->GetFieldValue('sub_preparation',"id='".$work_order_no."'",'work_order_no'); ?></td>
	</tr>
	<tr>
		<td class="tabledata">Bill NO.</td>
		<td><? echo $bill_no; ?></td>
		<td class="tabledata">Bill Ref No.</td>
		<td><? echo $bill_ref_no; ?></td>
	</tr>
	<tr>
		<td class="tabledata">Work Order Start Date.</td>
		<td><? echo ConvertSQLDate($wo_start_date); ?></td>
		<td class="tabledata">Work Order Completaion Date.</td>
		<td><? echo ConvertSQLDate($wo_comp_date); ?></td>
	</tr>
	<tr>
		<td class="tabledata">Remarks.</td>
		<td><? echo $remarks; ?></td>
		<td class="tabledata">Total Ammout.</td>
		<td><? echo $net_amt ?></td>
	</tr>
</table>
<br /><br />
<div align="centre">
<input type="submit" name="back" value="Back" />
</div>
</form>
<?  } ?>
</div>