ESH/form/add_department.php
2024-10-23 18:28:06 +05:30

81 lines
2.5 KiB
PHP

<script>
function validate(){
var department_id = $('#department_id').val();
if(department_id == '' || department_id==null){
BootstrapDialog.alert('Please Enter Bussiness Unit.!!!');
return false;
}
var department_name = $('#department_name').val();
if(department_name == ''){
BootstrapDialog.alert('Please Enter Department Name.!!!');
return false;
}
var emp_id = $('#emp_id').val();
if(emp_id == '' || emp_id==null){
BootstrapDialog.alert('Please Enter Business Unit Head.!!!');
return false;
}
save_department();
}
</script>
<style>
#modal-add-department{
overflow-y:scroll;
}
</style>
<div class="modal fade" id="modal-add-department" role="dialog" aria-hidden="true">
<form role="form" id="department_form" name="department_form" action="#" method="post">
<div class="modal-dialog">
<div class="modal-content">
<div class="widget-header">
<h5 class="widget-title">Department</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="user_role">Bussiness Unit</label>
<select autofocus="autofocus" class="form-control" name="department_id" id="department_id" >
<?php echo generateOption('tbl_firms','firm_name','firm_id',''); ?>
</select>
<input type="hidden" class="form-control" name="sbu_id"
id="sbu_id" value="" required/>
</div>
<div class="form-group">
<label for="user_lname">Department Name</label>
<input type="text" class="form-control" name="department_name"
id="department_name" placeholder="Enter Department Name" required/>
</div>
<div class="form-group">
<label for="landing_page">Business Unit Head</label>
<select class="form-control" name="emp_id" id="emp_id" >
<?php echo generateOption('employee','fname','id',''); ?>
</select>
</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>