[ Avaa Bypassed ]




Upload:

Command:

www-data@18.216.67.249: ~ $
<?php

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

class Classes_Model extends MY_Model {
    
    function __construct() {
        parent::__construct();
    }
    
     public function get_class_list($school_id = null){
        
        $this->db->select('C.*, S.school_name, T.name AS teacher');
        $this->db->from('classes AS C');
        $this->db->join('teachers AS T', 'T.id = C.teacher_id', 'left');
        $this->db->join('schools AS S', 'S.id = C.school_id', 'left');
        
        if($this->session->userdata('role_id') != SUPER_ADMIN){
            $this->db->where('C.school_id', $this->session->userdata('school_id'));
        }
        
        if($this->session->userdata('role_id') == SUPER_ADMIN && $school_id){
            $this->db->where('C.school_id', $school_id);
        }
        
        $this->db->where('S.status', 1);
        
        return $this->db->get()->result();
        
    }
    

    
    function duplicate_check($school_id, $name, $id = null ){           
           
        if($id){
            $this->db->where_not_in('id', $id);
        }
        $this->db->where('name', $name);
        $this->db->where('school_id', $school_id);
        return $this->db->get('classes')->num_rows();            
    }
}

Filemanager

Name Type Size Permission Actions
Assignment_Model.php File 4.52 KB 0777
Classes_Model.php File 1.3 KB 0777
Liveclass_Model.php File 4.32 KB 0777
Material_Model.php File 2.01 KB 0777
Promotion_Model.php File 1.01 KB 0777
Routine_Model.php File 1.7 KB 0777
Section_Model.php File 2.3 KB 0777
Subject_Model.php File 2.36 KB 0777
Submission_Model.php File 5.79 KB 0777
Syllabus_Model.php File 2.21 KB 0777
index.html File 131 B 0777