[ Avaa Bypassed ]




Upload:

Command:

www-data@18.216.67.249: ~ $
<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Year_Model extends MY_Model {
    
    function __construct() {
        parent::__construct();
    }
    
    public function get_year_list($school_id = null){
        
        $this->db->select('AY.*, S.school_name');
        $this->db->from('academic_years AS AY');
        $this->db->join('schools AS S', 'S.id = AY.school_id', 'left');
        
        if($this->session->userdata('role_id') != SUPER_ADMIN){
            $this->db->where('AY.school_id', $this->session->userdata('school_id'));
        }
        
        if($school_id && $this->session->userdata('role_id') == SUPER_ADMIN){
            $this->db->where('AY.school_id', $school_id);
        }
        
        $this->db->where('S.status', 1);
        $this->db->order_by('AY.id', 'ASC');
        return $this->db->get()->result();
        
    }
        
    function duplicate_check($session_year, $school_id, $id = null ){           
           
        if($id){
            $this->db->where_not_in('id', $id);
        }
        $this->db->where('school_id', $school_id);
        $this->db->where('session_year', $session_year);
        return $this->db->get('academic_years')->num_rows();            
    }
}

Filemanager

Name Type Size Permission Actions
Administrator_Model.php File 4.26 KB 0777
Emailsetting_Model.php File 1.53 KB 0777
Emailtemplate_Model.php File 1.41 KB 0777
Feedback_Model.php File 1.04 KB 0777
Openinghour_Model.php File 1.54 KB 0777
Payment_Model.php File 1.53 KB 0777
Role_Model.php File 739 B 0777
School_Model.php File 1.72 KB 0777
Setting_Model.php File 759 B 0777
Sms_Model.php File 1.5 KB 0777
Smstemplate_Model.php File 1.38 KB 0777
Superadmin_Model.php File 1.27 KB 0777
Year_Model.php File 1.28 KB 0777
index.html File 131 B 0777