<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//Why this controller still commited/here?!

class Video_course_back_end extends TT_admin_login {
    public function __construct() {
        parent::__construct();
        $this->load->model('All_video_course_model');
    }
    
    public function all_video_course(){
        $data = [];
        $data['itNeed'] = '';
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/all_video_course/view_all_video_course',$data,TRUE);
        $this->load->view('video_course/video_course_back_end/all_video_course/view_all_course_master', $data);  
    }
   
    /*
     * @Author              : Md. Delwar Hossain
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : 12-09-2017
     * @ModifiedBy          : Kazol
     * @Route               : super-admin/add-video-course-back-end
     * @Description         : This function is used for getting the whole information of a single video course
     * @view                : video_course/video_course_back_end/all_video_course/view_video_course_detail,
     *                        video_course/video_course_back_end/all_video_course/view_all_course_master
     * @redirect            : 
     * @deprecated          : 
     * @exception           : 
     * @inheritDoc          : 
     * @Parameter           : $video_course_id
     * @Return              : 
     * @value               : 
     * @Status              : active
     * @version             : v2.1        
     */
    public function video_course_detail($video_course_id = NULL){
        $data = [];
        $data = $this->welcome_model->generate_menu();
        $limit_offset = 0;
        $page_number = 1;
        $data['course_info'] = $this->All_video_course_model->get_video_course_details($video_course_id);
        $data['course_creator_info'] = $this->All_video_course_model->get_video_course_creator_info($video_course_id);
        //$this->cf->dd($data['course_info']);
        $data['video_course_details'] = $this->All_video_course_model->get_video_course_details($video_course_id);
        $data['video_course_work_files'] = $this->All_video_course_model->get_video_course_work_files($video_course_id);
        $data['similar_resource_person_video_course'] = $this->All_video_course_model->get_similar_resource_person_video_course($video_course_id);
        //$this->cf->dd($data['similar_resource_person_video_course']);
        $data['similar_parent_topic_video_course'] = $this->All_video_course_model->get_similar_parent_topic_video_course($video_course_id);
        //$this->All_video_course_model->get_video_course_total_view($video_course_id);
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/all_video_course/view_video_course_detail',$data,TRUE);
        $this->load->view('video_course/video_course_back_end/all_video_course/view_all_course_master', $data);  
    }

