olshop/application/controllers/su/Order.php

52 lines
1.4 KiB
PHP
Raw Normal View History

2020-01-02 23:12:35 +07:00
<?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();
}
}
?>