add rssa-pintar to git
This commit is contained in:
No files matched your search
@@ -0,0 +1,197 @@
|
||||
<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>Master</li>
|
||||
<li><a href="<?php echo base_url()?>index.php/ps_laboratorium">Laboratorium</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($this->session->flashdata('message')){?>
|
||||
<div id="mydivs" 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>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
$('#mydivs').hide('fast');
|
||||
}, 5000);
|
||||
</script>
|
||||
<?php }?>
|
||||
<?php if(validation_errors()){ ?>
|
||||
<div id="mydivs" 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>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
$('#mydivs').hide('fast');
|
||||
}, 5000);
|
||||
</script>
|
||||
<?php }
|
||||
|
||||
$setdisabled ="";
|
||||
$setidedit ="";
|
||||
$setnama ="";
|
||||
$setketerangan ="";
|
||||
|
||||
|
||||
$setstatus =1;
|
||||
|
||||
if ($actionform=="prosesview"){
|
||||
$setdisabled="disabled=''";
|
||||
}
|
||||
if ($actionform!="prosesadd"){
|
||||
$setidedit =$la->row('ml_id');
|
||||
$setnama =$la->row('ml_nama');
|
||||
$setketerangan =$la->row('ml_keterangan');
|
||||
|
||||
$setstatus =$la->row('ml_status');
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="form-horizontal" id="form" action="<?php echo(base_url()); ?>index.php/ps_laboratorium/<?php echo $actionform; ?>" method="post" autocomplete="off">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="nama" class="col-sm-2 control-label">Nama</label>
|
||||
<div class="col-sm-5">
|
||||
<input class="form-control" <?php echo $setdisabled; ?> name="nama" type="text" placeholder="Masukan Nama Pemeriksaan" autocomplete="off" value="<?php echo $setnama;?>" style="text-transform:uppercase"/>
|
||||
<input type="hidden" name="id" value="<?php echo $setidedit;?>"/>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<textarea name="keterangan" class="form-control" <?php echo $setdisabled; ?> placeholder="Masukan Keterangan Pemeriksaan"><?php echo $setketerangan;?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Detail</label>
|
||||
<div class="col-sm-10">
|
||||
<table class="table table-bordered table-striped">
|
||||
<input type="hidden" id="num" value="1" />
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama</th>
|
||||
<th>Keterangan</th>
|
||||
<th>Status</th>
|
||||
<th style="width: 15%;">
|
||||
<?php if ($actionform!="prosesview"){?>
|
||||
<a href="#" onclick="add()" class="btn btn-success btn-sm pull-right "><i class="fa fa-plus"></i> Tambah Detail</a>
|
||||
<?php }?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="appendhere">
|
||||
<?php
|
||||
if ($actionform!="prosesadd"){
|
||||
foreach ($lad as $data) {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<input class="form-control" <?php echo $setdisabled; ?> name="detail[]" type="text" placeholder="Detail Pemeriksaan Laborat" autocomplete="off" value="<?php echo $data->mld_nama;?>"/>
|
||||
<input type="hidden" name="iddetail[]" value="<?php echo $data->mld_id;?>"/>
|
||||
<input type="hidden" name="baru[]" value="2"/>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="ket[]" class="form-control" <?php echo $setdisabled; ?> placeholder="Keterangan Pemeriksaan Laborat"><?php echo $data->mld_keterangan;?></textarea>
|
||||
</td>
|
||||
<td>
|
||||
<select name="statusdetail[]" class="form-control select" <?php echo $setdisabled; ?>>
|
||||
<option <?php if($data->mld_status==1){echo $select="selected='selected'";}?> value="1">Active</option>
|
||||
<option <?php if($data->mld_status==0){echo $select="selected='selected'";}?> value="0">Disabled</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($actionform!="prosesview"){?>
|
||||
<a href="#" onclick="delmld(<?php echo $data->mld_id.",".$data->mld_ml_id; ?>)" class="btn btn-danger btn-sm pull-right"><i class="fa fa-remove"></i> Hapus</a>
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<script>
|
||||
function add(){
|
||||
var num=document.getElementById('num').value;
|
||||
$("#appendhere").append(""+
|
||||
"<tr id='del"+num+"'>"+
|
||||
"<td>"+
|
||||
"<input class='form-control' name='detail[]' type='text' placeholder='Detail Pemeriksaan Laborat' value=''/>"+
|
||||
"<input type='hidden' name='baru[]' value='1'/>"+
|
||||
"</td>"+
|
||||
"<td>"+
|
||||
"<textarea name='ket[]' class='form-control' placeholder='Keterangan Pemeriksaan Laborat'></textarea>"+
|
||||
"</td>"+
|
||||
"<td>"+
|
||||
"<select name='statusdetail[]' class='form-control select' >"+
|
||||
"<option value='1'>Active</option>"+
|
||||
"<option value='0'>Disabled</option>"+
|
||||
"</select>"+
|
||||
"</td>"+
|
||||
"<td>"+
|
||||
"<a href='#' onclick='del("+num+")' class='btn btn-danger btn-sm pull-right '><i class='fa fa-remove'></i> Hapus</a>"+
|
||||
"</td>"+
|
||||
"</tr>");
|
||||
|
||||
document.getElementById('num').value=parseInt(num)+1;
|
||||
}
|
||||
|
||||
function del(x){
|
||||
$('#del'+x).remove();
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a href="<?php echo base_url();?>index.php/ps_laboratorium" class="btn btn-default">Cancel</a>
|
||||
<?php if ($actionform!="prosesview"){ ?>
|
||||
<button type="submit" class="btn btn-warning">Submit</button>
|
||||
<?php }
|
||||
if ($actionform!="prosesview" && $actionform!="prosesadd"){
|
||||
if(!empty($this->vardelete)){
|
||||
echo "<a onclick='del(".$setidedit.")' class='btn btn-danger pull-right'>Delete</a><input type='hidden' id='isi".$setidedit."' value='".$setnama."'> ";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
var url="<?php echo base_url();?>";
|
||||
function del(id){
|
||||
var r=confirm("Apakah anda ingin menghapus Pemeriksaan ini?")
|
||||
if (r==true)
|
||||
window.location = url+"index.php/ps_laboratorium/delete/"+id;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function delmld(id,mlid){
|
||||
var r=confirm("Apakah anda ingin menghapus Pemeriksaan Detail ini?")
|
||||
if (r==true)
|
||||
window.location = url+"index.php/ps_laboratorium/deletedetail/"+id+"/"+mlid;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,130 @@
|
||||
<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_laboratorium/add' class='btn btn-block bg-blue 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>Master</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 box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title info-box-number"><?php echo $title ?></h3>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<?php if($this->session->flashdata('message')){?>
|
||||
<div id="mydivs" 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>
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
$('#mydivs').hide('fast');
|
||||
}, 5000);
|
||||
</script>
|
||||
<?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</th>
|
||||
<th>Detail</th>
|
||||
<th>Status</th>
|
||||
<th width="15%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$no=0;
|
||||
foreach ($la as $laboratorium) {
|
||||
$no++;
|
||||
//---------------------start check access action-------------------//
|
||||
$editbutton ="";
|
||||
$viewbutton ="";
|
||||
$disabledbutton ="";
|
||||
$aktifbutton ="";
|
||||
|
||||
if(!empty($this->varedit)){
|
||||
$editbutton="<a href='".base_url()."index.php/ps_laboratorium/edit/".$laboratorium->ml_id."' class='btn btn-warning btn-xs'><i class='fa fa-edit'></i> Edit</a> ";
|
||||
}
|
||||
if(!empty($this->varview)){
|
||||
$viewbutton="<a href='".base_url()."index.php/ps_laboratorium/view/".$laboratorium->ml_id."' class='btn btn-primary btn-xs'><i class='fa fa-eye'></i> View</a> ";
|
||||
}
|
||||
|
||||
$setstatus = "<span class='badge bg-green'> Active</span>";
|
||||
if($laboratorium->ml_status==0){
|
||||
$setstatus = "<span class='badge bg-red'> Disabled</span>";
|
||||
if(!empty($this->varedit)){
|
||||
$aktifbutton="<a onclick='aktif(".$laboratorium->ml_id.")' class='btn btn-success btn-xs'><i class='fa fa-check-square-o'></i> On</a><input type='hidden' id='isi".$laboratorium->ml_id."' value='".$laboratorium->ml_nama."'> ";
|
||||
}
|
||||
}else{
|
||||
if(!empty($this->varedit)){
|
||||
$disabledbutton="<a onclick='disabled(".$laboratorium->ml_id.")' class='btn btn-danger btn-xs'><i class='fa fa-ban'></i> Off</a><input type='hidden' id='isi".$laboratorium->ml_id."' value='".$laboratorium->ml_nama."'> ";
|
||||
}
|
||||
}
|
||||
|
||||
$detail = "";
|
||||
|
||||
$this->db->where('mld_ml_id', $laboratorium->ml_id);
|
||||
$query = $this->db->get('master_laboratorium_detail')->result();
|
||||
foreach($query as $datdetail){
|
||||
$detail = $detail." "."<code>$datdetail->mld_nama</code> ";
|
||||
}
|
||||
|
||||
//---------------------end check access action-------------------//
|
||||
echo("
|
||||
<tr>
|
||||
<td>".$no."</td>
|
||||
<td>".$laboratorium->ml_nama."</td>
|
||||
<td>".$detail."</td>
|
||||
<td style='text-align: center;'>".$setstatus."</td>
|
||||
<td>".$viewbutton.$editbutton.$disabledbutton.$aktifbutton."</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 disabled(id){
|
||||
var isi=document.getElementById('isi'+id).value;
|
||||
var r=confirm("Apakah anda ingin disabled Pemeriksaan Laboratorium "+isi+"?")
|
||||
if (r==true)
|
||||
window.location = url+"index.php/ps_laboratorium/disabled/"+id;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function aktif(id){
|
||||
var isi=document.getElementById('isi'+id).value;
|
||||
var r=confirm("Apakah anda ingin aktifkan Pemeriksaan Laboratorium "+isi+"?")
|
||||
if (r==true)
|
||||
window.location = url+"index.php/ps_laboratorium/aktif/"+id;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user