0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: stockentry_reports_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 item_name from stockentry where user_id='$u_id'"; $sql=mysql_query($sql); $i=0; while($row=mysql_fetch_array($sql)) { $item_name_db=$row['item_name']; $i=$i+1; $item_name_array[$i]=$item_name_db; } $error_flag=0; $itemname_restore=@$_POST['cmbitem']; $item_name=$item_name_array[$itemname_restore]; if(isset($_POST['showbtn'])) { $u_id=@$_SESSION['user_id']; if($item_name=="") { $sql="select * from stockentry where user_id='$u_id' ORDER BY stockentrydate "; Stockentryreport::printStockentryDetails($sql); } else { $sql="select * from stockentry where user_id='$u_id' and item_name='$item_name' ORDER BY stockentrydate "; Stockentryreport::printStockentryDetails($sql); } } class Stockentryreport { //7 public function printStockentryDetails($sql1) {//10 $sql=mysql_query($sql1); if(mysql_affected_rows()>0) {//14 ?> <div align="center"> <p><b>Stock Entry details</b></p> </div> <table width="430" height="76" border="1" align="center" id="ledgertable"> <tr> <th width="24" height="42"> S No </th> <th width="104">Item name</th> <th width="49">Entry Date</th> <th width="108">Number of items in stock</th> <th width="111">Description </th> </tr> <?php $itemnumber=0; while($row=mysql_fetch_array($sql)) {//32 ?> <tr><td><div align="center"> <?php @$_SESSION['sl_no']=@$_SESSION['sl_no']+1; echo @$_SESSION['sl_no']; ?> </div></td> <td><div align="center"> <?php echo $row['item_name']; ?> </div></td> <td><div align="center"> <?php $datedb=$row['stockentrydate']; echo $datedb; ?> </div></td> <td><div align="center"> <?php $itemnumber_db=$row['itemsinstock']; echo $itemnumber_db; $itemnumber=$itemnumber+$itemnumber_db; ?> </div></td> <td><div align="center"> <?php echo $row['description']; ?> </div></td></tr> <?php }//32 ?> </table> <table width="431" align="center"> <tr> <td width="195"><div align=""><strong>Grand total</strong></div></td> <td width="118"><div align="center"><?php echo $itemnumber;?></div></td> <td width="102"> </td> </tr> </table> <?php }//14 else {//14 ?><font color="#CC0000"><b><?php echo "No Details to display"; ?></b></font><?php }//14 }//10 }//7 if(isset($_POST['showbtn'])) { ?> </p> <p><a href="#" class="projectboldtxt style2" onclick="window.print()">Print</a> <a href="stockmanagement.php">Back</a></p> </blockquote> <?php } ?>