161 lines
7.2 KiB
PHP
161 lines
7.2 KiB
PHP
<script>
|
|
function addingDiv(credit_to) {
|
|
if (credit_to == '2') {
|
|
$("#employee_cat_div").show();
|
|
$("#employee_div").hide();
|
|
} else if (credit_to == '3') {
|
|
$("#employee_cat_div").hide();
|
|
$("#employee_div").show();
|
|
|
|
} else {
|
|
$("#employee_cat_div").hide();
|
|
$("#employee_div").hide();
|
|
}
|
|
|
|
}
|
|
|
|
function validate() {
|
|
|
|
if ($("#schedule_id").val() == '' || $("#schedule_id").val() == null) {
|
|
BootstrapDialog.alert("Please Select Training Schedule!");
|
|
return;
|
|
} else if ($("#assign_date").val() == '' || $("#assign_date").val() == null) {
|
|
BootstrapDialog.alert("Please Select Assign date!");
|
|
return;
|
|
} else {
|
|
save_training_assign();
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
#modal-add-ailment {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
<div class="modal fade" id="modal-add-training-assign" name="modal-add-training-assign" role="dialog"
|
|
aria-hidden="true">
|
|
<form role="form" id="training_assign_form" name="training_assign_form" action="#" method="post">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">Program Assign Form</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>
|
|
|
|
<div class="modal-body">
|
|
<div class="form-group ">
|
|
<label for="role">Credit To</label>
|
|
<input type="hidden" class="form-control" name="assign_training_id" id="assign_training_id"
|
|
value="" required />
|
|
|
|
<select class="chosen-select form-control" id="credit_to" name="credit_to"
|
|
data-placeholder="Select Credit To" onchange="addingDiv(this.value)">
|
|
<option value=""></option>
|
|
<option value="1">All Employee</option>
|
|
<option value="2">Employee Categories</option>
|
|
<option value="3">Specific Employee</option>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<div class="form-group" style="display:none" id="employee_cat_div">
|
|
<label for="role">Employee Categories</label>
|
|
<select class="chosen-select form-control" id="emp_cat_id" multiple="" name="emp_cat_id"
|
|
data-placeholder="Select Employee Categories">
|
|
|
|
<?php echo generateOption('patient_category', 'patient_cat_name', 'patient_cat_id', '', ''); ?>
|
|
</select>
|
|
|
|
</div>
|
|
<div class="form-group" style="display:none" id="employee_div">
|
|
<input type="hidden" class="form-control" name="employee_ids" id="employee_ids" value=""
|
|
required />
|
|
<label for="role">Specific Employee</label>
|
|
|
|
<select multiple="" class="chosen-select form-control" id="employee_id" name="employee_id"
|
|
data-placeholder="Select Employee">
|
|
<option value=""></option>
|
|
<?php echo generateOption2('patient_master', 'concat(patient_name," ",emp_code)', 'id', '', ''); ?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
<div class="form-group">
|
|
|
|
|
|
<label for="role">Training Schedule</label>
|
|
<select class="chosen-select form-control" id="schedule_id" name="schedule_id"
|
|
data-placeholder="Select Training Schedule">
|
|
<option value=""></option>
|
|
<?php $query = "select * from training_schedule where status='ACTIVE' ";
|
|
$result = @mysqli_query($conn, $query);
|
|
while ($rows_schedule = mysqli_fetch_assoc($result)) {
|
|
$training_name = getTableFieldValue('training_master', 'training_name', 'training_master_id', $rows_schedule['training_id']);
|
|
?> <option value="<?php echo $rows_schedule['schedule_id'] ?>">
|
|
<?php echo $training_name . '(' . $rows_schedule['trainer_name'] . ',' . date_format(date_create($rows_schedule['from_date']), "d-M-Y") . ' ' . date_format(date_create($rows_schedule['to_date']), "d-M-Y") . ')' ?>
|
|
</option><?php
|
|
}
|
|
?>
|
|
<?php //echo generateOption('training_schedule',"CONCAT(from_date,' ',to_date)",'schedule_id','','');
|
|
?>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
<label for="ailment">Assign Date(Training)</label>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="input-group">
|
|
<input class="form-control date-picker" name="assign_date" id="assign_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="form-group">
|
|
<label for="ailment">Training status</label>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="input-group">
|
|
<select class=" chosen-select form-control " name="training_status"
|
|
id="training_status">
|
|
<option value="active">Active</option>
|
|
<option value="inactive">Inactive</option>
|
|
<option value="complete">Complete</option>
|
|
</select>
|
|
|
|
</div>
|
|
</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>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|