    /**
     * @Author              : Md. Delwar Hossain  
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/add-video-course-back-end
     * @deprecated          :
     * @exception           :
     * @inheritDoc          : NULL
     * @link                :
     * @linkplain           :
     * @Parameter           : None
     * @Return              : NULL  
     * @see                 :
     * @serial              :
     * @serialData          :
     * @serialField         :
     * @since               :
     * @throws              :
     * @value               :
     * @version             : v2.1       
     * */
    public function add_video_course_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'add_video_course_back_end';

        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_add_video_course_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);      
    }
    
    /**
     * @Author              : Kazol 
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/manage-video-course-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function manage_video_course_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_manage_video_course_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    /**
     * @Author              : Kazol 
     * @CreatedDate         : 05-07-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/edit-video-course-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function edit_video_course_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_edit_video_course_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }

    public function paid_video_course_registered_student_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_paid_video_course_registered_student_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    
    

    /**
     * @Author              : Kazol 
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/view-video-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function view_video_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_upload/view_video_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);
    }
    
    /**
     * @Author              : Kazol
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/video-course-invite-learners-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function invite_learner_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_invite_learner_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);
    }
    
   
    /**
     * @Author              : Kazol  
     * @CreatedDate         : 08-07-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/assign-video-to-course
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function assign_video_to_course(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_assign_video_to_course_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);
    }
    
    public function assign_student_to_video_course(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_assign_student_to_video_course_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);
    }

    /**
     * @Author              : Kazol  
     * @CreatedDate         : 05-07-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/manage-video-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    
    public function edit_video_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_upload/view_edit_video_back_end', $data, TRUE);
        $this->load->view('admin/admin_master', $data);
    }
    
    /**
     * @Author              : Md. Delwar Hossain  
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/add-more-video-section_back_end
     * @deprecated          :
     * @exception           :
     * @inheritDoc          : NULL
     * @link                :
     * @linkplain           :
     * @Parameter           : None
     * @Return              : NULL  
     * @see                 :
     * @serial              :
     * @serialData          :
     * @serialField         :
     * @since               :
     * @throws              :
     * @value               :
     * @version             : v2.1       
     * */
    function add_more_video_course_section_area_back_end() {
        if($this->input->is_ajax_request()){
            $data['section_counter'] = 1;
            $data['video_counter'] = 1;
            echo $this->load->view('video_course/video_course_back_end/video_course_back_end_ajax_page/view_video_section_back_end', $data, true);
        }
    }
    
    /**
     * @Author              : Md. Delwar Hossain  
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/add-more-single-video_back_end
     * @deprecated          :
     * @exception           :
     * @inheritDoc          : NULL
     * @link                :
     * @linkplain           :
     * @Parameter           : None
     * @Return              : NULL  
     * @see                 :
     * @serial              :
     * @serialData          :
     * @serialField         :
     * @since               :
     * @throws              :
     * @value               :
     * @version             : v2.1       
     * */
    function add_more_video_back_end() {
        if($this->input->is_ajax_request()){
            $data['video_counter'] = 1;
            echo $this->load->view('video_course/video_course_back_end/video_upload/video_upload_ajax_page/view_add_single_video', $data, true);
        }
    }
    
    /**
     * @Author              : Md. Delwar Hossain  
     * @CreatedDate         : 21-06-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/language-search-information
     * @deprecated          :
     * @exception           :
     * @inheritDoc          : NULL
     * @link                :
     * @linkplain           :
     * @Parameter           : None
     * @Return              : NULL  
     * @see                 :
     * @serial              :
     * @serialData          :
     * @serialField         :
     * @since               :
     * @throws              :
     * @value               :
     * @version             : v2.1       
     * */
    function add_video_course_language_search_information_back_end(){
        $data = Array();
        $search_array = array("bangla", "english", "hindi", "urdu");
        $search_value = preg_replace('/\s+/', ' ', trim($this->input->post('search_value', TRUE)));
        if ($search_value != '') {
            if (in_array($search_value, $search_array)) {
                $data['search_data'] = $search_value;
                echo $this->load->view('video_course/video_course_back_end/video_course_back_end_ajax_page/view_language_search_back_end', $data, TRUE);
            }else{
                echo 'Result Not Found';
            }
        } else {
            echo 'Please Type Language';
        }
    }
    /**
     * @Author              : Kazol  
     * @CreatedDate         : 05-07-17  
     * @ModifiedDate        : NULL
     * @Route               : super-admin/add-meta-back-end
     * @inheritDoc          : NULL
     * @Parameter           : None
     * @Return              : NULL  
     * @version             : v2.1       
     * */
    public function add_video_course_meta_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/view_add_meta_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    
    public function add_video_course_section_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_course_section/view_add_video_course_section_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    
    public function edit_video_course_section_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_course_section/view_edit_video_course_section_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    
    public function manage_video_course_section_back_end(){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_course_section/view_manage_video_course_section_back_end', $data, true);
        $this->load->view('admin/admin_master', $data);
    }
    
    public function add_video_in_video_course($video_course_url){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'add_video_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/video_upload/view_add_video', $data, TRUE);
        $this->load->view('admin/admin_master', $data);       
    }
    
    public function video_course_registered_student_invoice_list($video_course_url){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/payment/view_student_invoice_list', $data, TRUE);
        $this->load->view('admin/admin_master', $data);       
    }
    
    public function video_course_registered_student_single_invoice($invoice_id){
        $data = array();
        $data['active_menu'] = 'video_course_back_end';
        $data['active_sub_menu'] = 'manage_video_course_back_end';
        
        $data['main_content'] = $this->load->view('video_course/video_course_back_end/payment/view_student_single_invoice', $data, TRUE);
        $this->load->view('admin/admin_master', $data);       
    }
}



