139 lines
8.4 KiB
PHP
139 lines
8.4 KiB
PHP
<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_loket/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 Loket</th>
|
|
<th>Quota</th>
|
|
<th>Pelayanan</th>
|
|
<th>Pembayaran</th>
|
|
<th>Keterangan</th>
|
|
<th width="20%">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$no=0;
|
|
foreach ($ml as $masterloket) {
|
|
$no++;
|
|
//---------------------start check access action-------------------//
|
|
$editbutton="";
|
|
$edithakakses="";
|
|
$deletebutton="";
|
|
$viewbutton="";
|
|
|
|
$infoklinik="";
|
|
$infopembayaran="";
|
|
$infoonline="";
|
|
|
|
$pecahpel = explode(",",$masterloket->ml_pelayanan);
|
|
$jumrow = (count($pecahpel));
|
|
for($x=0;$x<=$jumrow;$x++){
|
|
if(isset($pecahpel[$x])){
|
|
$this->db->where('mk_id', $pecahpel[$x]);
|
|
$selectklinik = $this->db->get('master_klinik');
|
|
foreach ($selectklinik->result() as $datklin){
|
|
$infoklinik=$infoklinik."<code>".$datklin->mk_nama."</code> ";
|
|
}
|
|
}
|
|
}
|
|
|
|
if($masterloket->ml_pembayaran=="1"){$infopembayaran="<b>UMUM / DLL</b>";}
|
|
if($masterloket->ml_pembayaran=="2"){$infopembayaran="JKN";}
|
|
|
|
if($masterloket->ml_online=="1"){$infoonline="OFFLINE";}
|
|
if($masterloket->ml_online=="2"){$infoonline="<b>ONLINE</b>";}
|
|
|
|
if(!empty($this->varedit)){
|
|
$editbutton="<a href='".base_url()."index.php/ps_loket/edit/".$masterloket->ml_id."' class='btn btn-warning btn-xs'><i class='fa fa-edit'></i> Edit</a> ";
|
|
}
|
|
if(!empty($this->vardelete)){
|
|
$deletebutton="<a onclick='del(".$masterloket->ml_id.")' class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> Delete</a><input type='hidden' id='isi".$masterloket->ml_id."' value='".$masterloket->ml_nama."'> ";
|
|
}
|
|
if(!empty($this->varview)){
|
|
$viewbutton="<a href='".base_url()."index.php/ps_loket/view/".$masterloket->ml_id."' class='btn btn-primary btn-xs'><i class='fa fa-eye'></i> View</a> ";
|
|
}
|
|
//---------------------end check access action-------------------//
|
|
if($this->session->userdata('s_FK_TipeUser')=="3"){
|
|
if($this->session->userdata('s_loket')==$masterloket->ml_id){
|
|
echo("
|
|
<tr>
|
|
<td>".$no."</td>
|
|
<td>".$masterloket->ml_nama."</td>
|
|
<td>".$masterloket->ml_quota_bangku."</td>
|
|
<td>".$infoklinik."</td>
|
|
<td>".$infopembayaran."</td>
|
|
<td>".$infoonline."</td>
|
|
<td>".$viewbutton.$editbutton.$deletebutton.$edithakakses."</td>
|
|
</tr>
|
|
");
|
|
}
|
|
}else{
|
|
echo("
|
|
<tr>
|
|
<td>".$no."</td>
|
|
<td>".$masterloket->ml_nama."</td>
|
|
<td>".$masterloket->ml_quota_bangku."</td>
|
|
<td>".$infoklinik."</td>
|
|
<td>".$infopembayaran."</td>
|
|
<td>".$infoonline."</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 loket "+isi+"?")
|
|
if (r==true)
|
|
window.location = url+"index.php/ps_loket/delete/"+id;
|
|
else
|
|
return false;
|
|
}
|
|
</script>
|