haii sahabat blogger..
welcome back to Pio’s blog, sekarang saya akan menampilkan tutorial membuat template liquid laundy..
Pada template ini memiliki fungsionalitas yang banyak [ inspektasi ] tapi untuk saat ini masih belum semua bisa dimunculkan fungsionalitasnya..
mungkin beberapa bulan kedepan..
walaupun begitu, jangan berkecil hati.. karna meskipun inspektasi fungsionalitas belum terpenuhi, tapi kita sudah punya gambaran aplikasi ini bakalan bisa apa ..
sekarang kita mulai codingnya ya,
applications/controller/c_admin.php
<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
class c_admin extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model(‘m_admin’);
}
//DATA USER LOGIN
public function tambah_user(){
$data[‘content_view’]=”tambah_user.php”;
$this->load->view(‘home_admin’, $data);
}
public function simpan_user(){
$query= $this->m_admin->simpan_user();
redirect(‘c_admin/lihat_user’);
}
public function lihat_user(){
$this->load->database();
$jumlah_data = $this->m_admin->jumlah_data();
$this->load->library(‘pagination’);
$config[‘base_url’] = base_url().’c_admin/lihat_user/’;
$config[‘total_rows’] = $jumlah_data;
$config[‘per_page’] = 3;
$from = $this->uri->segment(3);
$this->pagination->initialize($config);
$data[‘user’] = $this->m_admin->data($config[‘per_page’],$from);
$data[‘content_view’]=”view_member.php”;
$this->load->view(‘home_admin’,$data);
}
public function tampilan_update_user(){
$data[‘content_view’]=”edit_user.php”;
$id_user=$this->uri->segment(3);
$data[‘list_data’]=$this->m_admin->get_user($id_user);
$this->load->view(‘home_admin’,$data);
}
public function ubah_user(){
$this->m_admin->update_user();
redirect(‘c_admin/lihat_user’);
}
public function hapus_user($id_user){
$this->db->where(‘id_user’, $id_user);
$this->db->delete(‘user’);
redirect(‘c_admin/lihat_user’);
}
//DATA MEMBER
public function view_pelanggan(){
$this->load->database();
$jumlah_data = $this->m_admin->jumlah_data_pelanggan();
$this->load->library(‘pagination’);
$config[‘base_url’] = base_url().’c_admin/view_pelanggan/’;
$config[‘total_rows’] = $jumlah_data;
$config[‘per_page’] = 3;
$from = $this->uri->segment(3);
$this->pagination->initialize($config);
$data[‘member’] = $this->m_admin->data_pelanggan($config[‘per_page’],$from);
$data[‘content_view’]=”view_pelanggang.php”;
$this->load->view(‘home_admin’,$data);
}
public function tambah_member(){
$data[‘content_view’]=”tambah_member.php”;
$this->load->view(‘home_admin’, $data);
}
public function simpan_member(){
$query= $this->m_admin->simpan_member();
redirect(‘c_admin/view_pelanggan’);
}
public function hapus_pelanggan($id_pelanggan){
$this->db->where(‘id_pelanggan’, $id_pelanggan);
$this->db->delete(‘pelanggan’);
redirect(‘c_admin/view_pelanggan’);
}
public function tampilan_update_pelanggan(){
$data[‘content_view’]=”edit_pelanggan.php”;
$id_pelanggan=$this->uri->segment(3);
$data[‘list_data’]=$this->m_admin->get_pelanggan($id_pelanggan);
$this->load->view(‘home_admin’,$data);
}
public function ubah_pelanggan(){
$this->m_admin->update_pelanggan();
redirect(‘c_admin/view_pelanggan’);
}
}
?>
application/controllers/c_login.php
<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
class C_login extends CI_Controller {
public function __construct(){
parent::__construct();
$this->load->model(‘m_login’);
$this->load->database();
}
public function index(){
$this->load->view(‘login.php’);
}
public function check(){
$login=$this->m_login->login();
if($login == true){
$data = array(
‘login’ => true,
‘username’ => $login->username,
‘status’ => $login->status
);
$this->session->set_userdata($data);
if($data[‘status’] == ‘admin’){
$this->session->userdata($data);
redirect(‘c_admin/lihat_user’);
}
else if($data[‘status’] == ‘member’){
$this->session->userdata($data);
redirect(‘c_member/view_laundry’);
}
}
else
{
$this->session->set_flashdata(‘Gagal’,’Username atau password salah’);
redirect(‘c_login/index’);
echo ‘gagal’;
}
}
public function logout()
{
$this->session->sess_destroy();
redirect(‘c_login’);
}
}
application/models/m_admin.php
<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
class M_admin extends CI_Model {
// public function simpan_data_kontrak_manajemen(){
// }
function data($number,$offset){
return $query = $this->db->get(‘user’,$number,$offset)->result();
}
function jumlah_data(){
return $this->db->get(‘user’)->num_rows();
}
public function simpan_user(){
$data = array(
‘username’=>$this->input->post(‘username’),
‘password’=>$this->input->post(‘password’),
‘status’=>$this->input->post(‘status’)
);
$data_pelanggang = array(
‘nama_pelanggang’=>$this->input->post(‘nama_member’),
‘jenis_kelamin’=>$this->input->post(‘jenis_kelamin’),
‘no_hp’=>$this->input->post(‘nohp’),
‘alamat’=>$this->input->post(‘alamat’)
);
$simpan_user=$this->db->insert(“user”, $data);
$simpan_pelanggan=$this->db->insert(“pelanggan”, $data_pelanggang);
return $simpan_user;
return $simpan_pelanggan;
}
public function get_user($id_user){
$query=$this->db->query(“select * from user where id_user = ‘$id_user'”);
$rows=$query->row();
return $query;
}
public function update_user(){
$id_user = $this->input->post(‘id_user’);
$username = $this->input->post(‘username’);
$password = $this->input->post(‘password’);
$status = $this->input->post(‘status’);
$query = $this->db->query(“update user set username=’$username’, password =’$password’, status = ‘$status’where id_user=’$id_user'”);
return $query;
}
/* DATA PELANGGAN */
function data_pelanggan($number,$offset){
return $query = $this->db->get(‘pelanggan’,$number,$offset)->result();
}
function jumlah_data_pelanggan(){
return $this->db->get(‘pelanggan’)->num_rows();
}
public function simpan_member(){
$data = array(
‘username’=>$this->input->post(‘username’),
‘password’=>$this->input->post(‘password’),
‘status’=>$this->input->post(‘status’)
);
$data_pelanggang = array(
‘nama_pelanggang’=>$this->input->post(‘nama_member’),
‘jenis_kelamin’=>$this->input->post(‘jenis_kelamin’),
‘no_hp’=>$this->input->post(‘nohp’),
‘alamat’=>$this->input->post(‘alamat’)
);
$simpan_user=$this->db->insert(“user”, $data);
$simpan_pelanggan=$this->db->insert(“pelanggan”, $data_pelanggang);
return $simpan_user;
return $simpan_pelanggan;
}
public function update_pelanggan(){
$id_pelanggan = $this->input->post(‘id_pelanggan’);
$nama_pelanggang = $this->input->post(‘nama_pelanggang’);
$jenis_kelamin = $this->input->post(‘jenis_kelamin’);
$no_hp = $this->input->post(‘no_hp’);
$alamat = $this->input->post(‘alamat’);
$query = $this->db->query(“update pelanggan set nama_pelanggang=’$nama_pelanggang’, jenis_kelamin =’$jenis_kelamin’, no_hp = ‘$no_hp’, alamat=’$alamat’ where id_pelanggan=’$id_pelanggan'”);
return $query;
}
public function get_pelanggan($id_pelanggan){
$query=$this->db->query(“select * from pelanggan where id_pelanggan = ‘$id_pelanggan'”);
$rows=$query->row();
return $query;
}
}
?>
application/models/m_login.php
<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
class m_login extends CI_Model {
public function __construct(){
parent::__construct();
}
public function login(){
//session_start();
$username = $this->input->post(‘username’);
$password = $this->input->post(‘password’);
$query = $this->db->query(“select * from user where username=’$username’ and password=’$password'”);
foreach($query->result() as $row) {
$status=$row->status;
}
if($query->num_rows() == 1){
$_SESSION[‘statusdosen’]=$status;
return $query->row();
} else {
return “”;
}
}
}
?>
application/views/edit_pelanggan.php
<form role=”form” action=”<?php echo base_url();?>c_admin/ubah_pelanggan” method=”POST” enctype=”multipart/form-data”> <!– Main content –>
<section class=”content”>
<!– Main row –>
<div class=”row”>
<!– Left col –>
<section class=”col-lg-12″>
<!– Chat box –>
<div class=”box”>
<div class=”box-header”>
<i class=”fa fa-plus”></i>
<h3 class=”box-title”>FORM UBAH DATA PELANGGAN</h3>
</div>
<div class=”box-body chat” id=”chat-box”>
<!– chat item –>
<?php foreach($list_data->result() as $row) {?>
<div class=”item”>
<div class=”col-lg-6″>
<div class=”form-group”>
<label for=”exampleInputNIP”>Id Pelanggan</label>
<input type=”text” class=”form-control” id=”idregister” name=”id_pelanggan” value=<?php echo $row->id_pelanggan;?> readonly>
</div>
<div class=”form-group”>
<label for=””>NAMA PELANGGAN</label>
<input type=”text” class=”form-control” value=<?php echo $row->nama_pelanggang;?> id=”nama_pelanggang” name=”nama_pelanggang”>
</div>
<div class=”form-group”>
<label for=””>Jenis Kelamin</label>
<input type=”text” class=”form-control” value=<?php echo $row->jenis_kelamin;?> id=”” name=”jenis_kelamin” >
</div>
<div class=”form-group”>
<label for=””>No HP</label>
<input type=”text” class=”form-control” value=<?php echo $row->no_hp;?> id=”” name=”no_hp” >
</div>
<div class=”form-group”>
<label for=””>Alamat</label>
<input type=”text” class=”form-control” value=<?php echo $row->alamat;?> id=”” name=”alamat” >
</div>
</div>
<?php } ?>
</div><!– /.item –>
<div class=”form-group”>
<button type=”submit” class=”btn btn-primary btn-block btn-flat”>Simpan</button>
<input type=”button” class=”btn btn-warning btn-block btn-flat” value=”Kembali” onClick=”history.go(-1);”/>
</div><!– /.col –>
</form>
</div><!– /.chat –>
</div><!– /.box (chat box) –>
</section><!– /.Left col –>
<!– right col (We are only adding the ID to make the widgets sortable)–>
<section class=”col-lg-5 connectedSortable”>
</section><!– right col –>
</div><!– /.row (main row) –>
</section><!– /.content –>
</form>
application/views/edit_user.php
<form role=”form” action=”<?php echo base_url();?>c_admin/ubah_user” method=”POST” enctype=”multipart/form-data”> <!– Main content –>
<section class=”content”>
<!– Main row –>
<div class=”row”>
<!– Left col –>
<section class=”col-lg-12″>
<!– Chat box –>
<div class=”box”>
<div class=”box-header”>
<i class=”fa fa-plus”></i>
<h3 class=”box-title”>FORM UBAH USER</h3>
</div>
<div class=”box-body chat” id=”chat-box”>
<!– chat item –>
<?php foreach($list_data->result() as $row) {?>
<div class=”item”>
<div class=”col-lg-6″>
<div class=”form-group”>
<label for=”exampleInputNIP”>Id User</label>
<input type=”text” class=”form-control” id=”idregister” name=”id_user” value=<?php echo $row->id_user;?> readonly>
</div>
<div class=”form-group”>
<label for=””>Username</label>
<input type=”text” class=”form-control” value=<?php echo $row->username;?> id=”” name=”username”>
</div>
<div class=”form-group”>
<label for=””>Password</label>
<input type=”text” class=”form-control” value=<?php echo $row->password;?> id=”” name=”password” >
</div>
<div class=”form-group”>
<label for=””>Status</label>
<select name=”status” class=”form-control” required>
<option selected=”selected”>–Pilih Status–</option>
<option value=”admin”>Admin</option>
<option value=”member”>Member</option>
</select>
</div>
</div>
<?php } ?>
</div><!– /.item –>
<div class=”form-group”>
<button type=”submit” class=”btn btn-primary btn-block btn-flat”>Simpan</button>
<input type=”button” class=”btn btn-warning btn-block btn-flat” value=”Kembali” onClick=”history.go(-1);”/>
</div><!– /.col –>
</form>
</div><!– /.chat –>
</div><!– /.box (chat box) –>
</section><!– /.Left col –>
<!– right col (We are only adding the ID to make the widgets sortable)–>
<section class=”col-lg-5 connectedSortable”>
</section><!– right col –>
</div><!– /.row (main row) –>
</section><!– /.content –>
</form>
application/views/home.php
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<title>LAUNDRY</title>
<!– Tell the browser to be responsive to screen width –>
<meta content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no” name=”viewport”>
<!– Bootstrap 3.3.6 –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/bootstrap/css/bootstrap.min.css”>
<!– Font Awesome –>
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css”>
<!– Ionicons –>
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css”>
<!– Theme style –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/dist/css/AdminLTE.min.css”>
<!– AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/dist/css/skins/_all-skins.min.css”>
<!– iCheck –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/iCheck/flat/blue.css”>
<!– Morris chart –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/morris/morris.css”>
<!– jvectormap –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-1.2.2.css”>
<!– Date Picker –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/datepicker/datepicker3.css”>
<!– Daterange picker –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/daterangepicker/daterangepicker.css”>
<!– bootstrap wysihtml5 – text editor –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css”>
<!– Boostrap table –>
<link href=”<?php echo base_url(); ?>assets/dist/datatables/dataTables.bootstrap.css” rel=”stylesheet” type=”text/css” />
<!– HTML5 Shim and Respond.js 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/html5shiv/3.7.3/html5shiv.min.js”></script>
<script src=”https://oss.maxcdn.com/respond/1.4.2/respond.min.js”></script>
<![endif]–>
</head>
<body class=”hold-transition skin-blue sidebar-mini”>
<div class=”wrapper”>
<header class=”main-header”>
<!– Logo –>
<a href=”index2.html” class=”logo”>
<!– mini logo for sidebar mini 50×50 pixels –>
<span class=”logo-mini”><b>TE</b>LU</span>
<!– logo for regular state and mobile devices –>
<span class=”logo-lg”><b>LAUNDRY </b>TEL-U</span>
</a>
<!– Header Navbar: style can be found in header.less –>
<nav class=”navbar navbar-static-top”>
<!– Sidebar toggle button–>
<a href=”#” class=”sidebar-toggle” data-toggle=”offcanvas” role=”button”>
<span class=”sr-only”>Toggle navigation</span>
</a>
<div class=”navbar-custom-menu”>
<ul class=”nav navbar-nav”>
<!– User Account: style can be found in dropdown.less –>
<li class=”dropdown user user-menu”>
<a href=”#” class=”dropdown-toggle” data-toggle=”dropdown”>
<img src=”<?php echo base_url();?>assets/dist/img/user2-160×160.jpg” class=”user-image” alt=”User Image”>
<span class=”hidden-xs”>PIO</span>
</a>
<ul class=”dropdown-menu”>
<!– User image –>
<li class=”user-header”>
<img src=”<?php echo base_url();?>assets/dist/img/user2-160×160.jpg” class=”img-circle” alt=”User Image”>
<p>
Web Developer
<small>Member since Nov. 2017</small>
</p>
</li>
<!– Menu Body –>
<li class=”user-body”>
<div class=”row”>
<div class=”col-xs-4 text-center”>
<a href=”#”>Followers</a>
</div>
<div class=”col-xs-4 text-center”>
<a href=”#”>Sales</a>
</div>
<div class=”col-xs-4 text-center”>
<a href=”#”>Friends</a>
</div>
</div>
<!– /.row –>
</li>
<!– Menu Footer–>
<li class=”user-footer”>
<div class=”pull-left”>
<a href=”#” class=”btn btn-default btn-flat”>Profile</a>
</div>
<div class=”pull-right”>
<a href=”#” class=”btn btn-default btn-flat”>Sign out</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!– Left side column. contains the logo and sidebar –>
<aside class=”main-sidebar”>
<!– sidebar: style can be found in sidebar.less –>
<section class=”sidebar”>
<!– Sidebar user panel –>
<div class=”user-panel”>
<div class=”pull-left image”>
<img src=”<?php echo base_url();?>assets/dist/img/user2-160×160.jpg” class=”img-circle” alt=”User Image”>
</div>
<div class=”pull-left info”>
<p>Alexander Pierce</p>
<a href=”#”><i class=”fa fa-circle text-success”></i> Online</a>
</div>
</div>
<!– search form –>
<form action=”#” method=”get” class=”sidebar-form”>
<div class=”input-group”>
<input type=”text” name=”q” class=”form-control” placeholder=”Search…”>
<span class=”input-group-btn”>
<button type=”submit” name=”search” id=”search-btn” class=”btn btn-flat”><i class=”fa fa-search”></i>
</button>
</span>
</div>
</form>
<!– /.search form –>
<!– sidebar menu: : style can be found in sidebar.less –>
<ul class=”sidebar-menu”>
<li class=”header”>MAIN MENU</li>
<li class=”active treeview”>
<a href=”#”>
<i class=”fa fa-dashboard”></i> <span>Dashboard</span>
</a>
</li>
<li class=”treeview”>
<a href=”#”>
<i class=”fa fa-files-o”></i>
<span>Pelanggang</span>
<span class=”pull-right-container”>
<i class=”fa fa-angle-left pull-right”></i>
</span>
</a>
<ul class=”treeview-menu”>
<li><a href=”pages/layout/top-nav.html”><i class=”fa fa-circle-o”></i> Tambah Pelanggang</a></li>
<li><a href=”pages/layout/boxed.html”><i class=”fa fa-circle-o”></i> Edit Pelanggang</a></li>
<li><a href=”pages/layout/fixed.html”><i class=”fa fa-circle-o”></i> Hapus Pelanggan</a></li>
<li><a href=”<?php base_url();?>view_member”><i class=”fa fa-circle-o”></i> View Pelanggan</a></li>
</ul>
</li>
<li>
<a href=”pages/widgets.html”>
<i class=”fa fa-th”></i> <span>Laundry</span>
</a>
</li>
</ul>
</section>
<!– /.sidebar –>
</aside>
<!– Content Wrapper. Contains page content –>
<div class=”content-wrapper”>
<!– Content Header (Page header) ISI–>
<?php $this->load->view($content_view)?>
</div>
<!– /.content-wrapper –>
<footer class=”main-footer”>
<div class=”pull-right hidden-xs”>
<b>Telkom University</b> Bandung
</div>
<strong>PIO © 2016-2017 <a href=”http://almsaeedstudio.com”>D3 Manajemen Informatika</a></strong>
</footer>
<!– Add the sidebar’s background. This div must be placed
immediately after the control sidebar –>
<div class=”control-sidebar-bg”></div>
</div>
<!– ./wrapper –>
<!– jQuery 2.2.3 –>
<script src=”<?php echo base_url();?>assets/plugins/jQuery/jquery-2.2.3.min.js”></script>
<!– jQuery UI 1.11.4 –>
<script src=”https://code.jquery.com/ui/1.11.4/jquery-ui.min.js”></script>
<!– Resolve conflict in jQuery UI tooltip with Bootstrap tooltip –>
<script>
$.widget.bridge(‘uibutton’, $.ui.button);
</script>
<!– Bootstrap 3.3.6 –>
<script src=”<?php echo base_url();?>assets/bootstrap/js/bootstrap.min.js”></script>
<!– Morris.js charts –>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/morris/morris.min.js”></script>
<!– Sparkline –>
<script src=”<?php echo base_url();?>assets/plugins/sparkline/jquery.sparkline.min.js”></script>
<!– jvectormap –>
<script src=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-world-mill-en.js”></script>
<!– jQuery Knob Chart –>
<script src=”<?php echo base_url();?>assets/plugins/knob/jquery.knob.js”></script>
<!– daterangepicker –>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/daterangepicker/daterangepicker.js”></script>
<!– datepicker –>
<script src=”<?php echo base_url();?>assets/plugins/datepicker/bootstrap-datepicker.js”></script>
<!– Bootstrap WYSIHTML5 –>
<script src=”<?php echo base_url();?>assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js”></script>
<!– Slimscroll –>
<script src=”<?php echo base_url();?>assets/plugins/slimScroll/jquery.slimscroll.min.js”></script>
<!– FastClick –>
<script src=”<?php echo base_url();?>assets/plugins/fastclick/fastclick.js”></script>
<!– AdminLTE App –>
<script src=”<?php echo base_url();?>assets/dist/js/app.min.js”></script>
<!– AdminLTE dashboard demo (This is only for demo purposes) –>
<script src=”<?php echo base_url();?>assets/dist/js/pages/dashboard.js”></script>
<!– AdminLTE for demo purposes –>
<script src=”<?php echo base_url();?>assets/dist/js/demo.js”></script>
<script src=”<?php echo base_url(); ?>assets/dist/datatables/jquery.dataTables.js” type=”text/javascript”></script>
<script src=”<?php echo base_url(); ?>assets/dist/datatables/dataTables.bootstrap.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(function() {
$(“#example1”).dataTable();
$(‘#example2’).dataTable({
“bPaginate”: true,
“bLengthChange”: false,
“bFilter”: true,
“bSort”: true,
“bInfo”: true,
“bAutoWidth”: false
});
});
//waktu flash data :v
$(function(){
$(‘#pesan-flash’).delay(4000).fadeOut();
$(‘#pesan-error-flash’).delay(5000).fadeOut();
});
//iCheck for checkbox and radio inputs
$(‘input[type=”checkbox”].minimal, input[type=”radio”].minimal’).iCheck({
checkboxClass: ‘icheckbox_minimal-blue’,
radioClass: ‘iradio_minimal-blue’
});
//Red color scheme for iCheck
$(‘input[type=”checkbox”].minimal-red, input[type=”radio”].minimal-red’).iCheck({
checkboxClass: ‘icheckbox_minimal-red’,
radioClass: ‘iradio_minimal-red’
});
//Flat red color scheme for iCheck
$(‘input[type=”checkbox”].flat-red, input[type=”radio”].flat-red’).iCheck({
checkboxClass: ‘icheckbox_flat-green’,
radioClass: ‘iradio_flat-green’
});
</script>
</body>
</html>
application/views/home_admin.php
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<title>LIQUID LAUNDRY</title>
<!– Tell the browser to be responsive to screen width –>
<meta content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no” name=”viewport”>
<!– Bootstrap 3.3.6 –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/bootstrap/css/bootstrap.min.css”>
<!– Font Awesome –>
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css”>
<!– Ionicons –>
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css”>
<!– Theme style –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/dist/css/AdminLTE.min.css”>
<!– AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/dist/css/skins/_all-skins.min.css”>
<!– iCheck –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/iCheck/all.css”>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/iCheck/flat/blue.css”>
<!– Morris chart –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/morris/morris.css”>
<!– jvectormap –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-1.2.2.css”>
<!– Date Picker –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/datepicker/datepicker3.css”>
<!– Daterange picker –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/daterangepicker/daterangepicker.css”>
<!– bootstrap wysihtml5 – text editor –>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css”>
<!– Boostrap table –>
<link href=”<?php echo base_url(); ?>assets/dist/datatables/dataTables.bootstrap.css” rel=”stylesheet” type=”text/css” />
<!– HTML5 Shim and Respond.js 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/html5shiv/3.7.3/html5shiv.min.js”></script>
<script src=”https://oss.maxcdn.com/respond/1.4.2/respond.min.js”></script>
<![endif]–>
</head>
<body class=”hold-transition skin-blue sidebar-mini”>
<div class=”wrapper”>
<header class=”main-header”>
<!– Logo –>
<a href=”index2.html” class=”logo”>
<!– logo for regular state and mobile devices –>
<span class=”logo-lg”><b>ADMIN</b>PORTAL</span>
</a>
<!– Header Navbar: style can be found in header.less –>
<nav class=”navbar navbar-static-top”>
<!– Sidebar toggle button–>
<a href=”#” class=”sidebar-toggle” data-toggle=”offcanvas” role=”button”>
<span class=”sr-only”>Toggle navigation</span>
</a>
<div class=”navbar-custom-menu”>
<ul class=”nav navbar-nav”>
<!– User Account: style can be found in dropdown.less –>
<li class=”dropdown user user-menu”>
<a href=”#” class=”dropdown-toggle” data-toggle=”dropdown”>
<img src=”<?php echo base_url();?>assets/dist/img/avatar2.png” class=”user-image” alt=”User Image”>
<span class=”hidden-xs”><?php echo $this->session->userdata(‘username’); ?></span>
</a>
<ul class=”dropdown-menu”>
<!– User image –>
<li class=”user-header”>
<img src=”<?php echo base_url();?>assets/dist/img/avatar2.png” class=”img-circle” alt=”User Image”>
<p>
<?php echo $this->session->userdata(‘username’); ?>
</p>
</li>
<!– Menu Footer–>
<li class=”user-footer”>
<div class=”pull-left”>
<a href=”#” class=”btn btn-default btn-flat”>Profile</a>
</div>
<div class=”pull-right”>
<a href=”<?php echo site_url(‘c_login/logout’)?>” class=”btn btn-default btn-flat”>Sign out</a>
</div>
</li>
</ul>
</li>
<!– Control Sidebar Toggle Button –>
</ul>
</div>
</nav>
</header>
<!– Left side column. contains the logo and sidebar –>
<aside class=”main-sidebar”>
<!– sidebar: style can be found in sidebar.less –>
<section class=”sidebar”>
<!– Sidebar user panel –>
<div class=”user-panel”>
<div class=”pull-left image”>
<img src=”<?php echo base_url();?>assets/dist/img/avatar2.png” class=”img-circle” alt=”User Image”>
</div>
<div class=”pull-left info”>
<p><?php echo $this->session->userdata(‘username’); ?></p>
<a href=”#”><i class=”fa fa-circle text-success”></i> Online</a>
</div>
</div>
<!– sidebar menu: : style can be found in sidebar.less –>
<ul class=”sidebar-menu”>
<li class=”header”>MAIN MENU</li>
<li class=”active treeview”>
<a href=”#”>
<i class=”fa fa-dashboard”></i> <span>Dashboard</span>
<span class=”pull-right-container”>
<i class=”fa fa-angle-left pull-right”></i>
</span>
</a>
<ul class=”treeview-menu”>
<li><a href=”<?php base_url();?>tambah_user”><i class=”fa fa-circle-o”></i> Tambah User</a></li>
<li><a href=”<?php base_url();?>lihat_user”><i class=”fa fa-circle-o”></i> Edit User</a></li>
<li><a href=”<?php base_url();?>hapus_user”><i class=”fa fa-circle-o”></i> Hapus User</a></li>
<li><a href=”<?php base_url();?>lihat_user”><i class=”fa fa-circle-o”></i> View User</a></li>
</ul>
</li>
<li class=”treeview”>
<a href=”#”>
<i class=”fa fa-files-o”></i>
<span>Pelanggang</span>
<span class=”pull-right-container”>
<i class=”fa fa-angle-left pull-right”></i>
</span>
</a>
<ul class=”treeview-menu”>
<li><a href=”<?php base_url();?>tambah_pelanggan”><i class=”fa fa-circle-o”></i> Tambah Pelanggang</a></li>
<li><a href=”<?php base_url();?>view_pelanggan”><i class=”fa fa-circle-o”></i> Edit Pelanggang</a></li>
<li><a href=”<?php base_url();?>hapus_pelanggan”><i class=”fa fa-circle-o”></i> Hapus Pelanggan</a></li>
<li><a href=”<?php base_url();?>view_pelanggan”><i class=”fa fa-circle-o”></i> View Pelanggan</a></li>
</ul>
</li>
<li>
<a href=”pages/widgets.html”>
<i class=”fa fa-th”></i> <span>Laundry</span>
</a>
</li>
</ul>
<!– /.sidebar –>
</aside>
<!– Content Wrapper. Contains page content –>
<div class=”content-wrapper”>
<?php $this->load->view($content_view)?>
</div>
<!– /.content-wrapper –>
<footer class=”main-footer”>
<div class=”pull-right hidden-xs”>
<b></b>
</div>
<strong>Copyright © 2016-2017 <a href=””>Universitas Telkom</a></strong>
</footer>
</div>
<!– ./wrapper –>
<!– jQuery 2.2.3 –>
<script src=”<?php echo base_url();?>assets/plugins/jQuery/jquery-2.2.3.min.js”></script>
<!– jQuery UI 1.11.4 –>
<script src=”https://code.jquery.com/ui/1.11.4/jquery-ui.min.js”></script>
<!– Resolve conflict in jQuery UI tooltip with Bootstrap tooltip –>
<script>
$.widget.bridge(‘uibutton’, $.ui.button);
</script>
<!– jQuery 2.2.3 –>
<script src=”<?php echo base_url();?>assets/plugins/jQuery/jquery-2.2.3.min.js”></script>
<!– Bootstrap 3.3.6 –>
<script src=”<?php echo base_url();?>assets/bootstrap/js/bootstrap.min.js”></script>
<!– Morris.js charts –>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/morris/morris.min.js”></script>
<!– Sparkline –>
<script src=”<?php echo base_url();?>assets/plugins/sparkline/jquery.sparkline.min.js”></script>
<!– jvectormap –>
<script src=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/jvectormap/jquery-jvectormap-world-mill-en.js”></script>
<!– jQuery Knob Chart –>
<script src=”<?php echo base_url();?>assets/plugins/knob/jquery.knob.js”></script>
<!– daterangepicker –>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js”></script>
<script src=”<?php echo base_url();?>assets/plugins/daterangepicker/daterangepicker.js”></script>
<!– datepicker –>
<script src=”<?php echo base_url();?>assets/plugins/datepicker/bootstrap-datepicker.js”></script>
<!– Bootstrap WYSIHTML5 –>
<script src=”<?php echo base_url();?>assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js”></script>
<!– Slimscroll –>
<script src=”<?php echo base_url();?>assets/plugins/slimScroll/jquery.slimscroll.min.js”></script>
<!– FastClick –>
<script src=”<?php echo base_url();?>assets/plugins/fastclick/fastclick.js”></script>
<!– AdminLTE App –>
<script src=”<?php echo base_url();?>assets/dist/js/app.min.js”></script>
<!– AdminLTE dashboard demo (This is only for demo purposes) –>
<script src=”<?php echo base_url();?>assets/dist/js/pages/dashboard.js”></script>
<!– AdminLTE for demo purposes –>
<script src=”<?php echo base_url();?>assets/dist/js/demo.js”></script>
<script src=”<?php echo base_url(); ?>assets/dist/datatables/jquery.dataTables.js” type=”text/javascript”></script>
<script src=”<?php echo base_url(); ?>assets/dist/datatables/dataTables.bootstrap.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(function() {
$(“#example1”).dataTable();
$(‘#example2’).dataTable({
“bPaginate”: true,
“bLengthChange”: false,
“bFilter”: true,
“bSort”: true,
“bInfo”: true,
“bAutoWidth”: false
});
});
//waktu flash data :v
$(function(){
$(‘#pesan-flash’).delay(4000).fadeOut();
$(‘#pesan-error-flash’).delay(5000).fadeOut();
});
//iCheck for checkbox and radio inputs
$(‘input[type=”checkbox”].minimal, input[type=”radio”].minimal’).iCheck({
checkboxClass: ‘icheckbox_minimal-blue’,
radioClass: ‘iradio_minimal-blue’
});
//Red color scheme for iCheck
$(‘input[type=”checkbox”].minimal-red, input[type=”radio”].minimal-red’).iCheck({
checkboxClass: ‘icheckbox_minimal-red’,
radioClass: ‘iradio_minimal-red’
});
//Flat red color scheme for iCheck
$(‘input[type=”checkbox”].flat-red, input[type=”radio”].flat-red’).iCheck({
checkboxClass: ‘icheckbox_flat-green’,
radioClass: ‘iradio_flat-green’
});
</script>
</body>
</html>
application/views/login.php
<!DOCTYPE html>
<html >
<head>
<meta charset=”UTF-8″>
<title>Laundry PORTAL</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1, user-scalable=yes”>
<link rel=’stylesheet prefetch’ href=’http://fonts.googleapis.com/css?family=Open+Sans’>
<link rel=”stylesheet” href=”<?php echo base_url();?>assets_login/css/style.css”>
</head>
<body>
<div class=”cont”>
<div class=”demo”>
<div class=”login”>
<div class=”login__check”></div>
<div class=”login__form”>
<?php echo form_open(‘/c_login/check’); ?>
<div class=”login__row”>
<svg class=”login__icon name svg-icon” viewBox=”0 0 20 20″>
<path d=”M0,20 a10,8 0 0,1 20,0z M10,0 a4,4 0 0,1 0,8 a4,4 0 0,1 0,-8″ />
</svg>
<input type=”text” class=”login__input name” name=”username” placeholder=”Username” required/>
</div>
<div class=”login__row”>
<svg class=”login__icon pass svg-icon” viewBox=”0 0 20 20″>
<path d=”M0,20 20,20 20,8 0,8z M10,13 10,16z M4,8 a6,8 0 0,1 12,0″ />
</svg>
<input type=”password” class=”login__input pass” name=”password” placeholder=”Password” required/>
</div>
<button name=”btn” type=”submit” class=”login__submit”>Sign in</button>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div>
<script src=’http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js’></script>
<script src=”<?php echo base_url();?>assets_login/js/index.js”></script>
</body>
</html>
application/views/tambah_member.php
<section class=”content-header”>
<h1>
<b>TAMBAH DATA PELANGGAN</b>
</h1>
</section>
<!– Main content –>
<section class=”content”>
<!– Main row –>
<!– Chat box –>
<div class=”box”>
<div class=”box-header”>
<i class=”fa fa-plus”></i>
<h3 class=”box-title”>FORM TAMBAH PELANGGAN</h3>
</div>
<div class=”box-body chat” id=”chat-box”>
<!– chat item –>
<div class=”item”>
<form role=”form” action=”<?php echo base_url();?>c_admin/simpan_member” method=”POST” enctype=”multipart/form-data”>
<div class=”col-lg-6″>
<div class=”form-group”>
<label for=””>Nama Member</label>
<input type=”text” class=”form-control” value=”” id=”” name=”nama_member” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Jenis Kelamin</label>
<input type=”text” class=”form-control” value=”” id=”” name=”jenis_kelamin” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Nomor HP</label>
<input type=”text” class=”form-control” value=”” id=”” name=”nohp” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Alamat</label>
<input type=”text” class=”form-control” value=”” id=”” name=”alamat” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Username</label>
<input type=”text” class=”form-control” value=”” id=”” name=”username” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Password</label>
<input type=”text” class=”form-control” value=”” id=”” name=”password” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Status</label>
<select name=”status” class=”form-control” required>
<option selected=”selected”>–Pilih Status–</option>
<option value=”admin”>Admin</option>
<option value=”member”>Member</option>
</select>
</div>
</div>
</div><!– /.item –>
<div class=”form-group”>
<button type=”submit” class=”btn btn-primary btn-block btn-flat”>Simpan</button>
<input type=”button” class=”btn btn-warning btn-block btn-flat” value=”Kembali” onClick=”history.go(-1);”/>
</div><!– /.col –>
</form>
</div><!– /.chat –>
</div><!– /.box (chat box) –>
</section><!– /.content –>
application/views/tambah_user.php
<section class=”content-header”>
<h1>
<b>TAMBAH DATA USER</b>
</h1>
</section>
<!– Main content –>
<section class=”content”>
<!– Main row –>
<!– Chat box –>
<div class=”box”>
<div class=”box-header”>
<i class=”fa fa-plus”></i>
<h3 class=”box-title”>FORM TAMBAH USER</h3>
</div>
<div class=”box-body chat” id=”chat-box”>
<!– chat item –>
<div class=”item”>
<form role=”form” action=”<?php echo base_url();?>c_admin/simpan_user” method=”POST” enctype=”multipart/form-data”>
<div class=”col-lg-6″>
<div class=”form-group”>
<label for=””>Nama Member</label>
<input type=”text” class=”form-control” value=”” id=”” name=”nama_member” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Jenis Kelamin</label>
<input type=”text” class=”form-control” value=”” id=”” name=”jenis_kelamin” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Nomor HP</label>
<input type=”text” class=”form-control” value=”” id=”” name=”nohp” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Alamat</label>
<input type=”text” class=”form-control” value=”” id=”” name=”alamat” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Username</label>
<input type=”text” class=”form-control” value=”” id=”” name=”username” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Password</label>
<input type=”text” class=”form-control” value=”” id=”” name=”password” placeholder=”” required>
</div>
<div class=”form-group”>
<label for=””>Status</label>
<select name=”status” class=”form-control” required>
<option selected=”selected”>–Pilih Status–</option>
<option value=”admin”>Admin</option>
<option value=”member”>Member</option>
</select>
</div>
</div>
</div><!– /.item –>
<div class=”form-group”>
<button type=”submit” class=”btn btn-primary btn-block btn-flat”>Simpan</button>
<input type=”button” class=”btn btn-warning btn-block btn-flat” value=”Kembali” onClick=”history.go(-1);”/>
</div><!– /.col –>
</form>
</div><!– /.chat –>
</div><!– /.box (chat box) –>
</section><!– /.content –>
appliction/views/view_member.php
<section class=”content-header”>
<h1>
<b>DATA USER</b>
</h1>
<!– <ol class=”breadcrumb”>
<li><a href=”#”><i class=”fa fa-dashboard”></i> Home</a></li>
<li class=”active”>Dashboard</li>
</ol> –>
</section>
<!– Main content –>
<section class=”content”>
<!– Small boxes (Stat box) –>
<div class=”row”>
<div class=”col-md-12″>
<a style=”margin-bottom:3px” href=”<?php echo base_url(); ?>c_admin/tambah_user” class=”btn btn-primary no-radius dropdown-toggle”><i class=”fa fa-plus”></i> TAMBAH USER </a>
<div class=”box”>
<span id=”pesan-flash”><?php echo $this->session->flashdata(‘sukses’); ?></span>
<span id=”pesan-error-flash”><?php echo $this->session->flashdata(‘alert’); ?></span>
<div class=”box-title”>
</div><!– /.box-title –>
<div class=”box-body”>
<table id=”example1″ class=”table table-bordered table-striped”>
<thead>
<tr>
<th>NO</th>
<th>USERNAME</th>
<th>PASSWORD</th>
<th>STATUS</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php
$no = $this->uri->segment(‘3’) + 1;
foreach($user as $row){
?>
<!–<?//php $no=0; foreach($user->result() as $row) { $no++ ?>–>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $row->username;?></td>
<td><?php echo $row->password; ?></td>
<td><?php echo $row->status; ?></td>
<td>
<a class=”btn btn-warning btn-sm” href=”<?php echo base_url(); ?>c_admin/tampilan_update_user/<?php echo $row->id_user; ?>”><i class=”fa fa-pencil”></i></a>
<a onclick=”return confirm(‘Hapus data??’);” class=”btn btn-danger btn-sm” href=”<?php echo base_url(); ?>c_admin/hapus_user/<?php echo $row->id_user; ?>”><i class=”fa fa-trash”></i></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
echo $this->pagination->create_links();
?>
</div>
</div><!– /.box –>
</div><!– /.col –>
</div><!– /.row –>
<!– Main row –>
</section><!– /.content –>
application/views/view_pelanggan.php
<section class=”content-header”>
<h1>
<b>DATA PELANGGAN</b>
</h1>
<!– <ol class=”breadcrumb”>
<li><a href=”#”><i class=”fa fa-dashboard”></i> Home</a></li>
<li class=”active”>Dashboard</li>
</ol> –>
</section>
<!– Main content –>
<section class=”content”>
<!– Small boxes (Stat box) –>
<div class=”row”>
<div class=”col-md-12″>
<a style=”margin-bottom:3px” href=”<?php echo base_url(); ?>c_admin/tambah_member” class=”btn btn-primary no-radius dropdown-toggle”><i class=”fa fa-plus”></i> TAMBAH PELANGGAN </a>
<div class=”box”>
<span id=”pesan-flash”><?php echo $this->session->flashdata(‘sukses’); ?></span>
<span id=”pesan-error-flash”><?php echo $this->session->flashdata(‘alert’); ?></span>
<div class=”box-title”>
</div><!– /.box-title –>
<div class=”box-body”>
<table id=”example1″ class=”table table-bordered table-striped”>
<thead>
<tr>
<th>NO</th>
<th>NAMA PELANGGANG</th>
<th>JENIS KELAMIN</th>
<th>NO HP</th>
<th>ALAMAT</th>
<th>AKSI</th>
</tr>
</thead>
<tbody>
<?php
$no = $this->uri->segment(‘3’) + 1;
foreach($member as $row){
?>
<!–<?//php $no=0; foreach($user->result() as $row) { $no++ ?>–>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $row->nama_pelanggang;?></td>
<td><?php echo $row->jenis_kelamin; ?></td>
<td><?php echo $row->no_hp; ?></td>
<td><?php echo $row->alamat; ?></td>
<td>
<a class=”btn btn-warning btn-sm” href=”<?php echo base_url(); ?>c_admin/tampilan_update_pelanggan/<?php echo $row->id_pelanggan; ?>”><i class=”fa fa-pencil”></i></a>
<a onclick=”return confirm(‘Hapus data??’);” class=”btn btn-danger btn-sm” href=”<?php echo base_url(); ?>c_admin/hapus_pelanggan/<?php echo $row->id_pelanggan; ?>”><i class=”fa fa-trash”></i></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php
echo $this->pagination->create_links();
?>
</div>
</div><!– /.box –>
</div><!– /.col –>
</div><!– /.row –>
<!– Main row –>
</section><!– /.content –>nah, setelah buat itu semua, jangan lupa untuk ubah
1. application/config/autoload.php
$autoload[‘libraries’] = array(‘database’, ‘session’);
$autoload[‘helper’] = array(‘url’,’file’,’form’,’html’,’text’);
2.application/config/database.php
$db[‘default’] = array(
‘dsn’ => ”,
‘hostname’ => ‘localhost’,
‘username’ => ‘root’,
‘password’ => ”,
‘database’ => ‘laundri’,
‘dbdriver’ => ‘mysqli’,
3.application/config/routes.php
$route[‘default_controller’] = ‘c_login’;
4.application/config/config.php
$config[‘base_url’] = ‘http://localhost/laundry/’;
jangan lupa buat database ya dulu ya reader pada localhost/phpmyadmin..
apabila reader melakukan tutorial ini, maka bisa diuji langsung, dengan cara ketik localhost http://localhost/laundry/
itu tutorial yang kami lakukan untuk membuat template liquid laundry, kami juga dibantu oleh kaka tingkat di Tel-U yang masih sama sama belajar dalam pembuatan web ini, untuk itu apabila ada kesalahan penyampaian ataupun penjelasan.. mohon dimaklumi..
terima kasihh .. Semangat Pagiii !!!
Leave a Reply