0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: custemaccountcashentry_reprot_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']; $sql="select distinct account_name from ledger where user_id='$u_id' and project_id='$p_id' "; $sql=mysql_query($sql); $i=0; while($row=mysql_fetch_array($sql)) { $acc_name=$row['account_name']; $i=$i+1; $acc_name_array[$i]=$acc_name; } $error_flag=0; $accname_restore=@$_POST['cmbaccname']; $a_name=$acc_name_array[$accname_restore]; $sqlgroup="select * from accgroup where user_id='$u_id' and project_id='$p_id' "; $sql2=mysql_query($sqlgroup); $k=0; while($row2=mysql_fetch_array($sql2)) { $acc_group_db=$row2['groupname']; $k=$k+1; $acc_group_array[$k]=$acc_group_db; } $accounthead=@$_POST['cmbcustemacgroup']; $acc_group=$acc_group_array[$accounthead]; $completeday= @$_POST['checkcompleteday']; if(isset($_POST['show'])) { if($completeday!=fullday) { $fromdate_dd= @$_POST['cmbcustemfromdd']; $fromdate_mm=@$_POST['cmbcustemformmm']; $fromdate_yy=@$_POST['txtcustemfromyy']; $from_date=$fromdate_yy."-".$fromdate_mm."-".$fromdate_dd; $todate_mm= @$_POST['cmbcustemtomm']; $todate_dd=@$_POST['cmbcustemtodd']; $todate_yy=@$_POST['txtcustemtoyy']; $to_date=$todate_yy."-".$todate_mm."-".$todate_dd; if (!is_numeric(@$_POST['txtcustemfromyy'])) { $error['fdate_numeric']="Please enter valid year"; $error_flag=1; } if (!is_numeric(@$_POST['txtcustemtoyy'])) { $error['todate_numeric']="Please enter valid year"; $error_flag=1; } } if($error_flag==1) { echo "<script>window.location='http://localhost/CPFMS/USER/custemaccountcashentry_reprot.php</script>"; /*$url="http://".$server_ip."/CPFMS/USER/ledger.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 custemaccount_cashentry where user_id='$u_id' and project_id='$p_id' and accountname='$a_name' and groupname='$acc_group' and date ORDER BY date DESC"; custemaccountcashentry_reprot::printcustemaccountcashentryDetails($sql,"","",$a_name); } else { $sql="select * from custemaccount_cashentry where user_id='$u_id' and project_id='$p_id' and accountname='$a_name' and groupname='$acc_group' and date between '$from_date' and '$to_date'" ; custemaccountcashentry_reprot::printcustemaccountcashentryDetails($sql,$from_date,$to_date,$a_name); } } } class custemaccountcashentry_reprot { //7 public function printcustemaccountcashentryDetails($sql1,$from_date,$to_date,$a_name) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 ?> <div align="center"> <p> </p> <p><strong><font color="#853008"> <?php $p_code=@$_SESSION['project_code_s'];echo "Custem Account Cash entry report of project:$p_code"?></font></strong><strong><font color="#853008"> </font></strong></p> </div><br /><div align="center"> <p><strong><font color="#853008"> <?php echo "To Account: $a_name";?> </font></strong> <strong><font color="#853008"><?php echo"From:$from_date"?></font></strong> <font color="#853008"><?php echo "To:$to_date";?></font></strong> </p> </div> <table width="941" height="81" border="1" align="center" id="ledgertable"> <tr> <th width="54"><strong>S No</strong></th> <th width="108"><strong>Date</strong></th> <th width="106"><strong>Custem id</strong></th> <th width="148"><strong>Group name</strong></th> <th width="148"><strong>Debit</strong></th> <th width="143"><strong>Credit</strong></th> <th width="188"><strong>Description </strong></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['custem_id']; ?> </div></td> <td><div align="center"> <?php echo $row['groupname']; ?> </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> </tr> <?php }//32 ?> </table> <table width="445" align="center"> <tr> <td width="259"><div align="center"><strong><font color="#660000">Grand total</font></strong></div></td> <td width="153"><div align="left"><strong><font color="#853008"><?php echo $debit;?></font></strong></div></td> <td width="17"><div align="left"><strong><font color="#853008"><?php echo $credit;?></font></strong></div></td> </tr> </table> <p align="center"><strong><font color="#660000">Balance :<?php echo $credit-$debit;?></font></strong> <font color="#660000"> <?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 } ?>