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

class Event extends Admin_Core_Controller {

    public function __construct()
    {
        parent::__construct();
        //check_permission('event');
    }
    

    public function add_new_event()
    {
        $data['title'] = 'Add New Event';
        $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/event/add_new_event');
        $this->load->view('admin/include/footer');
    }

    function edit_main_page($id)
    {
        $data['title'] = 'Edit Event';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['visual_setting'] = $this->setting_model->get_visual_setting();
        $data['event'] = $this->event_model->get_event_by_id($id);
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/edit_event');
        $this->load->view('admin/include/footer');
    }

    public function edit($id)
    {
        // $data['title'] = 'Edit Event';
        // $data['app_setting'] = $this->setting_model->get_all_app_setting();
        // $data['visual_setting'] = $this->setting_model->get_visual_setting();
        // $data['event'] = $this->event_model->get_event_by_id($id);
        // $this->load->view('admin/include/header', $data);
        // $this->load->view('admin/event/edit_event');
        // $this->load->view('admin/include/footer');

        $data['title'] = 'Edit Event';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['visual_setting'] = $this->setting_model->get_visual_setting();
        $data['section_main'] = $this->event_model->get_page_main_details_by_page_id($id);
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_main');
        $this->load->view('admin/include/footer');
    }


    

    public function view_all_event()
    {
        $data['title'] = 'view All Event';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['visual_setting'] = $this->setting_model->get_visual_setting();
        $data['get_all_event'] = $this->event_model->get_all_event();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/view_all_event');
        $this->load->view('admin/include/footer');
    }

    public function all_event_booking()
    {
        $data['title'] = 'All Event Booking';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['visual_setting'] = $this->setting_model->get_visual_setting();
        $data['all_booking'] = $this->event_model->get_all_event_booking();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/all_event_booking');
        $this->load->view('admin/include/footer');
    }


    function build_landing_page($id)
    {
        $data['title'] = 'Add New Page';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/add_new_page');
        $this->load->view('admin/include/footer');
    }

    function add_section_main()
    {
        if ($this->event_model->add_section_main()) {
            $this->session->set_userdata('success', "Page Successfully Added");
            redirect(base_url().'admin/event/view_all_event');
        } else {
            $this->session->set_userdata('error', "Section Added Faild");
            redirect($this->agent->referrer());
        }
    }

    public function update_page($id)
    {
        $data['title'] = 'Section Main';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['section_main'] = $this->event_model->get_page_main_details($id);
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_main');
        $this->load->view('admin/include/footer');
    }

    function update_section_main($id)
    {
        if ($this->event_model->update_section_main($id)) {
            $this->session->set_userdata('success', "Section Successfully Updated");
            redirect(base_url().'admin/event/view_all_event');
        } else {
            $this->session->set_userdata('error', "Section Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_1()
    {
        $data['title'] = 'Section 1';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_1_data'] = $this->event_model->get_all_data_from_section_1();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_1');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_1_content()
    {
        if ($this->event_model->add_new_section_1_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_1_content($id)
    {
        if ($this->event_model->update_section_1_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }

    function delete_section_1($id)
    {
        if ($this->event_model->delete_section_1($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_2()
    {
        $data['title'] = 'Section 2';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_2_data'] = $this->event_model->get_all_data_from_section_2();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_2');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_2_content()
    {
        if ($this->event_model->add_new_section_2_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_2_content($id)
    {
        if ($this->event_model->update_section_2_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }

    function delete_section_2($id)
    {
        if ($this->event_model->delete_section_2($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_3()
    {
        $data['title'] = 'Section 3';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_3_data'] = $this->event_model->get_all_data_from_section_3();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_3');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_3_content()
    {
        if ($this->event_model->add_new_section_3_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_3_content($id)
    {
        if ($this->event_model->update_section_3_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_3($id)
    {
        if ($this->event_model->delete_section_3($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_4()
    {
        $data['title'] = 'Section 4';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_4_data'] = $this->event_model->get_all_data_from_section_4();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_4');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_4_content()
    {
        if ($this->event_model->add_new_section_4_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_4_content($id)
    {
        if ($this->event_model->update_section_4_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_4($id)
    {
        if ($this->event_model->delete_section_4($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_5()
    {
        $data['title'] = 'Section 5';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_5_data'] = $this->event_model->get_all_data_from_section_5();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_5');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_5_content()
    {
        if ($this->event_model->add_new_section_5_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_5_content($id)
    {
        if ($this->event_model->update_section_5_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_5($id)
    {
        if ($this->event_model->delete_section_5($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_6()
    {
        $data['title'] = 'Section 6';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_6_data'] = $this->event_model->get_all_data_from_section_6();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_6');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_6_content()
    {
        if ($this->event_model->add_new_section_6_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_6_content($id)
    {
        if ($this->event_model->update_section_6_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_6($id)
    {
        if ($this->event_model->delete_section_6($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_8()
    {
        $data['title'] = 'Section 8';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_8_data'] = $this->event_model->get_all_data_from_section_8();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_8');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_8_content()
    {
        if ($this->event_model->add_new_section_8_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_8_content($id)
    {
        if ($this->event_model->update_section_8_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_8($id)
    {
        if ($this->event_model->delete_section_8($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_13()
    {
        $data['title'] = 'Section 13';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_13_data'] = $this->event_model->get_all_data_from_section_13();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_13');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_13_content()
    {
        if ($this->event_model->add_new_section_13_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_13_content($id)
    {
        if ($this->event_model->update_section_13_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_13($id)
    {
        if ($this->event_model->delete_section_13($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////
    public function section_14()
    {
        $data['title'] = 'Section 14';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_section_14_data'] = $this->event_model->get_all_data_from_section_14();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_14');
        $this->load->view('admin/include/footer');
    }

    function add_new_section_14_content()
    {
        if ($this->event_model->add_new_section_14_content()) {
            $this->session->set_userdata('success', "Content Successfully Added");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Added Faild");
            redirect($this->agent->referrer());
        }
    }

    function update_section_14_content($id)
    {
        if ($this->event_model->update_section_14_content($id)) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    function delete_section_14($id)
    {
        if ($this->event_model->delete_section_14($id)) {
            $this->session->set_userdata('success', "Content Successfully Deleted");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Deleted Faild");
            redirect($this->agent->referrer());
        }
    }
    //////////////////////////////////////////////////////////////////////////////////
    public function section_15()
    {
        $data['title'] = 'Section 15';
        $data['app_setting'] = $this->setting_model->get_all_app_setting();
        $data['all_pages'] = $this->event_model->get_all_pages();
        $this->load->view('admin/include/header', $data);
        $this->load->view('admin/event/section/section_15');
        $this->load->view('admin/include/footer');
    }

    function add_or_update_section_15()
    {
        if ($this->event_model->add_or_update_section_15()) {
            $this->session->set_userdata('success', "Content Successfully Updated");
            redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Content Updated Faild");
            redirect($this->agent->referrer());
        }
    }
    

    

    

    /* public function add_new_events()
    {
        if ($this->event_model->add_new_events()) {
            $this->session->set_userdata('success', "Event Successfully Added");
          //  redirect($this->agent->referrer());
        } else {
            $this->session->set_userdata('error', "Event Added Faild");
           // redirect($this->agent->referrer());
        }
    }*/

    

    
   


}

/* End of file Events.php */
/* Location: ./application/views/front/Events.php */