0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: advancetakenentry_report_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; $error_flag=0; $completeday= @$_POST['checkcompletedays']; $type= @$_POST['cmbadvan_imp']; if(isset($_POST['show'])) { if($completeday!=fullday) { $fromdate_dd= @$_POST['cmbfromdd']; $fromdate_mm=@$_POST['cmbfrommm']; $fromdate_yy=@$_POST['txtfromyy']; $from_date=$fromdate_yy."-".$fromdate_mm."-".$fromdate_dd; $todate_mm= @$_POST['cmbtomm']; $todate_dd=@$_POST['cmbtodd']; $todate_yy=@$_POST['txttoyy']; $to_date=$todate_yy."-".$todate_mm."-".$todate_dd; if (!is_numeric(@$_POST['txttoyy'])) { $error['fdate_numeric']="Please enter valid year"; $error_flag=1; } if (!is_numeric(@$_POST['txtfromyy'])) { $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) { $url=$server_ip."/USER/search_advancetakenentry.php"; echo "<script>window.location='$url'</script>"; } $name=@$_POST['txtname']; //$u_name=@$_SESSION['username']; $p_id=@$_SESSION['project_id']; $u_id=@$_SESSION['user_id']; if($error_flag==0) {//156 if($completeday==fullday) {//158 if($type==1) { $sql1="select * from advance_taken_entry where user_id='$u_id' and project_id='$p_id' and name LIKE '%$name%' ORDER BY date DESC"; } else { $sql1="select * from advance_taken_entry where user_id='$u_id' and project_id='0' and name LIKE '%$name%' ORDER BY date DESC"; } search_advancetakenentry::printsearch_advancetakenentryDetails($sql1,"",""); }//158 else {//158 if($type==1) { $sql="select * from advance_taken_entry where user_id='$u_id' and project_id='$p_id' and date between '$from_date' and '$to_date' ORDER BY date DESC" ; } else { $sql="select * from advance_taken_entry where user_id='$u_id' and project_id='0' and date between '$from_date' and '$to_date' ORDER BY date DESC" ; } search_advancetakenentry::printsearch_advancetakenentryDetails($sql,$from_date,$to_date); }//158 }//156 } class search_advancetakenentry { //50 public function printsearch_advancetakenentryDetails($sql1,$from_date,$to_date) {//53 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//57 ?> <div align="center"><b>Advance Taken Entry <?php echo"From:$from_date"?> <?php echo "To:$to_date";?></b></div> <table width="841" height="83" border="1" align="center"> <tr> <th width="18" height="42">S no</th> <th width="56">AI No</th> <th width="75"><p>Advance or Imprest</p> </th> <th width="81">Date</th> <th width="112">Name of withdrawer</th> <th width="96">Account name</th> <th width="68">Amount</th> <th width="142">Description</th> <th width="49">Closed</th> <th width="80">Settlement Amount</th> </tr> <tr><?php $i=0;$debit=0;$credit=0; while($row=mysql_fetch_array($sql)) {//75 ?> <th ><?php @$_SESSION['sl_no']=@$_SESSION['sl_no']+1; echo @$_SESSION['sl_no']; ?></th> <th><?php echo $row['advance_id']; ?></th> <th><?php echo $row['advance_impresed']; ?></th> <th><?php echo $row['date'];; ?></th> <th><?php echo $row['name']; ?></th> <th><?php echo $row['account_name']; ?></th> <th><?php echo $row['amount']; ?></th> <th><?php if($row['description'] != "") { echo $row['description']; } else { echo " "; } ?></th> <th><?php if ($row['closed'] == 1 ) { echo "Closed"; } else { echo "Not Closed"; } ?></th> <th><?php if ($row['closed'] == 1 ) { echo $row['balance']; } else { echo "Not Closed"; } ?></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 }//75 ?> </table> <?php }//57 else {//57 ?><font color="#CC0000"><b><?php echo "No Details to display"; ?></b></font><?php }//57 }//53 }//50 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 } ?>