0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: ledger_expand_brief_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; $u_id= @$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $g_name=$_GET['gname']; $from_date=$_GET['from'];$to_date=$_GET['to']; if($from_date=="") { $sql="select * from ledger where user_id='$u_id' and project_id='$p_id' and group_name='$g_name' and date ORDER BY date "; ledgerreport::printledgerDetails($sql,"","",$a_name); } else { $sql="select * from ledger where user_id='$u_id' and project_id='$p_id' and group_name='$g_name' and date between '$from_date' and '$to_date'" ; ledgerreport::printledgerDetails($sql,$from_date,$to_date,$a_name); } class ledgerreport { //7 public function printledgerDetails($sql1,$from_date,$to_date,$a_name) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 ?> <div align="center"><strong><?php $p_code=@$_SESSION['project_code_s'];echo "Ledger of project:$p_code"?> <?php echo"From:$from_date"?> <?php echo "To:$to_date";?></strong></div><br /><div align="center"><?php //echo "By Account:$byaccount"; echo "To Account: $a_name"; ?></div> <table width="1047" height="76" border="1" align="center" id="ledgertable"> <tr> <th width="24" height="42"> S No </th> <th width="83">Date </th> <th width="75">Ledger id</th> <th width="150">By Account</th> <th width="150">To Account</th> <th width="100">Debit</th> <th width="100">Credit</th> <th width="152">Description </th> <th width="75">Reference</th> <th width="74">Reference id</th> </tr> <tr><?php $i=0;$debit=0;$credit=0; 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 $datedb=$row['date']; echo $datedb; ?> </div></td> <td><div align="center"> <?php echo $row['ledg_id']; ?> </div></td> <td><div align="center"> <?php echo $row['group_name']; ?> </div></td> <td><div align="center"> <?php echo $row['account_name']; ?> </div></td> <td><div align="center"> <?php $debit_db=$row['debit']; echo $debit_db; $debit=$debit+$debit_db; ?> </div></td> <td><div align="center"> <?php $credit_db=$row['credit']; echo $credit_db; $credit=$credit+$credit_db; ?> </div></td> <td><div align="center"> <?php echo $row['description']; ?> </div></td> <td><div align="center"> <?php echo $row['ledger_type']; ?> </div></td> <td><div align="center"> <?php echo $row['type_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 ?> </table> <table width="485" align="center"> <tr> <td width="264"><div align="left"><strong>Grand total</strong></div></td> <td width="104"><div align="center"><strong><?php echo $debit;?></strong></div> </td> <td width="101"><div align="center"><strong><?php echo $credit;?></strong></div></td> </tr> </table> <blockquote> <p> Balance : <b><?php echo $credit-$debit;?></b> <?php }//14 else {//14 ?> <font color="#CC0000"><b><?php echo "No Details to display"; ?></b></font> <?php }//14 }//10 }//7 if(isset($_POST['show'])) { ?> </p> <p><a href="#" class="projectboldtxt style2" onclick="window.print()">Print</a> <a href="task.php">Back</a></p> </blockquote> <?php } ?>