policybot/application/views/admin/staff/list.php
2021-11-30 16:26:55 +05:30

243 lines
6.3 KiB
PHP

<link href="<?=base_url();?>bassets/jquery-tags-input/jquery-tags-input.css" rel="stylesheet">
<?php $this->load->view('admin/includes/header');?>
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.sliderrr {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e43a45;
-webkit-transition: .4s;
transition: .4s;
width: 50px;
height: 30px;
border-radius: 20px !important;
}
.sliderrr:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 0px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .sliderrr {
background-color: #26c281;
width: 50px;
height: 30px;
border-radius: 20px !important;
}
input:focus + .sliderrr {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .sliderrr:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.sliderrr.round {
border-radius: 34px;
}
.sliderrr.round:before {
border-radius: 50%;
}
</style>
<div class="page-container">
<?php $this->load->view('admin/includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Staff List</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li><a class="parent-item" href="#">Staff</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Staff List</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-12">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Staff</header>
</div>
<div class="card-body ">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6" style="float:left">
<div class="btn-group">
<a href="<?=base_url();?>admin/add-staff" id="addRow" class="btn btn-info">
Add New <i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="table-scrollable">
<table class="table table-hover table-checkable order-column full-width" id="example4">
<thead>
<tr>
<th>S no</th>
<th> Name </th>
<th> Role </th>
<th> Mobile </th>
<th> Email </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($staff)&& $staff->num_rows()>0)
{
$i=1;
foreach($staff->result() as $s)
{
$id=$s->id;
$name=$s->name;
$mobile=$s->mobile;
$rolename=$s->rolename;
$email=$s->email;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=ucwords($name);?></td>
<td><?=ucwords($rolename);?></td>
<td><?= ($mobile);?></td>
<td><?= ($email);?></td>
<td>
<a href="<?=base_url();?>admin/edit-staff/<?=$id;?>" class="btn btn-primary btn-xs " >
<i class="fa fa-pencil"></i>
</a>
<a class="btn btn-danger btn-xs deletestaff " >
<i class="fa fa-trash-o "></i>
</a>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="deleted" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<?=form_open_multipart(base_url().'admin/delete-staff/'.$id);?>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" >
<h4 class="col-md-12 modal-title" id="exampleModalLongTitle" style="text-align:center" >Delete Staff</h4>
</div>
<div class="modal-body" style="text-align:center">
<h4 style="color:red">Are you sure you want to delete this ?</h4>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" name="yes" value="YES">
<button type="button" class="btn dark btn-outline" data-dismiss="modal">No</button>
</div>
</div>
</div>
<?=form_close();?>
</div>
<?php $this->load->view('admin/includes/footer');?>
<script type="text/javascript" src="<?=base_url();?>bassets/admin/js/jquery.cookie.min.js"></script>
<script>
var base_path=$('body').attr('data-path');
$('input[type="checkbox"]').click(function(){
if($(this).prop("checked") == true){
var pri_id=$(this).attr("id");
var sep_id = pri_id.split('_');
var banner_id=sep_id[1];
var del_value="1";
var url23=base_path+"slider/check_uncheck_slider";
$.post(url23,{id:banner_id,val:del_value,csrf_test_name:$.cookie('csrf_cookie_name')},function(res23){
if(res23==1)
{
location.reload();
}
});
}
else if($(this).prop("checked") == false){
var pri_id=$(this).attr("id");
var sep_id = pri_id.split('_');
var banner_id=sep_id[1];
var del_value="0";
var url23=base_path+"slider/check_uncheck_slider";
$.post(url23,{id:banner_id,val:del_value,csrf_test_name:$.cookie('csrf_cookie_name')},function(res23){
if(res23==1)
{
location.reload();
}
});
}
});
</script>
<script>
$('body').on('click','.deletestaff',function(){
//alert("sdadsd");
$('#deleted').modal('show');
});
</script>