<?php

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

class Loyalty_controller extends CI_Controller {

    public function __construct() {
        parent::__construct();
        // Your own constructor code
        $this->load->model('loyalty_model');
        if($this->session->userdata('role')==''){
            redirect('logout');
        }
    }

    public function service_loyatly() {
        checkroles(0,0,1);
        
        $data['nav'] = 'business';
        $data['subnav'] = 'loyalty';
        
        $this->load->model('business_model');
        $data['business'] = $this->business_model->getbusinessdetails();
        
        $data['service_loyalty'] = $this->loyalty_model->get_service_loyalty();
        
        
        //get the posted values
        $this->load->view('includes/header');
        $this->load->view('setting/service_loyalty_view', $data);
        $this->load->view('includes/footer');
        
    }
    
    function service_loyalty_list(){        
        $data = $this->loyalty_model->get_service_loyalty();
        echo(json_encode($data));        
    }
}