ESH/item_receival_pdf.php

181 lines
4.8 KiB
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: small}
-->
</style>
<?php
include('includes/config/config.php');
include('includes/functions.php');
if(isset($_REQUEST['received_id'])){
$sql="SELECT * FROM received_master where received_id='".$_REQUEST['received_id']."'";
//echo "query:".$sql;
$result = mysqli_query($conn,$sql);
$num_rows=@mysqli_num_rows($result);
$row =null;
if($num_rows>0)
{
$row=@mysqli_fetch_array($result);
}
@extract($row);
}
?>
<style>
hr {
margin-top: 10px;
margin-bottom: 10px;
padding: 0px;
border: 0;
border-top: 1px solid #000;
}
</style>
<html>
<body>
<div id="pdfModal">
<div class="panel-body" >
<hr>
<table border="0" width="100%">
<tr>
<td align="center"><strong><font="24"><div>Item Receipt</font></strong></div></td>
</tr>
</table>
<hr/>
<table border="0" width="100%">
<tr>
<td width="15%" align="left" >Receival No:</td>
<td width="45%"align="left" ><div id="reqStore"><?php echo $received_ref_no;?></div></td>
<td width="15%" align="left" >Remarks:</td>
<td width="22.5%" align="left" ><div id="reqRefNo"><?php echo $remarks;?></div></td>
</td>
</tr>
<tr>
<td width="15%" align="left" >Receival Date :</td>
<td width="45%"align="left" ><div id="reqRequestedBy"><?php echo date_format(date_create($row['received_date']),"d-M-Y"); ?></div></td>
<td width="15%" align="left" >Issue No </td>
<td width="20%"align="left" ><div id="reqReqDate"> <?php echo getTableFieldValue('stock_issue','issue_ref_no','stock_issue_id',$issue_id,''); ?></div></td>
</tr>
</table>
<table border="1" width="100%" id="reqPdfTable" >
<tr>
<td bgcolor="#eeeeee" border="1" align="center" width="3%">Sr</td>
<td bgcolor="#eeeeee" border="1" align="center" width="28%">Issue Item Description</td>
<td bgcolor="#eeeeee" border="1" align="center" width="15%">Issue Quantity</td>
<td bgcolor="#eeeeee" border="1" align="center" width="28%">Received Item Description</td>
<td bgcolor="#eeeeee" border="1" align="center" width="15%">Received Qty</td>
</tr>
<tr>
<td align="center" ></td>
<td align="left" ></td>
<td align="right" ></td>
</tr>
<?php
$count=1;
$unitMap =getKeyValueMap('unit_master','unit_id','unit_name');
$sql_received_items="SELECT * FROM received_issue_items where received_id=$received_id ";
$result_received_items =@mysqli_query($conn,$sql_received_items);
while($row_received_items=@mysqli_fetch_assoc($result_received_items)){?>
<tr>
<td align="center"><?php echo $count; ?></td>
<td align="center"><?php echo getTableFieldValue('tbl_items','item_name','item_id',$row_received_items['item_id']); ?></td>
<td align="center"><?php echo $row_received_items['issue_qty']?>&nbsp;&nbsp;<?php echo $unitMap[getTableFieldValue('tbl_items','unit_id','item_id',$row_received_items['item_id'])] ;?></td>
<?php if($row_received_items['is_packaging_item']=='Y'){?>
<td align="center"><?php echo getTableFieldValue('tbl_items','item_name','item_id',$row_received_items['dispensary_item'])?></td>
<?php }else{?>
<td align="center"><?php echo getTableFieldValue('tbl_items','item_name','item_id',$row_received_items['item_id'])?></td>
<?php }?>
<?php if($row_received_items['is_packaging_item']=='Y'){?>
<td align="center"><?php echo $row_received_items['dis_item_qty']?>&nbsp;&nbsp;<?php echo $unitMap[getTableFieldValue('tbl_items','unit_id','item_id',$row_received_items['dispensary_item'])] ;?></td>
<?php }else{?>
<td align="center"><?php echo $row_received_items['received_qty']?>&nbsp;&nbsp;<?php echo $unitMap[getTableFieldValue('tbl_items','unit_id','item_id',$row_received_items['item_id'])] ;?></td>
<?php }?>
</tr>
<?php
$count++;
}
?>
</table>
</div>
</div>
<form class="form" id="reqPDFForm" name="reqPDFForm" method="post" target="_blank">
<input type="hidden" name="htmlText" id="htmlText">
</form>
</body></html>
<style>
.modal-dialog {
padding: 15px;
width:90%;
}
</style>
<script>
generateReqPdf();
function generateReqPdf(){
var content = $("#pdfModal").html();
$("#htmlText").val(content);
document.reqPDFForm.action="dynamic_pdf.php";
document.reqPDFForm.method="POST";
document.getElementById("reqPDFForm").submit();
}
</script>