<?php
class Gallery extends CI_Controller{
	function __construct(){
		parent::__construct();
		$this->load->model('m_gallery');
		$this->load->model('m_order');
	}

	function index(){
		$x['data']=$this->m_gallery->get_all_gallery();
		$this->load->view('mobile/v_gallery',$x);
	}
	
	function gallery1(){
	    $kopel = $this->session->userdata('kopel');
    $kdcabang = $this->session->userdata('kdcabang');
    $this->db->query("update tbl_pelanggan set plg_status='1' where plg_id='$kopel'");
    $no_invoice = $this->m_order->get_invoice($kdcabang);
    $this->session->set_userdata('no_invoice', $no_invoice);
    $this->session->set_userdata('nobukti', $no_invoice);
    $order_proses = $this->m_order->order_produk1($no_invoice);
		$x['data']=$this->m_gallery->get_all_gallery();
		$this->load->view('mobile/v_gallery',$x);
	}
}