1055 lines
37 KiB
PHP
1055 lines
37 KiB
PHP
<script>
|
|
function validate() {
|
|
save_emp_assign_schedule_status_form();
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
#modal-assign-schedule-status {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
|
|
<div class=" modal fade" id="modal-emp-assign-schedule-status" name="modal-emp-assign-schedule-status" role="dialog"
|
|
aria-hidden="true">
|
|
<form role="form" wrap="true" id="emp_assign_schedule_status_form" name="emp_assign_schedule_status_form" action="#"
|
|
method="post">
|
|
<div>
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">Assign Program Schedule Status</h5>
|
|
<div class="widget-toolbar">
|
|
<div class="widget-menu">
|
|
<a href="#" class="close" data-action="close" data-dismiss="modal">
|
|
<i class="ace-icon fa fa-times"></i>
|
|
</a>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" class="form-control" id="emp_assign_training_id" name="emp_assign_training_id"
|
|
data-placeholder="" />
|
|
|
|
<input type="hidden" class="form-control" id="assign_training_id" name="assign_training_id"
|
|
data-placeholder="" />
|
|
|
|
<div class="modal-body">
|
|
<!-- <div class="form-group">
|
|
<label for="role">Employee Name</label>
|
|
<input type="text" class="form-control" id="emp_id" name="emp_id" data-placeholder="" />
|
|
|
|
</div> -->
|
|
<div class="form-group">
|
|
<label for="schedule">Program Schedule</label>
|
|
<input type="text" disabled class="form-control" name="schedule" id="schedule" placeholder=""
|
|
required />
|
|
</div>
|
|
|
|
<div class="form-group" style="width: 200px;">
|
|
<label for="emp_serach">Search Trainee</label>
|
|
|
|
<select class="form-control select2" id="emp_search" name="emp_search"
|
|
data-placeholder="Select Trainee"
|
|
onchange="open_assign_training_schedule($('#assign_training_id').val())">
|
|
<option value=""></option>
|
|
<?php echo generateOption2('patient_master', 'concat(patient_name," ",emp_code)', 'id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- <div class="form-group">
|
|
<label for="role">Program Location</label>
|
|
|
|
<input type="text" class="form-control" id="location" name="location" data-placeholder="" />
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="role">Program Status</label>
|
|
|
|
<select class="form-control" id="status" name="status"
|
|
data-placeholder="Select Training Status">
|
|
<option value=""></option>
|
|
<option value="Y">Completed</option>
|
|
<option value="N">Scheduled</option>
|
|
<option value="">No So</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="ailment">Program Completion Date</label>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="input-group">
|
|
<input class="form-control date-picker" name="completion_date" id="completion_date"
|
|
type="text" data-date-format="dd/mm/yyyy" />
|
|
<span class="input-group-addon">
|
|
<i class="fa fa-calendar bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<!-- <div class="widget-toolbox padding-8 clearfix">
|
|
<button type="button" class="btn btn-info btn-sm save_button" onclick="validate();"><i
|
|
class="ace-icon fa fa-floppy-o bigger-110"></i>Save </button>
|
|
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal"><i
|
|
class="ace-icon fa fa-times bigger-110"></i>Cancel</button>
|
|
</div> -->
|
|
<?php
|
|
|
|
$db_new_date="";
|
|
$last_day="";
|
|
$m=0;
|
|
$y=0;
|
|
$selectedParamMonth = $_POST['param_month'];
|
|
//echo "month......".$selectedShiftMonth;
|
|
$selectedParamYear = $_POST['param_year'];
|
|
//echo "year.........".$selectedShiftYear;
|
|
if(isset($selectedParamYear)&& $selectedParamYear!="" && isset($selectedParamMonth) && $selectedParamMonth!=""){
|
|
$last_day = date("t-m-Y", strtotime("".$selectedParamYear."-".($selectedParamMonth+1)."-01"));
|
|
// echo "last:date".$last_day;
|
|
}
|
|
else{
|
|
$last_day = date('t-m-Y');
|
|
//echo "last:date1".$last_day;
|
|
}
|
|
$m = date('m',strtotime("".$selectedParamYear."-".($selectedParamMonth+1)."-01"));
|
|
////echo "month det".$m;
|
|
$y = date('Y',strtotime("".$selectedParamYear."-".($selectedParamMonth+1)."-01"));
|
|
//echo "year det".$y;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<style>
|
|
.divScroll {
|
|
overflow: scroll;
|
|
|
|
}
|
|
</style>
|
|
<script>
|
|
var jsonArrayParamData = <?php echo json_encode($param_data); ?>;
|
|
</script>
|
|
|
|
|
|
|
|
<div class="divScroll" id="shift_table">
|
|
|
|
<table style="margin-top: 30px;width:1200px" id="myTable"
|
|
class="table table-bordered order-list">
|
|
<thead>
|
|
<tr>
|
|
<td></td>
|
|
<td>Date</td>
|
|
<?php
|
|
|
|
for($j=1; $j<=$last_day; $j++){
|
|
$new_date = $j."-".$m."-".$y;
|
|
$day = date('D', strtotime($new_date));
|
|
?>
|
|
<td><?php echo date('d', strtotime($new_date));?></td>
|
|
|
|
<?php }?>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>Sr. No.</td>
|
|
<td>Description</td>
|
|
<?php
|
|
// $last_day = date('t-m-Y');
|
|
// $m = date('m');
|
|
// $y = date('Y');
|
|
for($k=1; $k<=$last_day; $k++){
|
|
$new_date = $k."-".$m."-".$y;
|
|
$day = date('D', strtotime($new_date));
|
|
?>
|
|
|
|
<td><?php echo $day?></td>
|
|
|
|
|
|
<?php }?>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody>
|
|
<?php $count = 1;
|
|
|
|
$cat= $_POST["inventory_cat"];
|
|
if($_POST["inventory_cat"]!='AMB_CHECK' ) {
|
|
$type=$_POST["inventory_type"];
|
|
}
|
|
else {$type =$_POST["inventory_type2"];}
|
|
$ohc="SELECT ohc_type_id from ohc_type where ohc_type_name = '".$type."' and ohc_category='".$cat."' ";
|
|
error_log("PARAMS1111111::".$ohc);
|
|
$results_ohc = mysqli_query($conn,$ohc);
|
|
$row_ohc= mysqli_fetch_array($results_ohc);
|
|
error_log("ohc Id".$row_ohc['ohc_type_id']);
|
|
$i = 1;
|
|
$query = "select stock_issue_id from stock_issue where ohc_location_id = '".$row_ohc['ohc_type_id']."' ";
|
|
error_log("PARAMS::".$query);
|
|
$result = @mysqli_query($conn,$query);
|
|
while( $row = mysqli_fetch_assoc($result)){
|
|
|
|
|
|
$stock_issue_item_id= "select * from stock_issue_items where stock_issue_id='".$row['stock_issue_id']."'";
|
|
|
|
$results_issue_item_id = mysqli_query($conn,$stock_issue_item_id);
|
|
while ($row_issue_item_id= mysqli_fetch_assoc($results_issue_item_id)) {
|
|
|
|
$item_desc="";
|
|
$sql_issue_items="select * from stock_issue_items where stock_issue_item_id='".$row_issue_item_id['stock_issue_item_id']."'";
|
|
|
|
$results_issue_items = mysqli_query($conn,$sql_issue_items);
|
|
while ($row_issue_items= mysqli_fetch_assoc($results_issue_items)) {
|
|
|
|
if($row_issue_items['issue_qty'] != 0){
|
|
$item_desc = $item_desc.' <p> '.getItemWithFormName($row_issue_items['item_id'])." ";
|
|
//$item_desc = $item_desc.getTableFieldValue('tbl_items','item_name','item_id',$row_issue_items['item_id'])."<br/>";
|
|
$item_unit_id=getTableFieldValue('tbl_items','unit_id','item_id',$row_issue_items['item_id']);
|
|
$item_unit =getTableFieldValue('unit_master','unit_name','unit_id',$item_unit_id);
|
|
// $issuby = getTableFieldValue('patient_master' , 'patient_name' , 'id' , $row_issue_items['stock_issue_emp_id']);
|
|
error_log("Userid " . $issuby);
|
|
$item_desc=$item_desc.'<b> Qty: '.$row_issue_items['issue_qty'].' '.$item_unit.'</b>';
|
|
$item_desc=$item_desc."</p>";
|
|
}
|
|
|
|
else{
|
|
$item_desc = $item_desc.' <p> '.getItemWithFormName($row_issue_items['item_id'])." ";
|
|
//$item_desc = $item_desc.getTableFieldValue('tbl_items','item_name','item_id',$row_issue_items['item_id'])."<br/>";
|
|
$item_unit_id=getTableFieldValue('tbl_items','unit_id','item_id',$row_issue_items['item_id']);
|
|
$item_unit =getTableFieldValue('unit_master','unit_name','unit_id',$item_unit_id);
|
|
// $issuby = getTableFieldValue('patient_master' , 'patient_name' , 'id' , $row_issue_items['stock_issue_emp_id']);
|
|
error_log("Userid " . $issuby);
|
|
// $item_desc=$item_desc.'<b>'.$item_unit.'</b>';
|
|
$item_desc=$item_desc."</p>";
|
|
|
|
}
|
|
|
|
error_log('ttt'.$row_issue_items['stock_issue_item_id']);
|
|
?>
|
|
<tr>
|
|
<td></td>
|
|
<td><?php echo $item_desc; ?></td>
|
|
|
|
|
|
|
|
<input type="hidden" name="param_id<?php echo $i?>" id="param_id<?php echo $i?>"
|
|
value="<?php echo $row_issue_items['stock_issue_item_id'];?>" />
|
|
<?php $status_id="";
|
|
$param_data =array();
|
|
$query1 = "select status_id,param_date, param_id, param_status from inventory_parameters_status where month(param_date)='". $m."' and year(param_date)='".$y."' ";
|
|
error_log("PARAMETER QUERY." .$query1);
|
|
//echo "selet query......................................".$query1 ;
|
|
$result1 = @mysqli_query($conn,$query1);
|
|
while( $row_param = @mysqli_fetch_assoc($result1)){
|
|
//echo "adarsh";
|
|
|
|
$status_id=$row_param['status_id'];
|
|
$key=$row_param['param_id'].'_'.$row_param['param_date'];
|
|
//echo "key:".$key;
|
|
$value=$row_param['param_status'];
|
|
//echo "value:".$value;
|
|
$param_data[$key]=$value;
|
|
// array_push($shift_data[$key], $value);
|
|
|
|
?>
|
|
<input type="hidden" name="status_id<?php echo $i?>" id="status_id<?php echo $i?>"
|
|
value="<?php echo $status_id?>" />
|
|
<?php }?>
|
|
<?php
|
|
$db_new_date="";
|
|
// $last_day = date('t-m-Y');
|
|
//$m = date('m');
|
|
// $y = date('Y');
|
|
for($k=1; $k<=$last_day; $k++){
|
|
$new_date = $k."-".$m."-".$y;
|
|
$db_new_date = $y."-".$m."-".$k;
|
|
$day = date('D', strtotime($new_date));
|
|
if($k<10){
|
|
$db_new_date = $y."-".$m."-0".$k;
|
|
}
|
|
?>
|
|
<?php
|
|
//echo "key:".$row['id'].'_'.$db_new_date;
|
|
|
|
?>
|
|
<?php if($row_issue_items['issue_qty'] != 0){?>
|
|
<td>
|
|
<div style="width:80px;">
|
|
|
|
<input type="checkbox" style="margin-left:20px;max-width:50%;"
|
|
id="param_status_<?php echo $i?>_<?php echo $k?>"
|
|
name="param_status_<?php echo $i?>_<?php echo $k?>[]"
|
|
onchange="save_params(<?php echo $i?>,<?php echo $k?>)" />
|
|
|
|
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
<?php $key= $row_issue_items['stock_issue_item_id'].'_'.$db_new_date;?>
|
|
var existingParamValues<?php echo $i?>_<?php echo $k?> =
|
|
"<?php echo $param_data[$key]?>"
|
|
document.getElementById(
|
|
"param_status_<?php echo $i?>_<?php echo $k?>"
|
|
).value =
|
|
existingParamValues<?php echo $i?>_<?php echo $k?>;
|
|
|
|
if (document.getElementById(
|
|
"param_status_<?php echo $i?>_<?php echo $k?>"
|
|
).value == "1" || document.getElementById(
|
|
"param_status_<?php echo $i?>_<?php echo $k?>"
|
|
).value == "on") {
|
|
document.getElementById(
|
|
"param_status_<?php echo $i?>_<?php echo $k?>"
|
|
).checked = true;
|
|
}
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
<input type="hidden" name="param_date_<?php echo $i?>_<?php echo $k?>"
|
|
id="param_date_<?php echo $i?>_<?php echo $k?>"
|
|
value="<?php echo $new_date?>" />
|
|
|
|
<?php }?>
|
|
</tr>
|
|
|
|
|
|
<?php
|
|
if($row_issue_items['issue_qty'] == 0){
|
|
$count++;
|
|
}
|
|
$i++;
|
|
}}};
|
|
|
|
?>
|
|
|
|
|
|
|
|
</tbody>
|
|
<tfoot>
|
|
|
|
<tr>
|
|
<td></td>
|
|
<td><strong>Inspected By</strong></td>
|
|
<?php
|
|
$db_new_date="";
|
|
// $last_day = date('t-m-Y');
|
|
//$m = date('m');
|
|
// $y = date('Y');
|
|
for($k=1; $k<=$last_day; $k++){
|
|
$new_date = $k."-".$m."-".$y;
|
|
$db_new_date = $y."-".$m."-".$k;
|
|
$day = date('D', strtotime($new_date));
|
|
if($k<10){
|
|
$db_new_date = $y."-".$m."-0".$k;
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
<td></td>
|
|
|
|
<?php } ?>
|
|
</tr>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</tfoot>
|
|
</table>
|
|
<input type="hidden" name="count_items" id="count_items" value="<?php echo $count-1?>" />
|
|
<input type="hidden" name="last_day" id="last_day" value="<?php echo $last_day?>" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<!-- End box-body-->
|
|
<!--box-footer-->
|
|
|
|
|
|
<!-- <div class="box-footer" style="text-align: center;">
|
|
<button class="btn btn-info save_button" type="button"
|
|
id="save_button" onclick="validate();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
<i class="ace-icon fa fa-undo bigger-110"></i> Reset
|
|
</button>
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
<!--End box-footer-->
|
|
|
|
|
|
</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_notice_id" id="flex_notice_id" />
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<form name="export_form" method="post" id="export_form" action="">
|
|
|
|
|
|
<input type="hidden" name="pdf_action" id="pdf_action" value="notice_pdf.php" />
|
|
<input type="hidden" name="excel_action" id="excel_action"
|
|
value="invenort_checklist_excel.php" />
|
|
</form>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<!-- /.page-content -->
|
|
</div>
|
|
</div>
|
|
<!-- /.main-content -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- End of page-content -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var getDaysInMonth = function(year, month) {
|
|
// Here January is 1 based
|
|
//Day 0 is the last day in the previous month
|
|
return new Date(year, month, 0).getDate();
|
|
// Here January is 0 based
|
|
// return new Date(year, month+1, 0).getDate();
|
|
};
|
|
|
|
function shiftDetails() {
|
|
var shift_month = parseInt($("#shift_month").val());
|
|
var shift_year = parseInt($("#shift_year").val());
|
|
|
|
var content = "<tr><td></td><td>Date</td>";
|
|
for (var i = 1; i <= getDaysInMonth(shift_year, shift_month); i++) {
|
|
content += '<td>' + i + '</td>'
|
|
data_string = i + "/" + shift_month + "/" + shift_year
|
|
date = new Date(data_string);
|
|
}
|
|
var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
|
|
content += "<tr><td>S No.</td><td>Days/Staff Name</td>";
|
|
for (var i = 1; i <= getDaysInMonth(shift_year, shift_month); i++) {
|
|
//content+='<td>'+i+'</td>'
|
|
let data_string = shift_month + "/" + i + "/" + shift_year;
|
|
let d = new Date(data_string)
|
|
|
|
//weekday = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][new Date(data_string).getDay()]
|
|
content += '<td>' + days[d.getDay()] + '</td>'
|
|
}
|
|
content += `</tbody><tfoot><tr><td></td><td><strong>Inspected By</strong></td>`;
|
|
for (var i = 1; i <= getDaysInMonth(shift_year, shift_month); i++) {
|
|
//content+='<td>'+i+'</td>'
|
|
let data_string = shift_month + "/" + i + "/" + shift_year;
|
|
let d = new Date(data_string)
|
|
|
|
//weekday = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][new Date(data_string).getDay()]
|
|
content += '<td>' + days[d.getDay()] + '</td>'
|
|
}
|
|
content += `<td></td></tr></tr></tfoot></table>`;
|
|
$("#myTable").html(content);
|
|
|
|
}
|
|
|
|
|
|
function validate() {
|
|
|
|
|
|
|
|
save();
|
|
}
|
|
|
|
function myCalender() {
|
|
var month = $("#shift_month").val();
|
|
var year = $("#shift_year").val();
|
|
var open_date = '01-' + month + '-' + year;
|
|
|
|
$("#shift_calendar").val(open_date).show();
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
#modal-add-ailment {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$('.select2').select2()
|
|
jQuery(function($) {
|
|
|
|
var myTable =
|
|
$('#dynamic-table')
|
|
|
|
.DataTable({
|
|
bAutoWidth: false,
|
|
"aoColumns": [{
|
|
"bSortable": false
|
|
},
|
|
null, null, null, null, null,
|
|
{
|
|
"bSortable": false
|
|
}
|
|
],
|
|
"aaSorting": [],
|
|
|
|
|
|
|
|
|
|
|
|
select: {
|
|
style: 'multi'
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
var defaultCopyAction = myTable.button(1).action();
|
|
myTable.button(1).action(function(e, dt, button, config) {
|
|
defaultCopyAction(e, dt, button, config);
|
|
$('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white');
|
|
});
|
|
|
|
|
|
var defaultColvisAction = myTable.button(0).action();
|
|
myTable.button(0).action(function(e, dt, button, config) {
|
|
|
|
defaultColvisAction(e, dt, button, config);
|
|
|
|
|
|
if ($('.dt-button-collection > .dropdown-menu').length == 0) {
|
|
$('.dt-button-collection')
|
|
.wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />')
|
|
.find('a').attr('href', '#').wrap("<li />")
|
|
}
|
|
$('.dt-button-collection').appendTo('.tableTools-container .dt-buttons')
|
|
});
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
$($('.tableTools-container')).find('a.dt-button').each(function() {
|
|
var div = $(this).find(' > div').first();
|
|
if (div.length == 1) div.tooltip({
|
|
container: 'body',
|
|
title: div.parent().text()
|
|
});
|
|
else $(this).tooltip({
|
|
container: 'body',
|
|
title: $(this).text()
|
|
});
|
|
});
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
|
|
// myTable.on( 'select', function ( e, dt, type, index ) {
|
|
// if ( type === 'row' ) {
|
|
// $( myTable.row( index ).node() ).find('input:checkbox').prop('checked', true);
|
|
// }
|
|
// } );
|
|
// myTable.on( 'deselect', function ( e, dt, type, index ) {
|
|
// if ( type === 'row' ) {
|
|
// $( myTable.row( index ).node() ).find('input:checkbox').prop('checked', false);
|
|
// }
|
|
// } );
|
|
|
|
|
|
|
|
|
|
// $('th input[type=checkbox], td input[type=checkbox]').prop('checked', false);
|
|
|
|
|
|
$('#dynamic-table > thead > tr > th input[type=checkbox], #dynamic-table_wrapper input[type=checkbox]').eq(
|
|
0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$('#dynamic-table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) myTable.row(row).select();
|
|
else myTable.row(row).deselect();
|
|
});
|
|
});
|
|
|
|
|
|
$('#dynamic-table').on('click', 'td input[type=checkbox]', function() {
|
|
var row = $(this).closest('tr').get(0);
|
|
if (this.checked) myTable.row(row).deselect();
|
|
else myTable.row(row).select();
|
|
});
|
|
|
|
|
|
|
|
$(document).on('click', '#dynamic-table .dropdown-toggle', function(e) {
|
|
e.stopImmediatePropagation();
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
});
|
|
|
|
|
|
|
|
|
|
var active_class = 'active';
|
|
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$(this).closest('table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0)
|
|
.prop('checked', true);
|
|
else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop(
|
|
'checked', false);
|
|
});
|
|
});
|
|
|
|
$('#simple-table').on('click', 'td input[type=checkbox]', function() {
|
|
var $row = $(this).closest('tr');
|
|
if ($row.is('.detail-row ')) return;
|
|
if (this.checked) $row.addClass(active_class);
|
|
else $row.removeClass(active_class);
|
|
});
|
|
|
|
|
|
|
|
|
|
$('[data-rel="tooltip"]').tooltip({
|
|
placement: tooltip_placement
|
|
});
|
|
|
|
|
|
function tooltip_placement(context, source) {
|
|
var $source = $(source);
|
|
var $parent = $source.closest('table')
|
|
var off1 = $parent.offset();
|
|
var w1 = $parent.width();
|
|
|
|
var off2 = $source.offset();
|
|
|
|
|
|
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
|
|
return 'left';
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
$('.show-details-btn').on('click', function(e) {
|
|
e.preventDefault();
|
|
$(this).closest('tr').next().toggleClass('open');
|
|
$(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass(
|
|
'fa-angle-double-up');
|
|
});
|
|
/***************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
function save_params(i, j) {
|
|
|
|
var box = document.getElementById("param_status_" + i + "_" + j);
|
|
|
|
if (box.checked == true) {
|
|
document.getElementById("param_status_" + i + "_" + j).value = 1;
|
|
} else {
|
|
document.getElementById("param_status_" + i + "_" + j).value = 0;
|
|
}
|
|
|
|
|
|
var formData = {
|
|
training_status: $("#param_status_" + i + "_" + j).val(),
|
|
training_remarks: $("#param_remarks_" + i + "_" + j).val(),
|
|
emp_id: $("#param_emp_" + i + "_" + j).val(),
|
|
training_date: $("#param_date_" + i + "_" + j).val(),
|
|
assign_training_id: $("#assign_training_id").val(),
|
|
};
|
|
|
|
|
|
|
|
$.ajax({
|
|
url: 'save_training_status.php ',
|
|
type: "POST",
|
|
data: formData,
|
|
success: function(data) {
|
|
// $(".close").click();
|
|
// BootstrapDialog.alert('Training Details Saved Successfully.');
|
|
// $("#flex1").flexReload();
|
|
//document.forms[0].action='';document.forms[0].submit();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Inventory Details');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
// location.href="procurement_list.php";
|
|
|
|
// });
|
|
|
|
|
|
}
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
format: 'dd/mm/yyyy'
|
|
}).next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
</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">
|
|
$(document).ready(function() {
|
|
|
|
const select = document.getElementById('myselect');
|
|
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
$('#id-disable-check').on('click', function() {
|
|
var inp = $('#form-input-readonly').get(0);
|
|
if (inp.hasAttribute('disabled')) {
|
|
inp.setAttribute('readonly', 'true');
|
|
inp.removeAttribute('disabled');
|
|
inp.value = "This text field is readonly!";
|
|
} else {
|
|
inp.setAttribute('disabled', 'disabled');
|
|
inp.removeAttribute('readonly');
|
|
inp.value = "This text field is disabled!";
|
|
}
|
|
});
|
|
|
|
|
|
if (!ace.vars['touch']) {
|
|
$('.chosen-select').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
|
|
|
|
$(window)
|
|
.off('resize.chosen')
|
|
.on('resize.chosen', function() {
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
}).trigger('resize.chosen');
|
|
//resize chosen on sidebar collapse/expand
|
|
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
|
|
if (event_name != 'sidebar_collapsed') return;
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
});
|
|
|
|
|
|
$('#chosen-multiple-style .btn').on('click', function(e) {
|
|
var target = $(this).find('input[type=radio]');
|
|
var which = parseInt(target.val());
|
|
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
|
|
else $('#form-field-select-4').removeClass('tag-input-style');
|
|
});
|
|
}
|
|
|
|
|
|
$('[data-rel=tooltip]').tooltip({
|
|
container: 'body'
|
|
});
|
|
$('[data-rel=popover]').popover({
|
|
container: 'body'
|
|
});
|
|
|
|
autosize($('textarea[class*=autosize]'));
|
|
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
|
|
|
|
|
|
|
|
//"jQuery UI Slider"
|
|
//range slider tooltip example
|
|
$("#slider-range").css('height', '200px').slider({
|
|
orientation: "vertical",
|
|
range: true,
|
|
min: 0,
|
|
max: 100,
|
|
values: [17, 67],
|
|
slide: function(event, ui) {
|
|
var val = ui.values[$(ui.handle).index() - 1] + "";
|
|
|
|
if (!ui.handle.firstChild) {
|
|
$("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
|
|
.prependTo(ui.handle);
|
|
}
|
|
$(ui.handle.firstChild).show().children().eq(1).text(val);
|
|
}
|
|
}).find('span.ui-slider-handle').on('blur', function() {
|
|
$(this.firstChild).hide();
|
|
});
|
|
|
|
|
|
$("#slider-range-max").slider({
|
|
range: "max",
|
|
min: 1,
|
|
max: 10,
|
|
value: 2
|
|
});
|
|
|
|
$("#slider-eq > span").css({
|
|
width: '90%',
|
|
'float': 'left',
|
|
margin: '15px'
|
|
}).each(function() {
|
|
// read initial values from markup and remove that
|
|
var value = parseInt($(this).text(), 10);
|
|
$(this).empty().slider({
|
|
value: value,
|
|
range: "min",
|
|
animate: true
|
|
|
|
});
|
|
});
|
|
|
|
$("#slider-eq > span.ui-slider-purple").slider('disable'); //disable third item
|
|
|
|
|
|
$('#id-input-file-1 , #id-input-file-2').ace_file_input({
|
|
no_file: 'No File ...',
|
|
btn_choose: 'Choose',
|
|
btn_change: 'Change',
|
|
droppable: false,
|
|
onchange: null,
|
|
thumbnail: false //| true | large
|
|
//whitelist:'gif|png|jpg|jpeg'
|
|
//blacklist:'exe|php'
|
|
//onchange:''
|
|
//
|
|
});
|
|
//pre-show a file name, for example a previously selected file
|
|
//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//datepicker plugin
|
|
//link
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
//show datepicker when clicking on the icon
|
|
.next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
|
|
|
|
|
|
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
|
|
//and its width cannot be determined.
|
|
//so we set the width after modal is show
|
|
$('#modal-form').on('shown.bs.modal', function() {
|
|
if (!ace.vars['touch']) {
|
|
$(this).find('.chosen-container').each(function() {
|
|
$(this).find('a:first-child').css('width', '210px');
|
|
$(this).find('.chosen-drop').css('width', '210px');
|
|
$(this).find('.chosen-search input').css('width', '200px');
|
|
});
|
|
}
|
|
})
|
|
/**
|
|
//or you can activate the chosen plugin after modal is shown
|
|
//this way select element becomes visible with dimensions and chosen works as expected
|
|
$('#modal-form').on('shown', function () {
|
|
$(this).find('.modal-chosen').chosen();
|
|
})
|
|
*/
|
|
|
|
|
|
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
autosize.destroy('textarea[class*=autosize]')
|
|
|
|
$('.limiterBox,.autosizejs').remove();
|
|
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu')
|
|
.remove();
|
|
});
|
|
|
|
});
|
|
|
|
function pdf() {
|
|
|
|
|
|
$("#shift_form").attr('method', 'POST');
|
|
|
|
$("#shift_form").attr('action', 'invenort_checklist_pdf.php');
|
|
$("#shift_form").attr('target', "_blank");
|
|
// $("#shift_form").submit();
|
|
|
|
}
|
|
|
|
function excel() {
|
|
|
|
|
|
$("#shift_form").attr('method', 'POST');
|
|
|
|
$("#shift_form").attr('action', 'invenort_checklist_excel.php');
|
|
$("#shift_form").attr('target', "_blank");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
$(document ).ready(function() {
|
|
|
|
|
|
$('#shift_year').val(2021);
|
|
|
|
var totalCount = <?php echo $count?>;
|
|
var totalK= <?php echo $k?>;
|
|
for(var rCount=1; rCount<=totalCount; rCount++){
|
|
for(var cCount=1; cCount<=totalK; cCount++){
|
|
var key =$("#shift_date_"+rCount+"_"+cCount).val();
|
|
var existingShiftValues= jsonArrayShiftData[key];
|
|
if(existingShiftValues!=null && existingShiftValues!=undefined && existingShiftValues !=""){
|
|
$("#shift_status_"+rCount+"_"+cCount).val(existingShiftValues.split(',')).trigger("chosen:updated");
|
|
}
|
|
}
|
|
}
|
|
|
|
});*/
|
|
</script>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|