<?php

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

class Signatures extends Admin_Controller {

    function __construct() {
        parent::__construct();
        $this->load->helper('file');
        $this->load->library('smsgateway');
        $this->load->library('mailsmsconf');
		$this->load->model('examresultscharacter_model');
    }

    function index() {
        $this->session->set_userdata('top_menu', 'Examinations');
        $this->session->set_userdata('sub_menu', 'signatures/index');
        $session = $this->setting_model->getCurrentSession();
        $session_name = $this->setting_model->getCurrentSessionName();
		$setting = $this->setting_model->get(1);
		
		$exam = $this->exam_model->get();
        $class = $this->class_model->get();
        $section = $this->section_model->get();
		$classsection = $this->classsection_model->get();
        $data['examlist'] = $exam;
        $data['classlist'] = $class;
        $data['sectionlist'] = $section;
		$data['classsectionlist'] = $classsection;
		
		
		$this->load->view('layout/header', $data);
        $this->load->view('admin/signatures/signatureList', $data);
        $this->load->view('layout/footer', $data);
    }

    function view($id) {
        $this->session->set_userdata('top_menu', 'Signatures');
        $this->session->set_userdata('sub_menu', 'signatures/index');
        $session = $this->setting_model->getCurrentSession();
        $session_name = $this->setting_model->getCurrentSessionName();
		$setting = $this->setting_model->get(1);
		
		$exam = $this->exam_model->get();
        $class = $this->class_model->get();
        $section = $this->section_model->get();
        $classsection = $this->classsection_model->get();		
        $data['examlist'] = $exam;
        $data['classlist'] = $class;
        $data['sectionlist'] = $section;
		$data['classsectionlist'] = $classsection;
		
		
		$this->load->view('layout/header', $data);
        $this->load->view('admin/signatures/signatureList', $data);
        $this->load->view('layout/footer', $data);
    }

    function delete($id) {

    }
	
	function get_exam_by_schedule($s_id){
	
	}

    function create() {
		$exam = $this->exam_model->get();
        $class = $this->class_model->get();
        $section = $this->section_model->get();
        $classsection = $this->classsection_model->get();
        $data['examlist'] = $exam;
        $data['classlist'] = $class;
        $data['sectionlist'] = $section;
        $data['classsectionlist'] = $classsection;
	     $this->form_validation->set_rules('upload_sign', 'Sign', 'trim|required|xss_clean');
        if ($this->form_validation->run() == FALSE) {
			
			$this->load->view('layout/header', $data);
			$this->load->view('admin/signatures/signatureList', $data);
			$this->load->view('layout/footer', $data);	
            
        } else {
			
			///if signature is uploaded
            $data = $this->input->post('sub_sig');
			
			$this->load->view('layout/header', $data);
			$this->load->view('admin/signatures/signatureList', $data);
			$this->load->view('layout/footer', $data);	
			
		}
		
	

		
    }

    function edit($id) {

    }

}

?>