<?php

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

class Callcenter_controller extends CI_Controller {

    public function __construct() {
        parent::__construct();
        // Your own constructor code
        $this->load->model('scheduler_model');
        $this->load->model('business_model');
        $this->load->model('visits_model');
        $this->load->model('accounting_model');
        $this->load->model('customer_model');
        $this->load->model('dispatch_model');      
       
    }

    
    public function callcenter_dash($date=null){
                
        if ($this->session->userdata('role') == '' || $this->session->userdata('role') == 'Sh-Users') {
            $this->load->view('login_view');
            
        } else {

            if ($this->session->userdata('role') != 'Floor Manager' && $this->session->userdata('role') != 'Admin' && $this->session->userdata('role') != 'Super User') {
                redirect(base_url('scheduler'));
            }
            
            $today = date('Y-m-d');

            if(null !== $date){
               $today=$date;
               $data['date']=$today;
            }
            
            $data['invoices']=$this->invoice_model->getdayinvoices($today, 'desc', $data['status'],null);
            
            $this->load->view('includes/header',$data);
            $this->load->view('floor/floor_listing');
            $this->load->view('includes/footer');
        }

    }
    
}