315 lines
9.9 KiB
PHP
315 lines
9.9 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) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
|
|
<!--breadcrumb-->
|
|
<?php
|
|
include('includes/config/config.php');
|
|
|
|
// Fetch OHC Types
|
|
$ohc_types = array();
|
|
$sql = "SELECT ohc_type_name,ohc_type_id FROM ohc_type WHERE ohc_category = ?";
|
|
$stmt = mysqli_prepare($conn, $sql);
|
|
|
|
|
|
if ($stmt) {
|
|
mysqli_stmt_bind_param($stmt, "s", $ohcCategory);
|
|
$ohcCategory = 'OHC';
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
|
|
while ($row = $result->fetch_array()) {
|
|
$ohc_types[] = $row;
|
|
}
|
|
mysqli_stmt_close($stmt);
|
|
} else {
|
|
error_log("Error: " . mysqli_error($conn));
|
|
}
|
|
error_log("Error: " . print_r($ohc_types, true));
|
|
?>
|
|
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li class="active">Reports</li>
|
|
<li class="active">Bio Waste Report</li>
|
|
<div class="nav-search" id="nav-search" style="width: 170px;">
|
|
|
|
</div>
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- End of breadcrumb -->
|
|
|
|
</div>
|
|
<div class="page-content">
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">Bio Waste Generation Report
|
|
</h4>
|
|
<table class="table table-bordered" style="margin-right: 50px">
|
|
<thead>
|
|
<tr>
|
|
|
|
<td width="5%" style="font-size: 10px" align="left"><strong>Sr.
|
|
No</strong></td>
|
|
<td width="14%" align="left" style="font-size: 10px"><strong>Report</strong></td>
|
|
<td width="14%" style="font-size: 10px">Start Date<strong></strong></td>
|
|
<td width="14%" style="font-size: 10px">End Date<strong></strong></td>
|
|
<td width="14%" style="font-size: 10px">Plant<strong></strong></td>
|
|
<td width="14%" style="font-size: 10px"><strong>Form</strong></td>
|
|
<td width="14%" style="font-size: 10px"><strong>Previous Forms</strong></td>
|
|
<td width="14%" style="font-size: 10px"><strong>Pdf</strong></td>
|
|
<td width="14%" style="font-size: 10px"><strong>Excel</strong></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr>
|
|
<form name="bio_waste_generation_form" method="get" action="">
|
|
|
|
<td align="left" width="2%">1</td>
|
|
<td align="left" width="14%" style="font-size: px">Bio Waste Generation
|
|
Report</strong>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input class="form-control date-picker" style="width: 100px; font-size: 10px; height: 25px;" id="startDate2" name="startDate2" type="text" data-date-format="dd-mm-yyyy" /> <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input class="form-control date-picker" style="width: 100px; font-size: 10px; height: 25px;" id="endDate2" name="endDate2" type="text" data-date-format="dd-mm-yyyy" /> <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
|
|
</td>
|
|
<!-- Dropdown for plant -->
|
|
<td>
|
|
<select name="plant" id="plant" class="form-control" style="width: 100px; font-size: 10px; height: 30px;">
|
|
<option value="ALL">ALL</option>
|
|
<?php foreach ($ohc_types as $type) : ?>
|
|
<option value="<?php echo htmlspecialchars($type['ohc_type_id']); ?>" <?php if($_SESSION['current_ohcttype'] == $type['ohc_type_id']) echo "selected"; ?>>
|
|
<?php echo htmlspecialchars($type['ohc_type_name']); ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</td>
|
|
<!-- adding form -->
|
|
<td align="left" width="14%">
|
|
<a href="#" onclick="Bio_medical_annual_reportFunction();">
|
|
<i class="glyphicon glyphicon-file"></i>
|
|
</a>
|
|
</td>
|
|
<td align="left" width="14%">
|
|
<a href="#" onclick="download_bio_medical_annual_report_function();">
|
|
<i class="glyphicon glyphicon-file"></i>
|
|
</a>
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td align="left" width="14%"><a href="#" onclick="bio_waste_generation_report_pdf();"><i class="glyphicon glyphicon-file"></i></a></td>
|
|
<td align="left" width="15%"><a href="#" onclick="bio_waste_generation_report_excel();"><i class="glyphicon glyphicon-download-alt"></i></a></td>
|
|
</form>
|
|
</tr>
|
|
<!-- <tr>
|
|
<form name="monthly_consumption_item" method="get" action="">
|
|
<td align="left" width="12%">2</td>
|
|
<td align="left" width="50%">Monthly Bio Waste Generation </td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input class="form-control date-picker"
|
|
style="width: 80px; font-size: 10px; height: 25px;"
|
|
id="startDate1" name="startDate1" type="text"
|
|
data-date-format="dd-mm-yyyy" /> <span
|
|
class="input-group-addon"> <i
|
|
class="fa fa-calendar bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input class="form-control date-picker"
|
|
style="width: 80px; font-size: 10px; height: 25px;"
|
|
id="endDate1" name="endDate1" type="text"
|
|
data-date-format="dd-mm-yyyy" /> <span
|
|
class="input-group-addon"> <i
|
|
class="fa fa-calendar bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
|
|
</td>
|
|
<td align="left" width="20%"><a href="#"
|
|
onclick="monthly_consumption_item_pdf();"><i
|
|
class="glyphicon glyphicon-file"></i></a></td>
|
|
|
|
<td align="left" width="20%"><a href="#"
|
|
onclick="monthly_consumption_item_excel();"><i
|
|
class="glyphicon glyphicon-download-alt"></i></a></td>-->
|
|
</form>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<!-- /.main-content -->
|
|
|
|
</div>
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<style>
|
|
.input-group-addon {
|
|
height: 25px;
|
|
width: 30px;
|
|
padding: 0px 0px;
|
|
}
|
|
</style>
|
|
<script>
|
|
function Bio_medical_annual_reportFunction() {
|
|
|
|
if ($("#plant").val() == 'ALL') {
|
|
BootstrapDialog.alert("Select Specific Ohc To Generate Form. Do Not Select ALL");
|
|
} else {
|
|
|
|
document.forms['bio_waste_generation_form'].action = "bio_medical_annual_report_pdf.php";
|
|
document.forms['bio_waste_generation_form'].method = 'POST';
|
|
document.forms['bio_waste_generation_form'].target = '_blank'
|
|
document.forms['bio_waste_generation_form'].submit();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function download_bio_medical_annual_report_function() {
|
|
|
|
if ($("#plant").val() == 'ALL') {
|
|
BootstrapDialog.alert("Select Specific Ohc To Download Available Form. Do Not Select ALL");
|
|
return;
|
|
} else{
|
|
var fromDate = $("#startDate2").val();
|
|
var toDate = $("#endDate2").val();
|
|
var plant = $("#plant").val();
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_previous_form.php',
|
|
data: {
|
|
fromDate: fromDate,
|
|
toDate: toDate,
|
|
ohc: plant
|
|
},
|
|
success: function(data) {
|
|
if (data == 0) {
|
|
BootstrapDialog.alert("No Form Available For Specified Date");
|
|
return;
|
|
} else {
|
|
document.forms['bio_waste_generation_form'].action = "download_bio_medical_annual_report_pdf.php";
|
|
document.forms['bio_waste_generation_form'].method = 'POST';
|
|
document.forms['bio_waste_generation_form'].target = '_blank'
|
|
document.forms['bio_waste_generation_form'].submit();
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Something Went Wrong At Server Side Try Again!");
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
function bio_waste_generation_report_pdf() {
|
|
|
|
|
|
|
|
document.forms['bio_waste_generation_form'].action = "bio_waste_generation_form_pdf.php";
|
|
document.forms['bio_waste_generation_form'].method = 'POST';
|
|
document.forms['bio_waste_generation_form'].target = '_blank'
|
|
document.forms['bio_waste_generation_form'].submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function bio_waste_generation_report_excel() {
|
|
|
|
|
|
|
|
document.forms['bio_waste_generation_form'].action = "bio_waste_generation_form_excel.php";
|
|
document.forms['bio_waste_generation_form'].method = 'POST';
|
|
document.forms['bio_waste_generation_form'].target = '_blank'
|
|
document.forms['bio_waste_generation_form'].submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
function monthly_consumption_item_pdf() {
|
|
|
|
var startDate1 = $('#startDate1').val();
|
|
if (startDate1 == null || startDate1 == "") {
|
|
BootstrapDialog.alert('Please Enter Start Date');
|
|
return false;
|
|
}
|
|
var endDate1 = $('#endDate1').val();
|
|
if (endDate1 == null || endDate1 == "") {
|
|
BootstrapDialog.alert('Please Enter End Date');
|
|
return false;
|
|
}
|
|
|
|
document.forms['monthly_consumption_item'].action = "monthly_wise_item_consumption_pdf_report.php";
|
|
document.forms['monthly_consumption_item'].method = 'get';
|
|
document.forms['monthly_consumption_item'].target = '_blank'
|
|
document.forms['monthly_consumption_item'].submit();
|
|
|
|
}
|
|
|
|
function monthly_consumption_item_excel() {
|
|
|
|
var startDate1 = $('#startDate1').val();
|
|
if (startDate1 == null || startDate1 == "") {
|
|
BootstrapDialog.alert('Please Enter Start Date');
|
|
return false;
|
|
}
|
|
var endDate1 = $('#endDate1').val();
|
|
if (endDate1 == null || endDate1 == "") {
|
|
BootstrapDialog.alert('Please Enter End Date');
|
|
return false;
|
|
}
|
|
|
|
document.forms['monthly_consumption_item'].action = "monthly_wise_item_consumption_excel_report.php";
|
|
document.forms['monthly_consumption_item'].method = 'get';
|
|
document.forms['monthly_consumption_item'].target = '_blank'
|
|
document.forms['monthly_consumption_item'].submit();
|
|
|
|
}
|
|
$('#startDate1').datepicker({
|
|
format: "mm-yyyy",
|
|
viewMode: "months",
|
|
minViewMode: "months"
|
|
});
|
|
$('#endDate1').datepicker({
|
|
format: "mm-yyyy",
|
|
viewMode: "months",
|
|
minViewMode: "months"
|
|
});
|
|
</script>
|