60 lines
2.6 KiB
PHP
60 lines
2.6 KiB
PHP
<?php include('pdf_header.php');
|
|
//include('includes/config/config.php');
|
|
//include('includes/functions.php')
|
|
//include('pop_up_top.php');
|
|
?>
|
|
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
|
|
<body>
|
|
<table width="100%" >
|
|
<tr><div style="font-size:12px">
|
|
<td width="25%" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
|
|
<td width="50%" align="center" style="font-size:40px"><strong>Item Consumption Report</strong></td>
|
|
<td width="25%" align="left"> User : <?php echo $username ?></td>
|
|
</tr>
|
|
</table>
|
|
<?php
|
|
$startDate1=$_REQUEST['startDate1'];
|
|
$endDate1=$_REQUEST['endDate1'];
|
|
$startDate1Array=explode("-",$startDate1);
|
|
$endDate1Array=explode("-",$endDate1);
|
|
$diference=intval($endDate1Array[0])-intval($startDate1Array[0]);
|
|
|
|
?>
|
|
|
|
<?php while(intval($startDate1Array[0])<=intval($endDate1Array[0])){?>
|
|
<table width="100%" border="1" >
|
|
<tr><th colspan="3"><?php
|
|
$monthNum = $startDate1Array[0];
|
|
$monthName = date('F', mktime(0, 0, 0, $monthNum, 10));
|
|
echo $monthName;?></th></tr>
|
|
<tr><th width="2%" align="left">Sr </th><th align="left" width="50%">Item </th><th align="left" width="10%">Total Qty</th> </tr>
|
|
<?php
|
|
|
|
|
|
$sql_stock="select distinct(a.item_id) from appointment_stock_history a inner join employee_appointment b on a.appointment_id=b.appointment_id where MONTH(appointment_date)='".$startDate1Array[0]."' AND YEAR(appointment_date)='".$endDate1Array[1]."' ";
|
|
$results_stock=mysqli_query($conn,$sql_stock);
|
|
$count=0;
|
|
while($row_stock=mysqli_fetch_array($results_stock)){
|
|
//$issue_date=$row_stock[];
|
|
$cat_id = getTableFieldValue('tbl_items','cat','item_id',$row_stock['item_id']);
|
|
$form_name = getTableFieldValue('medicine_form','form_name','form_id',$cat_id);
|
|
$item_desc = getTableFieldValue('tbl_items','item_name','item_id',$row_stock['item_id']);
|
|
// $issue_qty=getTableFieldValue('appointment_stock_history','issued_qty','item_id',$row_stock['item_id']);
|
|
$sql_qty_sum="select sum(a.issued_qty) as total_sum from appointment_stock_history a inner join employee_appointment b on a.appointment_id=b.appointment_id where (a.item_id)='".$row_stock['item_id']."' and MONTH(appointment_date)='".$startDate1Array[0]."' AND YEAR(appointment_date)='".$endDate1Array[1]."' ";
|
|
$results_qty_sum=mysqli_query($conn,$sql_qty_sum);
|
|
$row_qty_sum=mysqli_fetch_array($results_qty_sum);
|
|
|
|
|
|
|
|
?><tr><td><?php echo ++$count?></td><td><?php echo ($form_name.".".$item_desc);?></td><td><?php echo $row_qty_sum['total_sum']?></td></tr><?php
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
</table>
|
|
<?php
|
|
$startDate1Array[0]=$startDate1Array[0]+1;
|
|
}?>
|
|
<?php
|
|
include('pdf_footer.php');
|
|
?>
|