first commit
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<small></small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<?php echo base_url()?>index.php/home"><i class="fa fa-dashboard"></i> Dashboard</a></li>
|
||||
<li>Setting</li>
|
||||
<li><a href="<?php echo base_url()?>index.php/hakakses">Hak Akses</a></li>
|
||||
<li class="active"><?php echo $title ?></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><?php echo $title ?> | <?php echo $tu->row('mt_nama');?> </h3>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<!-- form start -->
|
||||
<?php if(validation_errors()){ ?>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-ban"></i> Alert!</h4>
|
||||
<?php echo validation_errors() ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<form class="form-horizontal" id="form" action="<?php echo(base_url()); ?>index.php/ps_hakakses/prosesedithakakses" method="post">
|
||||
<?php //echo form_open_multipart('index.php/user/prosesedit');?>
|
||||
<div class="box-body form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="box">
|
||||
<div class="box-body no-padding">
|
||||
<input type="hidden" name="id" value="<?php echo $tu->row('mt_id');?>"/>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th width="55%">Menu</th>
|
||||
<th width="10%">Akses</th>
|
||||
<th width="10%">View</th>
|
||||
<th width="10%">Tambah</th>
|
||||
<th width="10%">Edit</th>
|
||||
<th width="10%">Delete</th>
|
||||
</tr>
|
||||
<?php
|
||||
$no=0;
|
||||
//$id_input="";
|
||||
foreach ($mn as $menu) {
|
||||
$parentmenu="";
|
||||
//----cek parent menu----------------------------//
|
||||
$this->db->where('mm_id', $menu->mm_parent);
|
||||
$cekParent = $this->db->get('master_menu');
|
||||
foreach ($cekParent->result() as $par)
|
||||
{
|
||||
$parentmenu="<code>".$par->mm_nama." /</code> ";
|
||||
}
|
||||
//----cek parent menu----------------------------//
|
||||
|
||||
$no++;
|
||||
echo("
|
||||
<tr>
|
||||
<td>".$no."</td>
|
||||
<td><input type='hidden' name='id_menu' value='".$menu->mm_id."'>".$parentmenu.$menu->mm_nama."</td>
|
||||
");
|
||||
$cekakses="";
|
||||
$cekview="";
|
||||
$cektambah="";
|
||||
$cekedit="";
|
||||
$cekdelete="";
|
||||
$idusermenu="";
|
||||
$setdisabled="";
|
||||
foreach($um as $usermenu){
|
||||
if($usermenu->mum_menu_id==$menu->mm_id){
|
||||
$cekakses="checked";
|
||||
|
||||
$this->db->where('mum_id', $usermenu->mum_id);
|
||||
$query1 = $this->db->get('master_user_menu');
|
||||
foreach ($query1->result() as $row1)
|
||||
{
|
||||
if($row1->mum_lihat=="lihat"){
|
||||
$cekview="checked";
|
||||
}
|
||||
if($row1->mum_tambah=="tambah"){
|
||||
$cektambah="checked";
|
||||
}
|
||||
if($row1->mum_ubah=="ubah"){
|
||||
$cekedit="checked";
|
||||
}
|
||||
if($row1->mum_hapus=="hapus"){
|
||||
$cekdelete="checked";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($actionform=="prosesview"){
|
||||
$setdisabled="disabled=''";
|
||||
}
|
||||
if($menu->mm_action=='true'){
|
||||
echo ("
|
||||
<td><input type='checkbox'".$setdisabled." id='action".$no."' name='akses[]' class='flat-red'".$cekakses." value='".$tu->row('mt_id')."-".$menu->mm_id."'></td>
|
||||
<td><input type='checkbox'".$setdisabled." id='view".$no."' name='view[]' class='flat-red'".$cekview." value='".$menu->mm_id."' ></td>
|
||||
<td><input type='checkbox'".$setdisabled." id='tambah".$no."' name='tambah[]' class='flat-red'".$cektambah." value='".$menu->mm_id."' ></td>
|
||||
<td><input type='checkbox'".$setdisabled." id='edit".$no."' name='edit[]' class='flat-red'".$cekedit." value='".$menu->mm_id."'></td>
|
||||
<td><input type='checkbox'".$setdisabled." id='delete".$no."' name='delete[]' class='flat-red'".$cekdelete." value='".$menu->mm_id."'></td>
|
||||
</tr>
|
||||
");
|
||||
|
||||
}else{
|
||||
echo ("
|
||||
<td><input type='checkbox'".$setdisabled." id='action".$no."' name='akses[]' class='flat-red'".$cekakses." value='".$tu->row('mt_id')."-".$menu->mm_id."'></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<a href="<?php echo base_url();?>index.php/ps_hakakses" class="btn btn-default">Cancel</a>
|
||||
<?php if ($actionform!="prosesview"){ ?>
|
||||
<button type="submit" class="btn btn-warning">Submit</button>
|
||||
<?php } ?>
|
||||
</div><!-- /.box-footer -->
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</section>
|
||||
@@ -0,0 +1,62 @@
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<small></small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<?php echo base_url()?>index.php"><i class="fa fa-dashboard"></i> Dashboard</a></li>
|
||||
<li>Setting</li>
|
||||
<li><a href="<?php echo base_url()?>index.php/hakakses">Hak Akses</a></li>
|
||||
<li class="active"><?php echo $title;?></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><?php echo $title; ?></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<?php if(validation_errors()){ ?>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-ban"></i> Alert!</h4>
|
||||
<?php echo validation_errors() ?>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
$setdisabled="";
|
||||
$setidedit="";
|
||||
$setnameedit="";
|
||||
if ($actionform=="prosesview"){
|
||||
$setdisabled="disabled=''";
|
||||
}
|
||||
if ($actionform!="prosesadd"){
|
||||
$setidedit=$ha->row('mt_id');
|
||||
$setnameedit=$ha->row('mt_nama');
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="form-horizontal" id="form" action="<?php echo(base_url()); ?>index.php/ps_hakakses/<?php echo $actionform; ?>" method="post">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="namatipeuser" class="col-sm-2 control-label">Nama Tipe User</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="hidden" name="id" value="<?php echo $setidedit;?>"/>
|
||||
<input id="namatipeuser" class="form-control" <?php echo $setdisabled; ?> name="namatipeuser" type="text" placeholder="Masukan Nama Tipe User" autocomplete="off" value="<?php echo $setnameedit;?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a href="<?php echo base_url();?>index.php/ps_hakakses" class="btn btn-default">Cancel</a>
|
||||
<?php if ($actionform!="prosesview"){ ?>
|
||||
<button type="submit" class="btn btn-warning">Submit</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,95 @@
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<?php
|
||||
//---------------------start check access action TAMBAH-------------------//
|
||||
if(!empty($this->vartambah)){ echo "<small> <a href='".base_url()."index.php/ps_hakakses/add' class='btn btn-block btn-primary btn-sm'>Tambah Baru</a> </small>";
|
||||
}else{ echo "<small></small>";}
|
||||
//---------------------end check access action TAMBAH-------------------//
|
||||
?>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<?php echo base_url()?>index.php"><i class="fa fa-dashboard"></i> Dashboard</a></li>
|
||||
<li>Setting</li>
|
||||
<li class="active"><?php echo $title ?></li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><?php echo $title ?></h3>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<?php if($this->session->flashdata('message')){?>
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4> <i class="icon fa fa-check"></i> Alert!</h4>
|
||||
<?php echo $this->session->flashdata('message');?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table id="example1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th>Nama Tipe User</th>
|
||||
<th width="25%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$no=0;
|
||||
foreach ($ha as $tipeuser) {
|
||||
$no++;
|
||||
//---------------------start check access action-------------------//
|
||||
$editbutton="";
|
||||
$edithakakses="";
|
||||
$deletebutton="";
|
||||
$viewbutton="";
|
||||
if(!empty($this->varedit)){
|
||||
$editbutton="<a href='".base_url()."index.php/ps_hakakses/edit/".$tipeuser->mt_id."' class='btn btn-warning btn-xs'><i class='fa fa-edit'></i> Edit</a> ";
|
||||
}
|
||||
if(!empty($this->varedit)){
|
||||
$edithakakses="<a href='".base_url()."index.php/ps_hakakses/edithakakses/".$tipeuser->mt_id."' class='btn btn-success btn-xs'><i class='fa fa-gear'></i> Hak Akses</a> ";
|
||||
}
|
||||
if(!empty($this->vardelete)){
|
||||
$deletebutton="<a onclick='del(".$tipeuser->mt_id.")' class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> Delete</a><input type='hidden' id='isi".$tipeuser->mt_id."' value='".$tipeuser->mt_nama."'> ";
|
||||
}
|
||||
if(!empty($this->varview)){
|
||||
$viewbutton="<a href='".base_url()."index.php/ps_hakakses/view/".$tipeuser->mt_id."' class='btn btn-primary btn-xs'><i class='fa fa-eye'></i> View</a> ";
|
||||
}
|
||||
//---------------------end check access action-------------------//
|
||||
echo("
|
||||
<tr>
|
||||
<td>".$no."</td>
|
||||
<td>".$tipeuser->mt_nama."</td>
|
||||
<td>".$viewbutton.$editbutton.$deletebutton.$edithakakses."</td>
|
||||
</tr>
|
||||
");
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</section>
|
||||
<div class="control-sidebar-bg"></div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
var url="<?php echo base_url();?>";
|
||||
function del(id){
|
||||
var isi=document.getElementById('isi'+id).value;
|
||||
var r=confirm("Apakah anda ingin menghapus tipe user "+isi+"?")
|
||||
if (r==true)
|
||||
window.location = url+"index.php/ps_hakakses/delete/"+id;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user