0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ADMIN
/
[
Home
]
File: expense_expand_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; $p_id=$_GET['pid']; $f_year1=$_GET['fyear']; $f_year2 = $f_year1 + 1; $fin_date1= $f_year1.$fin_year_from; $fin_date2= $f_year2.$fin_year_to; @$_SESSION['sl_no'] = 0; @$_SESSION['exp_debit_var'] = 0; ledgerreport::printHeader(); //payment $sql_exp="select * from payment where project_id ='$p_id' and p_date between '$fin_date1' and '$fin_date2'"; ledgerreport::printledgerDetails($sql_exp,"Payment"); //custom account $sql_exp="select * from custemaccount_cashentry where project_id ='$p_id' and debit>0 and date between '$fin_date1' and '$fin_date2'"; ledgerreport::printledgerDetails($sql_exp,"Custom"); //echo $sql_budget; ?> </table> <style type="text/css"> <!-- .style1 {color: #FF0000} --> </style> <table width="1055" height="76" align="center"> <tr> <th width="24" height="42"> </th> <th width="92"> </th> <th width="150"><div align="left"><strong>Grand total</strong></div></th> <th width="150"></th> <th width="100"><div align="center" class="style1"><strong><?php echo @$_SESSION['exp_debit_var'];?></strong></div></th> <th width="250"></th> <th width="100"></th> <th width="82"></th> </tr> </table> <?php class ledgerreport { //7 public function printHeader() { ?> <table width="1055" height="76" border="1" align="center" id="ledgertable"> <tr> <th width="24" height="42"> S No </th> <th width="92">Date </th> <th width="150">Group Name</th> <th width="150">Account Name</th> <th width="100">Ammount</th> <th width="250">Description </th> <th width="100">Reference</th> <th width="82">Reference id</th> </tr> <?php } public function printledgerDetails($sql1,$table_name) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 //echo "By Account:$byaccount"; //echo "To Account: $a_name"; ?> <tr><?php while($row=mysql_fetch_array($sql)) {//32 ?> <td><div align="center"> <?php @$_SESSION['sl_no']=@$_SESSION['sl_no']+1; echo @$_SESSION['sl_no']; ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { $datedb=$row['date']; } else { $datedb=$row['p_date']; } echo $datedb; ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { echo $row['groupname']; } else { echo "Expenses"; } ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { echo $row['accountname']; } else { echo $row['account_Name']; } ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { $debit_db=$row['debit']; } else { $debit_db= $row['amount']; } echo $debit_db; @$_SESSION['exp_debit_var']=@$_SESSION['exp_debit_var']+$debit_db; ?> </div></td> <td><div align="center"> <?php echo $row['description']; ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { echo "Custom Account"; } else { echo "Payment"; } ?> </div></td> <td><div align="center"> <?php if ( $table_name == "Custom") { echo $row['custem_id']; } else { echo $row['payment_id']; } ?> </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 }//32 } //14 ?> <blockquote> <p> </p> </blockquote> <?php }//10 } //7 ?>