<?php

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

class CallCenter extends MY_Controller {

    var $thispage;
    var $cats;

    public function __construct() {
        parent::__construct();
        $this->thispage = "CallCenter";
        if (!get_license_per('call_center')) {
            redirect("", "refresh");
        }
        $this->load->model('booking');
        $this->operator_id = $this->session->userdata('operator_id');
        
        if(!get_ap('call_center_module', $this->operator_id)){
            redirect("", "refresh");
        }

        if (!$this->session->userdata('group')) {
            echo "لايمكن الاستخدام ";
            $this->session->set_flashdata('msg', 'لايمكن التعديل عليه');
            // /echo $_SERVER['HTTP_REFERER'];
            redirect($_SERVER['HTTP_REFERER']);
            exit();
        }
    }

    public function add_order() {
        if (!get_ap('call_add_order', $this->operator_id)) {
            redirect("", "refresh");
        }
        redirect(base_url('orders/add/1'));
    }

    public function show_orders() {
        if (!get_ap('call_show_orders', $this->operator_id)) {
            redirect("", "refresh");
        }
        redirect(base_url('orders/index/1/1/0/0'));
    }

}
