753 lines
36 KiB
PHP
753 lines
36 KiB
PHP
|
<?php include('techsyn_header.php'); ?>
|
||
|
<!-- Main Content Container for side bar and body-->
|
||
|
<div class="main-container ace-save-state" id="main-container">
|
||
|
<script type="text/javascript">
|
||
|
try {
|
||
|
ace.settings.loadState('main-container')
|
||
|
} catch (e) {}
|
||
|
|
||
|
function getAvailableQty(value, counter) {
|
||
|
$.ajax({
|
||
|
url: 'get_medicine_available_qty.php',
|
||
|
form: 'POST',
|
||
|
data: {
|
||
|
value: value
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
$("#available" + counter).html(data.stock_qty);
|
||
|
// $("#unit").html(unitMap[data.unit_id]);
|
||
|
$("#unit" + counter).html(unitMap[data.unit_id]);
|
||
|
setItemBatchNo(value, counter);
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Retrieving Medicine Available Quantity.!!');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function setItemBatchNo(item_id, count) {
|
||
|
// selected_items.push(item_id);
|
||
|
$.ajax({
|
||
|
url: 'get_item_batch_nos_for_store_return.php',
|
||
|
type: 'POST',
|
||
|
data: {
|
||
|
item_id: item_id
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
var content_item_batch =
|
||
|
"<option value=\"\" selected disabled >Please Select Batch No</option>";
|
||
|
if (data != null && data != "") {
|
||
|
item_batch = data;
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
content_item_batch += "<option value='" + data[i].item_batch_no + "'>" + data[i]
|
||
|
.item_batch_no + " (Expiry Date:" + myDateFormaterMonthYear(data[i]
|
||
|
.expiry_date) + ")</option>"
|
||
|
}
|
||
|
}
|
||
|
$("#item_batch_no" + count).html(content_item_batch);
|
||
|
},
|
||
|
error: function(data) {}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function read(counter) {
|
||
|
document.getElementById('item_id' + counter).disabled = true;
|
||
|
document.getElementById('issue_qty' + counter).readOnly = true;
|
||
|
document.getElementById('comments' + counter).readOnly = true;
|
||
|
document.getElementById('item_batch_no' + counter).disabled = true;
|
||
|
// document.getElementById('point_id').disabled = true;
|
||
|
document.getElementById('issue_date').readOnly = true;
|
||
|
document.getElementById('comment').readOnly = true;
|
||
|
}
|
||
|
</script>
|
||
|
<?php include('techsyn_sidebar.php'); ?>
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
||
|
<ul class="breadcrumb">
|
||
|
<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>
|
||
|
</li>
|
||
|
<li class="#">Medicine Issue</li>
|
||
|
<li class="active">Direct Medicine Issue</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
<?php
|
||
|
if (isset($_REQUEST['flex_issue_id'])) {
|
||
|
$sql_med_log = "select *,date_format(date_of_issue,'%d-%m-%Y %H:%i:%s') as issue_date from direct_medicine_issue_log where issue_log_id ='" . $_REQUEST['flex_issue_id'] . "'";
|
||
|
error_log("dcndkdcm" . $sql_med_log);
|
||
|
$result_med_log = mysqli_query($conn, $sql_med_log);
|
||
|
$num_rows = @mysqli_num_rows($result_med_log);
|
||
|
$row_med_log = @mysqli_fetch_array($result_med_log);
|
||
|
}
|
||
|
?>
|
||
|
<div class="page-content">
|
||
|
<div class="box box-primary" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
|
||
|
<form id="direct_medicine_issue_form" method="post">
|
||
|
<!-- box-body-->
|
||
|
<div class="box-body" id="reload_amb">
|
||
|
<div class="row">
|
||
|
<div class="col-sm-12">
|
||
|
<table width="100%" id="issue_table" class="table table-bordered order-list">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th style="width: 35%;">Issue Point</th>
|
||
|
<th width="30%">Date & Time</th>
|
||
|
<th width="35%">Comments</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
<input type="hidden" name="issue_log_id" id="issue_log_id"
|
||
|
value="<?= $row_med_log['issue_log_id'] ?>" />
|
||
|
|
||
|
<select class="form-control" name="point_id" id="point_id">
|
||
|
<?php $sql_emp_1 = "SELECT point_id, CONCAT(type_name, ' - ', location, ' - ', code) AS medicine_issue_details FROM medicine_issue_point order by type_name"; ?><?php echo generateOption('medicine_issue_point', 'type_name', 'point_id', $row_med_log['issue_point_id'], ''); ?>
|
||
|
</select>
|
||
|
|
||
|
</td>
|
||
|
<td><input style="width: 100%;" id="issue_date" type="text"
|
||
|
style="height: 30px" class="form-control datetimepicker"
|
||
|
name="issue_date" value="<?= $row_med_log['issue_date'] ?>" />
|
||
|
</td>
|
||
|
<td><input type="text" name="comment" id="comment"
|
||
|
value="<?= $row_med_log['comments'] ?>" style="width: 100%">
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
|
||
|
|
||
|
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="row">
|
||
|
<div class="col-sm-12">
|
||
|
<table id="myTable" class="table table-bordered order-list">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th style="width: 35%;">Medicine Name</th>
|
||
|
|
||
|
<th width="5%">Available</th>
|
||
|
<th width="5%">Batch No</th>
|
||
|
<th width="5%">Return Qty.</th>
|
||
|
<th width="40%">Comments</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
|
||
|
|
||
|
<tbody>
|
||
|
<?php
|
||
|
$i = 0;
|
||
|
|
||
|
if (isset($_REQUEST['flex_issue_id'])) {
|
||
|
$sql_med = "select * from direct_medicine_issue_log_details where issue_log_id ='" . $_REQUEST['flex_issue_id'] . "'";
|
||
|
$result_med = mysqli_query($conn, $sql_med);
|
||
|
$num_rows = @mysqli_num_rows($result_med);
|
||
|
$row_med = mysqli_fetch_array($result_med);
|
||
|
}
|
||
|
do {
|
||
|
?>
|
||
|
<tr>
|
||
|
|
||
|
<td>
|
||
|
|
||
|
<select class="select2 form-control" name="item_id<?= $i ?>"
|
||
|
id="item_id<?= $i ?>"
|
||
|
onchange="getAvailableQty(this.value,<?= $i ?>);">
|
||
|
<option value="" selected>Select Medicine</option>
|
||
|
<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id order by item_name", $row_med['item_id'], 'item_id', 'item_name', '', ''); ?>
|
||
|
</select>
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
<span name="available<?= $i ?>" id="available<?= $i ?>"></span>
|
||
|
<span name="unit<?= $i ?>" id="unit<?= $i ?>"></span>
|
||
|
</td>
|
||
|
<td style="width: 20%"><select name="item_batch_no<?= $i ?>"
|
||
|
id="item_batch_no<?= $i ?>" class="form-control">
|
||
|
</select></td>
|
||
|
<td><input type="number" name="issue_qty<?= $i ?>"
|
||
|
id="issue_qty<?= $i ?>"
|
||
|
value="<?= $row_med['issue_qty'] ?>"><span name="unit"></span>
|
||
|
</td>
|
||
|
<td><input type="text" name="comments<?= $i ?>" id="comments<?= $i ?>"
|
||
|
value="<?= $row_med['comments'] ?>" style="width: 100%"></td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
<script type="text/javascript">
|
||
|
getAvailableQty(<?= $row_med['item_id'] ?>, <?= $i ?>);
|
||
|
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
||
|
|
||
|
read(<?= $i ?>)
|
||
|
<?php } ?>
|
||
|
</script>
|
||
|
|
||
|
|
||
|
<?php
|
||
|
$i++;
|
||
|
} while ($row_med = @mysqli_fetch_array($result_med)) ?>
|
||
|
</tbody>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<tfoot>
|
||
|
<tr>
|
||
|
<td colspan="6">
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DIS') { ?>
|
||
|
|
||
|
<input type="button" class="btn btn-lg btn-block " id="addrow"
|
||
|
value="Add" />
|
||
|
<?php } ?>
|
||
|
<input type="hidden" name="count_items" id="count_items"
|
||
|
value="<?= $i ?>" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tfoot>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DOC') {
|
||
|
error_log("statusssssssssss" . $row_med_log['approval_status']); ?>
|
||
|
<div class="row">
|
||
|
<div class="col-sm-8">
|
||
|
<table width="100%" class="table table-bordered order-list">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>APPROVAL STATUS</th>
|
||
|
<th>APPROVAL COMMENTS</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td>
|
||
|
<select style="width: 100%" class="form-control"
|
||
|
name="approval_status" id="approval_status">
|
||
|
<option value="" disabled selected>Please select an
|
||
|
option</option>
|
||
|
<option value="A" <?php if (strcmp($row_med_log['approval_status'], 'A') == 0) {
|
||
|
echo "selected";
|
||
|
} ?>>Approved</option>
|
||
|
<option value="R" <?php if (strcmp($row_med_log['approval_status'], 'R') == 0) {
|
||
|
echo "selected";
|
||
|
} ?>>Rejected</option>
|
||
|
</select>
|
||
|
</td>
|
||
|
<td>
|
||
|
<input style="width: 100%" type="text"
|
||
|
name="approval_comments" id="approval_comments">
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php } ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- End box-body-->
|
||
|
<!--box-footer-->
|
||
|
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DIS') { ?>
|
||
|
<div class="box-footer" style="text-align: center;">
|
||
|
<button class="btn btn-info save_button" type="button" id="save_button"
|
||
|
onclick="save(<?= $i ?>);">
|
||
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
||
|
</button>
|
||
|
|
||
|
|
||
|
<button class="btn btn-success new_button" id="new_button" type="reset"
|
||
|
onclick="show_save_button();">
|
||
|
<i class="ace-icon fa fa-plus-square-o bigger-110"></i> New
|
||
|
</button>
|
||
|
</div>
|
||
|
<?php } ?>
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DOC') { ?>
|
||
|
<div class="box-footer" style="text-align: center;">
|
||
|
<button class="btn btn-info save_button" type="button" id="save_button"
|
||
|
onclick="save_approval();">
|
||
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
||
|
</button>
|
||
|
</div>
|
||
|
<?php } ?>
|
||
|
<!--End box-footer-->
|
||
|
</form>
|
||
|
</div>
|
||
|
<!-- Main Content Container for side bar and body-->
|
||
|
<div class="main-container ace-save-state" id="main-container">
|
||
|
<script type="text/javascript">
|
||
|
try {
|
||
|
ace.settings.loadState('main-container')
|
||
|
} catch (e) {}
|
||
|
</script>
|
||
|
<!--breadcrumb-->
|
||
|
<div class="main-content">
|
||
|
<div class="main-content-inner">
|
||
|
<!-- End of breadcrumb -->
|
||
|
<div class="page-content" style="margin-top: -47px;">
|
||
|
<div id="flexigridDiv" class="table-responsive">
|
||
|
<form>
|
||
|
<input type="hidden" name="f1" method="post" id="flex_notice_form">
|
||
|
<div id="flex1" style="width: 100%">
|
||
|
<input type="hidden" name="flex_med_id" id="flex_med_id" />
|
||
|
</div>
|
||
|
</form>
|
||
|
<form name="export_form" method="post" id="export_form" action="">
|
||
|
<input type="hidden" name="pdf_action" id="pdf_action"
|
||
|
value="direct_medicine_issue_pdf.php" /> <input type="hidden"
|
||
|
name="excel_action" id="excel_action" value="excel_notice.php" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- /.page-content -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- /.main-content -->
|
||
|
<script>
|
||
|
var itemOptions =
|
||
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id order by item_name", $row_treatment['item_id'], 'item_id', 'item_name', '', ''); ?>";
|
||
|
$(document).ready(function() {
|
||
|
$("#addrow").on("click", function() {
|
||
|
var newRow = $("<tr>");
|
||
|
var counter = $("#count_items").val();
|
||
|
var cols = "";
|
||
|
var select_treatment = "";
|
||
|
select_treatment += "<select ";
|
||
|
select_treatment += "id=\"item_id" + counter + "\"name=\"item_id" + counter +
|
||
|
"\" class=\"form-control select2\" data-placeholder=\"SELECT MEDICINE\" onchange=\"getAvailableQty(this.value," +
|
||
|
counter + ")\" style=\"width: 100%;\" ";
|
||
|
//select_treatment+="style=\"display: none;\"";
|
||
|
select_treatment += ">";
|
||
|
select_treatment += "<option value=\"\"> </option>";
|
||
|
select_treatment += itemOptions
|
||
|
select_treatment += "</select>";
|
||
|
cols += '<td>' + select_treatment + '</td>';
|
||
|
cols += '<td><span id="available' + counter + '" name="available' + counter +
|
||
|
'"></span> <span name="unit"></span></td>';
|
||
|
cols += '<td><select class="form-control" id="item_batch_no' + counter +
|
||
|
'" name="item_batch_no' + counter + '" ></select></td>';
|
||
|
cols += '<td><input type="number" class="form-control" id="issue_qty' +
|
||
|
counter + '" name="issue_qty' + counter +
|
||
|
'"/><span name="unit"></span></td>';
|
||
|
cols += '<td><input type="text" class="form-control" id="comments' + counter +
|
||
|
'" name="comments' + counter + '"/></td>';
|
||
|
cols +=
|
||
|
'<td align="center"><a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
||
|
newRow.append(cols);
|
||
|
$("#myTable").append(newRow);
|
||
|
/*$('#item_id'+counter).chosen({allow_single_deselect:true});
|
||
|
$('#item_id'+counter).next().css({'width': $('#item_id'+counter).parent().width()});*/
|
||
|
counter++;
|
||
|
$('.select2').select2()
|
||
|
$("#count_items").val(counter);
|
||
|
console.log(counter);
|
||
|
});
|
||
|
$("#myTable").on("click", "#deletebtn", function(event) {
|
||
|
$(this).closest("tr").remove();
|
||
|
// counter -= 1
|
||
|
// $("#count_items1").val(counter);
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<?php if ($_SESSION['RoleCode'] == 'DIS') { ?>
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
var w = screen.width * .90;
|
||
|
var h = 0;
|
||
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'direct_medicine_issue_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [{
|
||
|
display: '',
|
||
|
name: 'link',
|
||
|
width: w * .07,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Sr',
|
||
|
name: 'count',
|
||
|
width: w * .05,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Issue Point ',
|
||
|
name: 'type_name',
|
||
|
width: w * .08,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Date and Time',
|
||
|
name: 'date_of_issue',
|
||
|
width: w * .16,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Medicine Details',
|
||
|
name: 'item_name',
|
||
|
width: w * .28,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Approval status',
|
||
|
name: '',
|
||
|
width: w * .15,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
display: 'Comments',
|
||
|
name: 'item_name',
|
||
|
width: w * .28,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
],
|
||
|
buttons: [{
|
||
|
name: 'PDF',
|
||
|
bclass: 'print',
|
||
|
onpress: pdf
|
||
|
},
|
||
|
{
|
||
|
separator: true
|
||
|
},
|
||
|
{
|
||
|
name: 'Excel',
|
||
|
bclass: 'print_excel',
|
||
|
onpress: excel
|
||
|
},
|
||
|
{
|
||
|
separator: true
|
||
|
}
|
||
|
],
|
||
|
searchitems: [{
|
||
|
display: '',
|
||
|
name: ''
|
||
|
},
|
||
|
{
|
||
|
display: 'Issue Date(DD/MM/YYYY)',
|
||
|
name: 'date_of_issue'
|
||
|
},
|
||
|
{
|
||
|
display: 'Issue Point',
|
||
|
name: 'type_name'
|
||
|
},
|
||
|
{
|
||
|
display: 'Medicine Name',
|
||
|
name: 'item_name'
|
||
|
},
|
||
|
{
|
||
|
display: 'Issue Qty',
|
||
|
name: 'issue_qty'
|
||
|
},
|
||
|
],
|
||
|
sortname: "date_of_issue",
|
||
|
sortorder: "desc",
|
||
|
usepager: true, //pagination
|
||
|
//title:"Employee OPD",
|
||
|
useRp: true,
|
||
|
rp: 50, //records per page
|
||
|
showTableToggleBtn: false, //toggle button for the whole table
|
||
|
resizable: true,
|
||
|
// width: w,
|
||
|
height: h,
|
||
|
singleSelect: true
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
function show_save_button() {
|
||
|
$("#save_button").show();
|
||
|
$("#issue_log_id").val("");
|
||
|
$("#item_id").val("");
|
||
|
$("#issue_qty").val("");
|
||
|
$("#point_id").trigger("chosen:updated");
|
||
|
$("#item_id").trigger("chosen:updated");
|
||
|
}
|
||
|
|
||
|
function delete_direct_medicine_issue_report(issue_log_id) {
|
||
|
$.ajax({
|
||
|
url: 'delete_direct_medicine_issue.php',
|
||
|
data: {
|
||
|
issue_log_id: issue_log_id
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
if (data == 'SUCCESS') {
|
||
|
BootstrapDialog.alert('Deleted Direct Medicine Issue Successfully');
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
}
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting Direct Medicine Issue!!');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function open_direct_medicine_issue_report(issue_log_id, access) {
|
||
|
if (access == 'V') {
|
||
|
$("#save_button").hide()
|
||
|
} else if (access == 'E')
|
||
|
$("#save_button").show()
|
||
|
$.ajax({
|
||
|
url: 'select_direct_medicine_issue.php',
|
||
|
data: {
|
||
|
issue_log_id: issue_log_id
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
var content = "";
|
||
|
// alert(data.length);
|
||
|
for (i = 0; i < data.length; i++) {
|
||
|
if (i == 0) {
|
||
|
$("#point_id").val(data[i].issue_point_id);
|
||
|
$("#issue_date").val(data[i].issue_date);
|
||
|
$("#comment").val(data[i].comment_log);
|
||
|
$(".select2").select();
|
||
|
}
|
||
|
content += '<tr><td style="width:6%">'
|
||
|
content +=
|
||
|
'<input type="hidden" name="issue_log_id" id="issue_log_id" value="' +
|
||
|
issue_log_id + '">'
|
||
|
var select_treatment = "";
|
||
|
select_treatment += "<select ";
|
||
|
select_treatment += "id=\"item_id" + i + "\"name=\"item_id" + i +
|
||
|
"\" data-placeholder=\"SELECT MEDICINE\" class=\"form-control select2\" onchange=\"getAvailableQty(this.value," +
|
||
|
i + ")\" style=\"width: 100%;\" ";
|
||
|
//select_treatment+="style=\"display: none;\"";
|
||
|
select_treatment += ">";
|
||
|
select_treatment += "<option value=\"\"> </option>";
|
||
|
select_treatment += itemOptions
|
||
|
select_treatment += "</select>";
|
||
|
content += select_treatment;
|
||
|
content += '</td>'
|
||
|
content += '<td style="width:5%">'
|
||
|
content += '<span name="available' + i + '" id="available' + i +
|
||
|
'"></span> <span name="unit' + i + '" id="unit' + i + '"></span></td>'
|
||
|
content +=
|
||
|
'<td style="width:15%"><select class="form-control" id="item_batch_no' +
|
||
|
i + '" name="item_batch_no' + i + '" ></select></td>';
|
||
|
content += '<td style="width:1%"><input name="issue_qty' + i +
|
||
|
'" id=""issue_qty' + i + '" value="' + data[i].issue_qty +
|
||
|
'"class="form-control"/></td>'
|
||
|
content += '<td style="width:15%"><input type="text" name="comments' + i +
|
||
|
'" value="' + data[i].comments + '" id="comments' + i +
|
||
|
'" class="form-control"></td></tr>'
|
||
|
}
|
||
|
document.getElementById("count_items").value = (data.length);
|
||
|
|
||
|
$("#myTable tbody").html(content);
|
||
|
for (i = 0; i < data.length; i++) {
|
||
|
$("#item_id" + i).val(data[i].item_id);
|
||
|
getAvailableQty(data[i].item_id, i);
|
||
|
}
|
||
|
$(".select2").select();
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Medicine Issue Data');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function pdf() {
|
||
|
window.open('direct_medicine_issue_pdf.php', 'Direct Medicine Issue');
|
||
|
}
|
||
|
|
||
|
function excel() {
|
||
|
window.open('direct_medicine_issue_excel.php', 'Direct Medicine Issue');
|
||
|
}
|
||
|
|
||
|
function myDateFormat(date) {
|
||
|
var d = new Date(date);
|
||
|
var day = d.getDate();
|
||
|
var m = d.getMonth() + 1;
|
||
|
var y = d.getFullYear();
|
||
|
return day + "/" + m + "/" + y;
|
||
|
}
|
||
|
</script>
|
||
|
<?php } ?>
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
</div>
|
||
|
<!-- End of page-content -->
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<style>
|
||
|
#modal-add-ailment {
|
||
|
overflow-y: scroll;
|
||
|
}
|
||
|
</style>
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
<script type="text/javascript">
|
||
|
function save_approval() {
|
||
|
$.ajax({
|
||
|
url: 'update_medicine_issue_log.php',
|
||
|
type: 'POST',
|
||
|
data: $("#direct_medicine_issue_form").serialize(),
|
||
|
success: function(data) {
|
||
|
BootstrapDialog.alert("Approval Status Saved Successfully");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert(" Error In Saving Approval Status ");
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
function save(counter) {
|
||
|
var point_id = $('#point_id' + counter).val();
|
||
|
if (point_id == '') {
|
||
|
BootstrapDialog.alert('Please Select Issue Point.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
var issued_qty = $('#issued_qty' + counter).val();
|
||
|
if (issued_qty == '') {
|
||
|
BootstrapDialog.alert('Please Medicine Issue Quantity.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// to check empty batch
|
||
|
var count = $("#count_items").val();
|
||
|
// alert(count);
|
||
|
for (var i = 0; i < count; i++) {
|
||
|
var batch = $("#item_batch_no" + i).val();
|
||
|
// alert(batch);
|
||
|
var item_id = $("#item_id" + i).val();
|
||
|
if (item_id == null || item_id == '') {
|
||
|
continue;
|
||
|
}
|
||
|
if (batch == null || batch == '') {
|
||
|
BootstrapDialog.alert('Please select batch!!!!');
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
// check available quantity and issue quantity
|
||
|
if (parseFloat($("#available" + counter).html()) < parseFloat($("#issue_qty" + counter).val())) {
|
||
|
BootstrapDialog.alert('Issue Quantity Should Not Greater Than Available Quantity.!!!');
|
||
|
return false;
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: 'save_direct_medicine_issue_log.php ',
|
||
|
type: "POST",
|
||
|
data: $("#direct_medicine_issue_form").serialize(),
|
||
|
success: function(data) {
|
||
|
item_id = $("#item_id").val();
|
||
|
getAvailableQty(item_id);
|
||
|
$("#flex1").flexReload();
|
||
|
BootstrapDialog.alert('Direct Medicine Issue Saved Successfully.');
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Direct Medicine Issue');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
// location.href="procurement_list.php";
|
||
|
}
|
||
|
|
||
|
function datetime_formate(dt) {
|
||
|
dt = dt.split(' ');
|
||
|
dt = dt[0] + "T" + dt[1];
|
||
|
return dt;
|
||
|
}
|
||
|
if (!ace.vars['old_ie']) $('.datetimepicker').datetimepicker({
|
||
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
||
|
defaultDate: new Date(),
|
||
|
maxDate: new Date(),
|
||
|
icons: {
|
||
|
time: 'fa fa-clock-o',
|
||
|
date: 'fa fa-calendar',
|
||
|
up: 'fa fa-chevron-up',
|
||
|
down: 'fa fa-chevron-down',
|
||
|
previous: 'fa fa-chevron-left',
|
||
|
next: 'fa fa-chevron-right',
|
||
|
today: 'fa fa-arrows',
|
||
|
clear: 'fa fa-trash',
|
||
|
close: 'fa fa-times'
|
||
|
}
|
||
|
}).next().on(ace.click_event, function() {
|
||
|
$(this).prev().focus();
|
||
|
});
|
||
|
|
||
|
function myDateFormaterMonthYear(myDate) {
|
||
|
var d = new Date(myDate);
|
||
|
var m = d.getMonth() + 1;
|
||
|
var y = d.getFullYear();
|
||
|
var date = d.getDate();
|
||
|
// alert(date+"/"+m+"/"+y);
|
||
|
return m + "/" + y;
|
||
|
|
||
|
|
||
|
}
|
||
|
</script>
|
||
|
<!-- bootstrap & fontawesome -->
|
||
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
||
|
<!-- page specific plugin styles -->
|
||
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/chosen.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
|
||
|
<script type="text/javascript" src="js/typeahead.bundle.js"></script>
|
||
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
||
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
||
|
<script src="assets/js/chosen.jquery.min.js"></script>
|
||
|
<script src="assets/js/spinbox.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-timepicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
|
||
|
<script src="assets/js/dataTables.buttons.min.js"></script>
|
||
|
<script src="assets/js/buttons.flash.min.js"></script>
|
||
|
<script src="assets/js/buttons.html5.min.js"></script>
|
||
|
<script src="assets/js/buttons.print.min.js"></script>
|
||
|
<script src="assets/js/buttons.colVis.min.js"></script>
|
||
|
<script src="assets/js/dataTables.select.min.js"></script>
|
||
|
<script src="assets/js/moment.min.js"></script>
|
||
|
<script src="assets/js/daterangepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.knob.min.js"></script>
|
||
|
<script src="assets/js/autosize.min.js"></script>
|
||
|
<script src="assets/js/jquery.inputlimiter.min.js"></script>
|
||
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-tag.min.js"></script>
|
||
|
<script src="assets/js/ace-elements.min.js"></script>
|
||
|
<script type="text/javascript">
|