first commit
This commit is contained in:
52
application/controllers/su/Order.php
Normal file
52
application/controllers/su/Order.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Order extends CI_Controller {
|
||||
function __Construct()
|
||||
{
|
||||
parent ::__construct();
|
||||
if($this->session->userdata('logged_in')==false){
|
||||
$location = site_url('welcome');
|
||||
header("Location: ".$location);
|
||||
}
|
||||
$this->load->model('Barang');
|
||||
$this->load->model('Transaction');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$hd['title'] = "View Order - Toko Dzaky Mulya";
|
||||
$hd['User'] = $this->session->userdata('username');
|
||||
$sb['aktif'] = "Order";
|
||||
$sb['order'] = $this->Transaction->pending_order();
|
||||
$data['table'] = $this->Transaction->get_order();
|
||||
|
||||
$this->load->view('back/header',$hd);
|
||||
$this->load->view('back/sidebar',$sb);
|
||||
$this->load->view('back/order',$data);
|
||||
$this->load->view('back/footer');
|
||||
}
|
||||
|
||||
public function order_view($id)
|
||||
{
|
||||
$hd['title'] = "Order - Toko Dzaky Mulya";
|
||||
$hd['User'] = $this->session->userdata('username');
|
||||
$sb['aktif'] = "Order";
|
||||
$sb['order'] = $this->Transaction->pending_order();
|
||||
$data['data'] = $this->Transaction->get_single_order($id);
|
||||
$this->load->view('back/header',$hd);
|
||||
$this->load->view('back/sidebar',$sb);
|
||||
$this->load->view('back/vieworder',$data);
|
||||
$this->load->view('back/footer');
|
||||
}
|
||||
|
||||
public function update_order($id)
|
||||
{
|
||||
$this->Transaction->update_order($id,$_POST['status']);
|
||||
$location = site_url('su/order');
|
||||
header("Location: ".$location);
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user