File: /home/dmstechonline/crm.chaitanyahospitalvirar.com/application/views/admin/staff/designation.php
<style type="text/css">
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-2">
<div class="box border0">
<ul class="tablists">
<?php if ($this->rbac->hasPrivilege('leave_types', 'can_view')) { ?>
<li><a href="<?php echo base_url(); ?>admin/leavetypes" ><?php echo $this->lang->line('leave_type'); ?></a></li>
<?php } if ($this->rbac->hasPrivilege('department', 'can_view')) { ?>
<li><a href="<?php echo base_url(); ?>admin/department"><?php echo $this->lang->line('department'); ?></a></li>
<?php } if ($this->rbac->hasPrivilege('designation', 'can_view')) { ?>
<li><a href="<?php echo base_url(); ?>admin/designation/designation" class="active"><?php echo $this->lang->line('designation'); ?></a></li>
<?php } ?>
<?php if ($this->rbac->hasPrivilege('specialist', 'can_view')) { ?>
<li><a href="<?php echo base_url(); ?>admin/specialist"><?php echo $this->lang->line('specialist'); ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="col-md-10">
<div class="box box-primary" id="tachelist">
<div class="box-header ptbnull">
<h3 class="box-title titlefix"><?php echo $this->lang->line('designation_list'); ?></h3>
<div class="box-tools pull-right">
<?php if ($this->rbac->hasPrivilege('designation', 'can_add')) { ?>
<a data-toggle="modal" data-target="#myModal" class="btn btn-primary btn-sm designation"><i class="fa fa-plus"></i> <?php echo $this->lang->line('add_designation'); ?></a>
<?php } ?>
</div>
</div>
<div class="box-body">
<div class="mailbox-controls">
</div>
<div class="table-responsive mailbox-messages overflow-visible">
<div class="download_label"><?php echo $this->lang->line('designation_list'); ?></div>
<table class="table table-striped table-bordered table-hover ajaxlist">
<thead>
<tr>
<th><?php echo $this->lang->line('designation'); ?></th>
<th class="text-right no-print noExport"><?php echo $this->lang->line('action'); ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="mailbox-controls"></div>
</div>
</div>
</div>
</section>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-mid" role="document">
<div class="modal-content modal-media-content mx-2">
<div class="modal-header modal-media-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $this->lang->line('add_designation'); ?></h4>
</div>
<form id="formadd" action="<?php echo site_url('admin/designation/add') ?>" name="employeeform" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div class="modal-body pt0 pb0">
<div class="ptt10">
<div class="form-group">
<label for="exampleInputEmail1"><?php echo $this->lang->line('name'); ?></label><small class="req"> *</small>
<input autofocus="" id="type" name="type" placeholder="" type="text" class="form-control" value="<?php
if (isset($result)) {
echo $result["designation"];
}
?>" />
<span class="text-danger"><?php echo form_error('type'); ?></span>
<input autofocus="" id="type" name="designationid" placeholder="" type="hidden" class="form-control" value="<?php
if (isset($result)) {
echo $result["id"];
}
?>" />
</div>
</div>
</div><!--./modal-->
<div class="modal-footer">
<button type="submit" data-loading-text="<?php echo $this->lang->line('processing'); ?>" id="formaddbtn" class="btn btn-info pull-right"><i class="fa fa-check-circle"></i> <?php echo $this->lang->line('save'); ?></button>
</div>
</form>
</div><!--./row-->
</div>
</div>
<div class="modal fade" id="editmyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-mid" role="document">
<div class="modal-content modal-media-content mx-2">
<div class="modal-header modal-media-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo $this->lang->line('edit_designation'); ?></h4>
</div>
<form id="editformadd" action="<?php echo site_url('admin/designation/edit') ?>" id="employeeform" name="employeeform" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div class="modal-body pt0 pb0">
<div class="ptt10">
<div class="form-group">
<label for="exampleInputEmail1"><?php echo $this->lang->line('name'); ?></label><small class="req"> *</small>
<input autofocus="" id="type1" name="type" placeholder="" type="text" class="form-control" />
<span class="text-danger"><?php echo form_error('type'); ?></span>
<input autofocus="" id="degi_id" name="designationid" placeholder="" type="hidden" class="form-control" />
</div>
</div>
</div><!--./modal-->
<div class="modal-footer">
<button type="submit" data-loading-text="<?php echo $this->lang->line('processing'); ?>" id="editformaddbtn" class="btn btn-info pull-right"><i class="fa fa-check-circle"></i> <?php echo $this->lang->line('save'); ?></button>
</div>
</form>
</div><!--./row-->
</div>
</div>
<!-- //========datatable start===== -->
<script type="text/javascript">
( function ( $ ) {
'use strict';
$(document).ready(function () {
initDatatable('ajaxlist','admin/designation/getdesignationdatatable');
});
} ( jQuery ) )
</script>
<!-- //========datatable end===== -->
<script>
$(document).ready(function (e) {
$('#formadd').on('submit', (function (e) {
$("#formaddbtn").button('loading');
e.preventDefault();
$.ajax({
url: $(this).attr('action'),
type: "POST",
data: new FormData(this),
dataType: 'json',
contentType: false,
cache: false,
processData: false,
success: function (data) {
if (data.status == "fail") {
var message = "";
$.each(data.error, function (index, value) {
message += value;
});
errorMsg(message);
} else {
successMsg(data.message);
window.location.reload(true);
}
$("#formaddbtn").button('reset');
},
error: function () {
}
});
}));
});
function get(id) {
$('#editmyModal').modal('show');
$.ajax({
dataType: 'json',
url: '<?php echo base_url(); ?>admin/designation/get_data/' + id,
success: function (result) {
$('#degi_id').val(result.id);
$('#type1').val(result.designation);
}
});
}
$(document).ready(function (e) {
$('#editformadd').on('submit', (function (e) {
$("#editformaddbtn").button('loading');
e.preventDefault();
$.ajax({
url: $(this).attr('action'),
type: "POST",
data: new FormData(this),
dataType: 'json',
contentType: false,
cache: false,
processData: false,
success: function (data) {
if (data.status == "fail") {
var message = "";
$.each(data.error, function (index, value) {
message += value;
});
errorMsg(message);
} else {
successMsg(data.message);
window.location.reload(true);
}
$("#editformaddbtn").button('reset');
},
error: function () {
}
});
}));
});
function deleterecord(id)
{
delete_recordById('admin/designation/designationdelete/' + id, '<?php echo $this->lang->line('delete_confirm') ?>');
}
$(".designation").click(function(){
$('#formadd').trigger("reset");
});
$(document).ready(function (e) {
$('#myModal,#editmyModal').modal({
backdrop: 'static',
keyboard: false,
show:false
});
});
</script>