0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: receiptreport_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['cmbrfdd']; $fromdate_mm=@$_POST['cmbrfmm']; $fromdate_yy=@$_POST['txtrfyy']; $from_date=$fromdate_yy."-".$fromdate_mm."-".$fromdate_dd; $todate_mm= @$_POST['cmbrtomm']; $todate_dd=@$_POST['cmbrtodd']; $todate_yy=@$_POST['txtrtoyy']; $to_date=$todate_yy."-".$todate_mm."-".$todate_dd; if (!is_numeric(@$_POST['txtrfyy'])) { $error['fdate_numeric']="Please enter valid year"; $error_flag=1; } if (!is_numeric(@$_POST['txtrtoyy'])) { $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/USER/recieptreport.php</script>"; /*$url="http://".$server_ip."/CPFMS/USER/recieptreport.php?pcode=".$p_code_value; echo "<script>window.location='$url'</script>";*/ }if($error_flag==0) { $p_id=@$_SESSION['project_id']; $u_id=@$_SESSION['user_id']; if($completeday==fullday) { $sql="select * from reciept where user_id='$u_id' and project_id='$p_id' and r_date ORDER BY r_date "; Recieptreport::printrecieptDetails($sql,"",""); } else { $sql="select * from reciept where user_id='$u_id' and project_id='$p_id' and r_date between '$from_date' and '$to_date'" ; Recieptreport::printrecieptDetails($sql,$from_date,$to_date); } } } class Recieptreport { //7 public function printrecieptDetails($sql1,$from_date,$to_date) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 ?> <div align="center"> <p><b> <?php $p_code=@$_SESSION['project_code_s'];echo "Reciept details of project:$p_code"?> <?php echo"From:$from_date"?> <?php echo "To:$to_date";?></b></p> </div> <table width="735" height="81" border="1" align="center"> <tr> <th width="24"> S No </th> <th width="62">Date </th> <th width="56">Reciept id</th> <th width="60">Voucher number</th> <th width="116">Account name</th> <th width="133">Amount</th> <th width="104">Discount</th> <th width="128">Description </th> </tr> <tr><?php $i=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> <th><div align="center"> <?php $datedb=$row['r_date']; echo $datedb; ?> </div></th> <th><div align="center"> <?php echo $row['receipt_id']; ?> </div></th> <th><div align="center"> <?php echo $row['voucher']; ?> </div></th> <th><div align="center"> <?php echo $row['account_Name']; ?> </div></th> <th><div align="center"> <?php $amount_db=$row['amount']; echo $amount_db; $i=$i+1; $amount_array[$i]=$amount_db; $amount=0; for($j=1;$j<=$i;$j++) { $amount=$amount+$amount_array[$j]; } ?> </div></th> <th><div align="center"> <?php $discount_db=$row['discount']; echo $discount_db; $i=$i+1; $discount_array[$i]=$discount_db; $discount=0; for($j=1;$j<=$i;$j++) { $discount=$discount+$discount_array[$j]; } ?> </div></th> <th><div align="center"> <?php echo $row['description']; ?> </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 width="737" align="center"> <tr> <td width="350"><div align=""><strong>Grand Total:</strong></div></td> <td width="129"><div align="center"><?php echo $amount;?></div></td> <td width="108"><div align="center"><?php echo $discount;?></div></td> <td width="130"><div align="center"></div></td> </tr> </table> Balance : <?php echo $amount-$discount; }//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 } ?>