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

206 lines
5.1 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">Policy 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="#">Policy</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Policy 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>Policy</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-policy" 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> Company </th>
<th> Category </th>
<th> Image </th>
</tr>
</thead>
<tbody>
<?php
if(isset($pol)&& $pol->num_rows()>0)
{
$i=1;
foreach($pol->result() as $s)
{
$id=$s->id;
$name=$s->name;
$image=$s->image;
$catname=$s->catname;
$cmpname=$s->cmpname;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><a href="<?=base_url();?>admin/view-policy/<?=$id;?>"><?=ucwords($name);?></a></td>
<td><?=ucwords($cmpname);?></td>
<td><?=ucwords($catname);?></td>
<td><img src="<?=base_url();?>/<?=$image;?>" width="75px" height="75px"></td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</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>