<?php defined("BASEPATH")or exit("NO DIRECT ACCESS IS ALLOWED");?>
<?php
class Teacherinfo extends MY_Controller{
    public function __construct(){
        parent::__construct();
        $this->load->model('admin/teacher_master/TeacherinfoModel','teacherinfo_model');
        $this->load->model('admin/Adminltemodel','adminlte_model');
        
        $this->load->library(['form_validation','bcrypt','email','session','pagination']);
        $this->load->helper(['html','form','url','security','string']);
        $this->load->model('CommonModel','common_model');
        //$this->load->model('AdminlteModel','adminlte_model');
        if(!$this->session->userdata('ad_id') ){return redirect('Admin/signin');}
        if($this->session->userdata('ts_id') ){return redirect('teacher/signin');}
        if($this->session->userdata('ss_id') ){return redirect('student/signin');}
        $list_id					=		$this->session->userdata('ad_id');
        $this->admin_data	        =		$this->adminlte_model->user_profile($list_id);
        //echo $this->session->userdata('ad_id');die;
        error_reporting(0);
        date_default_timezone_set('Asia/Kolkata');
    }
    public function index(){
        $this->form_validation->set_rules('perpage_search', 'ALL', 'required');
        if($this->input->post('perpage')==""){$perpage=10;}		else{$perpage		=	$this->input->post('perpage');}
        $config = [
            'base_url'					=>	site_url('admin/teacher_master/attendee/index'),
            'total_rows'				=>	$this->attendee_model->num_rows(),
            'per_page'					=>	$perpage,
            'display_pages'			    =>	TRUE,
            'use_page_numbers'	        => 	TRUE,
            'uri_segment'				=>	5,
            'num_links'					=>	10,
            'page_query_string'         => 	FALSE,
            'full_tag_open'			    =>	"<ul attendee='pagination pagination-sm'>",
            'full_tag_close'		    =>	"</ul>",
            'first_tag_open'		    =>	'<li>',
            'first_tag_close'		    =>	'</li>',
            'last_tag_open'			    =>	'<li>',
            'last_tag_close'		    =>	'</li>',
            'next_tag_open'			    =>	'<li>',
            'next_tag_close'		    =>	'</li>',
            'prev_tag_open'			    =>	'<li>',
            'prev_tag_close'		    =>	'</li>',
            'num_tag_open'			    =>	'<li>',
            'num_tag_close'			    =>	'</li>',
            'cur_tag_open'			    =>	'<li attendee="page-item active"><a attendee="page-link">',
            'cur_tag_close'			    =>	'</a></li>',
        ];
        $this->pagination->initialize($config);
        $page 		= ($this->uri->segment(5)) ? $this->uri->segment(5) : 1;
        $list 		= $this->attendee_model->attendee_list($config['per_page'],$page,$search);
        $links		=	$this->pagination->create_links();
        
        $this->load->view('adminlte/panel/header',['userdata'=>$this->admin_data,'title'=>'attendee List','list'=>$list,'link'=>$links,'menu_auth'=>$this->menu_auth]);
        $this->load->view('adminlte/panel/sidebar');
        $this->load->view('adminlte/master/attendee/attendee');
        $this->load->view('adminlte/panel/footer');
    }
}