policybot/application/views/admin/role/list.php

137 lines
4.4 KiB
PHP
Raw Normal View History

2021-11-30 10:56:55 +00:00
<?php $this->load->view('admin/includes/header');?>
<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">Role 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="#">Role</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Role List</li>
</ol>
</div>
</div>
<?php $this->load->view('admin/includes/msg');?>
<div class="row">
<div class="col-md-8">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Role</header>
</div>
<div class="card-body ">
<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> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($role)&& $role->num_rows()>0)
{
$i=1;
foreach($role->result() as $r)
{
$roleid=$r->id;
$rolename=$r->name;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=ucwords($rolename);?></td>
<td>
<a class="btn btn-primary btn-xs roleeditpop" data-id="<?=$roleid;?>" data-type="1"> <!--data-type="1" for edit-->
<i class="fa fa-pencil"></i>
</a>
<a class="btn btn-danger btn-xs roleeditpop" data-id="<?=$roleid;?>" data-type="2"> <!--data-type="2" for delete-->
<i class="fa fa-trash-o "></i>
</a>
</td>
</tr>
<?php $i++;} } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--add-->
<div class="col-md-4">
<div class="card card-topline-orange">
<div class="white-box">
<div class="card card-box">
<div class="card-head">
<header>Add Role</header>
</div>
<div class="card-body ">
<form action="<?=base_url();?>role/add_role" method="post">
<div class="form-group">
<label for="simpleFormEmail"> Name</label>
<input type="text" name="rolename" autocomplete="off" class="form-control" data-validation="required" placeholder="Role Name">
</div>
<input type="submit" name="role" class="btn btn-primary" value="Submit">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--modal -->
<div class="modal fade" id="rolepop" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="viewdetails">
<img src="<?=base_url();?>bassets/admin/img/process.gif" class="loader-img">
</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');
//Common View Edit Specification
$('body').on('click','.roleeditpop',function(){
//alert("sdadsd");
$('#rolepop').modal('show');
$('.viewdetails').html('<img src='+base_path+'bassets/admin/img/process.gif class="loader-img">');
var type=$(this).attr('data-type');
var id=$(this).attr('data-id');
var url22=base_path+"role/roleaction";
$.post(url22,{type:type,id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
$('.viewdetails').html(result);
});
});
</script>