0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ADMIN
/
[
Home
]
File: daybook_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; $error_flag=0; $completeday= @$_POST['checkcompletedays']; if(isset($_POST['show'])) { if($completeday!="fullday") { $fromdate_dd= @$_POST['cmbdayfromdd']; $fromdate_mm=@$_POST['cmbdayfrommm']; $fromdate_yy=@$_POST['txtdayfromyy']; $from_date=$fromdate_yy."-".$fromdate_mm."-".$fromdate_dd; $todate_mm= @$_POST['cmbdaytomm']; $todate_dd=@$_POST['cmbdaytodd']; $todate_yy=@$_POST['txtdaytoyy']; $to_date=$todate_yy."-".$todate_mm."-".$todate_dd; if (!is_numeric(@$_POST['txtdayfromyy'])) { $error['fdate_numeric']="Please enter valid year"; $error_flag=1; } if (!is_numeric(@$_POST['txtdaytoyy'])) { $error['todate_numeric']="Please enter valid year"; $error_flag=1; } } /* if ($fromdate_yy!="") { $error['fdate_yy']="Please enter year"; $error_flag=1; } if ($todate_yy!="") { $error['todate_yy']="Please enter year"; $error_flag=1; } */if($error_flag==1) { echo "<script>window.location='http://localhost/CPFMS/ADMIN/daybook.php</script>"; } if($error_flag==0) { $p_id=@$_SESSION['project_id_a']; if($completeday=="fullday") { $sql="select * from ledger where project_id='$p_id' and date ORDER BY date "; daybookreport::printdaybookDetails($sql,"",""); } else { $sql="select * from ledger where project_id='$p_id' and date between '$from_date' and '$to_date'" ; daybookreport::printdaybookDetails($sql,$from_date,$to_date); } } } class daybookreport { //7 public function printdaybookDetails($sql1,$from_date,$to_date) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 ?> <div align="center"><b><?php $p_code=@$_SESSION['project_code_a'];echo "Daybook of project:$p_code"?> <?php echo"From:$from_date"?> <?php echo "To:$to_date";?></b></div> <table width="973" height="77" border="1" align="center"> <tr> <th width="27"> S No </th> <th width="55">Date </th> <th width="52">Ledger id</th> <th width="104">By Account</th> <th width="145">To Account</th> <th width="88">Debit</th> <th width="114">Credit</th> <th width="180"> Description </th> <th width="70">Reference</th> <th width="74">Reference id</th> </tr> <tr><?php $i=0;$debit=0;$credit=0; while($row=mysql_fetch_array($sql)) {//32 ?> <th height="27"><div align="center"> <?php @$_SESSION['sl_no']=@$_SESSION['sl_no']+1; echo @$_SESSION['sl_no']; ?> </div></th> <th><div align="center"> <?php $datedb=$row['date']; echo $datedb; ?> </div></th> <th><div align="center"> <?php echo $row['ledg_id']; ?> </div></th> <th><div align="center"> <?php echo $row['group_name']; ?> </div></th> <th><div align="center"> <?php echo $row['account_name']; ?> </div></th> <th><div align="center"> <?php $debit_db=$row['debit']; echo $debit_db; $debit=$debit+$debit_db; ?> </div></th> <th><div align="center"> <?php $credit_db=$row['credit']; echo $credit_db; $credit=$credit+$credit_db; ?> </div></th> <th><div align="center"> <?php echo $row['description']; ?> </div></th> <th><div align="center"> <?php echo $row['ledger_type']; ?> </div></th> <th><div align="center"> <?php echo $row['type_id']; ?> </div></th> <!-- <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="985" align="center"> <tr> <td width="163"><div align=""><strong>Grand total</strong></div></td> <td width="242"> </td> <td width="106"><div align="center"><?php echo $debit;?></div></td> <td width="110"><div align="center"><?php echo $credit;?></div></td> <td width="340"> </td> </tr> </table> Balance :<?php echo $credit-$debit;?> <?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="project_report.php">Back</a></p> </blockquote> <?php } ?>