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

class Dailyorder extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
        $this->load->model('User_model');
	}


    public function index()
    {
        
        $data['title'] = "Daily Order";  
        $student_id = $this->User_model->userInfo()['student_id'];
        $query=$this->db->select('*')
                       ->from('daily_order')
                       ->limit(6)
                       ->order_by('date','DESC')
                       ->where('is_delete',0)
                       -> get();
        $data['order']=$query->result_array();
        $data['userInfo'] =  $this->User_model->userInfo();
        $student_id = $data['userInfo']['student_id'];
		$user_img=@$this->db->select('img,img1,img2,img3,img4')
	                              ->from('student')
	                              ->where('id',$student_id)
	                              ->get()->row_array();
	   	   
	   $data['user_img']=$user_img;
	   
	   if (empty($data['order'])) {
            $this->session->set_flashdata('msg', 'No data avaliable');
       }
        $data['main'] = "dailyorder/dailyorder_view";
        $this->load->view('includes/main', $data);
    }




}

/* End of file datesheet.php */
/* Location: ./application/controllers/datesheet.php */