<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class orders extends Admin_Controller {

    function __construct() {
        parent::__construct();
	}

	public function index() {
	    
	   
	    
	    $orders      = reindex_by_key($this->db->query("SELECT * FROM `orders`")->result(), 'customerId');
        $order_items =  reindex_by_key($this->db->query("SELECT * FROM `order_items`")->result(), 'item_id');
	    $this->template
    		->set('view', 'admin/orders/index')
    		->set('orders', $orders)
    		->set('order_items', $order_items)
            ->render();
	}




}















