Assalam,.. jadi saat ini pada tokoonline hanya ada laporan keseluruhan penjualan,
jadi jika ingin membuat laporan seperti yang dibutuhkan di atas tinggal modifikasi di querynya :
buka
file "application/controllers/administrator.php"
cari kode berikut :
function orders(){
cek_session_akses('konsumen',$this->session->id_session);
$data['title'] = 'Laporan Pesanan Masuk';
$data['record'] = $this->model_app->orders_report_all();
$this->template->load('administrator/template','administrator/mod_penjualan/view_orders_report',$data);
}
ubah menjadi seperti ini :
function orders(){
cek_session_akses('konsumen',$this->session->id_session);
$data['title'] = 'Laporan Pesanan Masuk';
if ($_GET['laporan']=='harian'){
$data['record'] = $this->db->query("SELECT * FROM rb_penjualan WHERE SUBSTR(waktu_transaksi, 1,10)=DATE(NOW()) ORDER BY id_penjualan DESC");
}elseif($_GET['laporan']=='mingguan'){
$data['record'] = $this->db->query("SELECT * FROM rb_penjualan WHERE YEARWEEK(waktu_transaksi)=YEARWEEK(NOW()) ORDER BY id_penjualan DESC");
}elseif($_GET['laporan']=='bulanan'){
$data['record'] = $this->db->query("SELECT * FROM rb_penjualan WHERE MONTH(waktu_transaksi)=MONTH(NOW()) ORDER BY id_penjualan DESC");
}else{
$data['record'] = $this->model_app->orders_report_all();
}
$this->template->load('administrator/template','administrator/mod_penjualan/view_orders_report',$data);
}
Tambahkan menu baru pada
file "application/views/administrator/menu-admin.php"cari script berikut :
$cek=$this->model_app->umenu_akses("orders",$this->session->id_session);
if($cek==1 OR $this->session->level=='admin'){
echo "<li><a href='".base_url()."administrator/orders'><i class='fa fa-circle-o'></i> Orders</a></li>";
}
Tambahkan dibawahnya menu baru, ini scriptnya :
$cek=$this->model_app->umenu_akses("orders",$this->session->id_session);
if($cek==1 OR $this->session->level=='admin'){
echo "<li><a href='".base_url()."administrator/orders?laporan=harian'><i class='fa fa-circle-o'></i> Orders Harian</a></li>";
}
$cek=$this->model_app->umenu_akses("orders",$this->session->id_session);
if($cek==1 OR $this->session->level=='admin'){
echo "<li><a href='".base_url()."administrator/orders?laporan=mingguan'><i class='fa fa-circle-o'></i> Orders Mingguan</a></li>";
}
$cek=$this->model_app->umenu_akses("orders",$this->session->id_session);
if($cek==1 OR $this->session->level=='admin'){
echo "<li><a href='".base_url()."administrator/orders?laporan=bulanan'><i class='fa fa-circle-o'></i> Orders Bulanan</a></li>";
}
dah gitu saja, dan beres silahkan dicoba.. ^_^