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

class Setting extends Admin_Core_Controller {

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

	public function application_setting()
    {
        $data['title'] = 'Application Setting';
        $data['app_setting'] = $this->setting_model->get_all_app_setting(); 
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/settings/application_setting');
        $this->load->view('admin/include/footer');
    }

    public function update_application_setting()
    {
        
        if ($this->setting_model->update_application_setting()) {
            $this->session->set_userdata('success', "Data Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Data Update Faild");
            redirect($this->agent->referrer());
        }
    }

    public function visual_setting()
    {
        $data['title'] = 'Visual Setting';
        $data['app_setting'] = $this->setting_model->get_all_app_setting(); 
        $data['visual_setting'] = $this->setting_model->get_visual_setting();   
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/settings/visual_setting');
        $this->load->view('admin/include/footer');
    }

    public function update_visual_setting()
    {
        
        if ($this->setting_model->update_visual_setting()) {
            $this->session->set_userdata('success', "Data Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Data Update Faild");
            redirect($this->agent->referrer());
        }
    }

    // Branch GST Start
    public function gst_setting()
    {
        $data['title'] = 'GST Setting';
        $data['app_setting'] = $this->setting_model->get_all_app_setting(); 
        $data['visual_setting'] = $this->setting_model->get_visual_setting();   
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/settings/gst_setting');
        $this->load->view('admin/include/footer');
    }

    public function update_gst_setting($id)
    {
        if ($this->setting_model->update_gst_setting($id)) {
            $this->session->set_userdata('success', "GST Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "GST Update Faild");
            redirect($this->agent->referrer());
        }
    }
    // Branch GST End

    // Course Fee Start

    public function course_fee_setting()
    {
        $atp_id = user_id();

        $this->load->model('course_model', 'course');
        $data['title'] = 'GST Setting';
        $data['app_setting'] = $this->setting_model->get_all_app_setting(); 
        $data['all_course'] = $this->course->get_all_admin_added_course_for_fee_setting($atp_id);   
        $data['atp_id'] = $atp_id;
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/settings/course_fee_setting');
        $this->load->view('admin/include/footer');
    }

    public function update_course_price_for_atp()
    {
        $this->load->model('course_model', 'course');
        if ($this->course->update_course_price_for_atp()) {
            $this->session->set_userdata('success', "Course Price Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Course Price Update Faild");
            redirect($this->agent->referrer());
        }
    }

    // Course Fee Start

   
}