0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: advance_imprest_report_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; include("../model/financial_mdl.php"); include("../model/financial_report_mdl.php"); //include("../model/defaultValues_mdl.php"); $u_id= @$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $sql="select * from advance_taken_entry where user_id='$u_id' and project_id='$p_id' or project_id=0"; $sql=mysql_query($sql); $i=0; while($row=mysql_fetch_array($sql)) { $taken_entry_no_db=$row['advance_id']; $i=$i+1; $taken_entry_no_array[$i]=$taken_entry_no_db; } $taken_entry_no=@$_POST['cmbtaken_entry_no']; $taken_entry_no_var=$taken_entry_no_array[$taken_entry_no]; $sql="select * from advance_taken_entry where user_id='$u_id' and advance_id='$taken_entry_no_var'"; $sql=mysql_query($sql); if(mysql_affected_rows()>0) {//57 while($row=mysql_fetch_array($sql)) { $type_var=$row['advance_impresed']; } } class Settlement { //50 public function printSettelmentsheader($type_var,$entryNo) { ?> <style type="text/css"> <!-- #apDiv1 { position:absolute; width:82px; height:24px; z-index:1; left: 536px; top: 279px; } --> </style> <div align="center"> <p><strong>CENTRE FOR WATER RESOURCES DEVELOPEMENT AND MANAGEMENT</strong></p> <p><strong>KUNNAMANGALAM, KOZHIKODE - 673 571</strong></p> <table width="816"> <tr> <td width="404"><font size="4"><font color="#000000"><font size="2"> <?php if ($type_var=="Advance"){echo "ADVANCE";}else {echo "IMPREST";}?> CASH ACCOUNT OF HEAD : <b> <?php $u_name=@$_SESSION['username']; $u_name_var=strtoupper($u_name);echo $u_name_var; ?> </b></font></font></font></td> <td width="400">Ref No : <font size="4"><font color="#000000"><font size="2"><b> <?php echo $entryNo; ?> </b></font></font></font></td> </tr> </table> </div> <table width="891" height="29" border="1" align="center"> <tr> <th width="72" height="23"><p><font color="#000000">Date</font></p> </th> <th width="50"><p><font color="#000000">Vr.No</font></p> </th> <th width="250"><font color="#000000">Brief of Expenditure</font></th> <th width="100"><font color="#000000">Receipt</font></th> <th width="100"><font color="#000000">Expenditure</font></th> <th width="100"><font color="#000000">Balance</font></th> <th width="173"><font color="#000000">Remark</font></th> </tr> </table> <?php } public function printSettelmentDetails($entryNo) {//53 $u_id= @$_SESSION['user_id']; $sql="select * from advance_taken_entry where user_id='$u_id' and advance_id='$entryNo'"; $sql=mysql_query($sql); if(mysql_affected_rows()>0) {//57 while($row=mysql_fetch_array($sql)) { $date_var=$row['date']; $amt_var=$row['amount']; $type_var=$row['advance_impresed']; $remark_var=$row['description']; $name_of_staff=$row['name']; } $bal_var=$amt_var; ?><table width="891" height="83" border="1" align="center"> <tr> <td width="72"> <div align="center"><?php echo $date_var;?> </div></td> <td width="50"> <div align="center"><?php echo "1";?> </div></td> <td width="250"> <b> <div align="center"><?php echo $type_var;?> </div></b></td> <td width="100"> <div align="center"><?php echo $amt_var;?> </div></td> <td width="100"> <div align="center"></div></td> <td width="100"> <div align="center"><?php echo $amt_var;?></div></td> <td width="173"> <div align="center"><?php echo $remark_var;?> </div></td> </tr> <?php $bill_amount_sum=0;$v_no=1; $sql="select * from advance_settelment where advance_taken_entry_no='$entryNo' ORDER BY invoice_date"; $sql=mysql_query($sql); while($row=mysql_fetch_array($sql)) {//75 ?> <tr> <td> <div align="center"> <?php echo $row['invoice_date']; ?> </div></td> <td> <div align="center"> <?php $v_no=$v_no+1; echo $v_no; ?></div></td> <td> <div align="center"><b> <?php echo $row['type_of_item']; if(($row['vender_name'] && $row['invoice_no'])=="") { echo ""; } else { ?> </b><br /> - Paid to : <?php echo $row['vender_name']; ?> <br /> -Inv. No : <?php echo $row['invoice_no']; } ?></div></td> <td><div align="center"></div></td> <td> <div align="center"> <?php $bill_amount_db=$row['bill_amount']; $bill_amount_sum=$bill_amount_sum+$bill_amount_db; echo $row['bill_amount']; ?> </div></td> <td> <div align="center"> <?php $bal_var=$bal_var-$row['bill_amount']; echo $bal_var; ?> </div></td> <td> <div align="center"> <?php echo $row['description']; ?> </div></td> <!-- <th><a href="../USER/edit_payment.php?id=</?php echo $row['payment_id']; ?>"><img src="../images/edit.png" alt="edit" width="25" height="25" /></a></th> <th> <a href="../USER/delete_payment.php?id=</?php echo $row['payment_id']; ?>"><img src="../images/delete.jpg" alt="Delete" width="25" height="25" /></a></th>--> </tr> <?php }//75 ?> </table> <table width="536" height="34" border="0" align="center"> <tr> <td width="209" height="30"><div align="left"><strong>Total</strong></div></td> <td width="103"><div align="center"><strong><?php echo $amt_var;?></strong></div></td> <td width="103"><div align="center"><strong> <?php echo $bill_amount_sum; ?> </strong></div></td> <td width="103"><div align="center"><strong> <?php $bal_var=$bal_var-$row['bill_amount']; echo $bal_var; ?> </strong></div></td> </tr> </table> <p><?php if ($bal_var != 0) { $new_bal_var = ereg_replace("[^0-9]", "", $bal_var); if ($bal_var > 0) { ?> The balance amount of <strong>Rs <?php echo $new_bal_var;?> </strong>may be refunded to <strong>CWRDM</strong>.<br /><?php } else { ?> The balance amount of <strong>Rs <?php echo $new_bal_var;?> </strong>may be reimbursed to <strong><?php echo $name_of_staff;?></strong>.<br /><?php } } ?> </p> <p>To</p> <p>The Accounts Branch for verification and recoupment</p> <p>Vr Nos. <strong>1</strong> to <b><?php echo $v_no; ?></b> for Rs. <b><?php echo $bill_amount_sum; ?></b></p> <p>Submitted Herewith </p> <p> Head--------------------------- </p> <p> <?php }//57 else {//57 ?> <font color="#CC0000"><b> <?php echo "No Details to display"; ?> </b></font> <?php }//57 }//53 }//50 ?> </p> <p> <?php if(isset($_POST['showbtn'])) { Settlement::printSettelmentsheader($type_var,$taken_entry_no_var); Settlement::printSettelmentDetails($taken_entry_no_var); ?> </p> <p><a href="#" class="projectboldtxt style2" onclick="window.print()">Print</a> <a href="advance_imprest_report.php">Back</a></p> <p>---------------------------------------------------------------------------------</p> <p> This document was automatically generated by RSC Project Management System.</p> <?php } ?>