File "academic.php"

Full Path: /home/ichhrkpd/public_html/application/third_party/academic.php
File size: 5 KB
MIME-type: text/x-php
Charset: utf-8

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

class Academic extends GSController {
	
	
	function __construct() {
		parent::__construct ();
		//$this->CheckSession(true);
	}
	
	public function teachers(){
		$pdata = array();
		
		$query_tr_data = "SELECT * FROM teachers WHERE type='T' ORDER BY rank ASC;";
		$records_tr_data = $this->db->query($query_tr_data);
		$tr_data = $records_tr_data->result();
		
		if (is_array($tr_data) || is_object($tr_data)){
			$pdata['tr_data'] = $tr_data;
		}else{
			$pdata['tr_data'] = array();
		}
		//GPrint($tr_data);die;
		
		$pdata['LoadViews'] = "teachers";
		$this->LoadView($pdata);	
		
	}
	
    public function std_info_check(){
        
        die;
		//$pdata = array();
		
		//$uriData = $this->GetUriArray();
	    //$msg = '';
		//if(isset($uriData['error']) && !empty($uriData['error'])){
		//	$msg = $uriData['error'];
		//} 
		$in='';
		if($this->session->flashdata('in')){
		    	$in = $this->session->flashdata('in');
		}
	
	
	    $pdata['in'] = $in;
		$pdata['LoadViews'] = "std_info_check";
		$this->LoadView($pdata);	
		
	}
	
	public function std_info(){
	    die;
		$pdata = array();
	
	     $pdata['title'] = "Student's Info";
         if($this->input->post('submit')){
            $reg_id = $this->input->post('reg_id',TRUE);
            $mobile = $this->input->post('mobile',TRUE); 
            
         }
         else{
            redirect("academic/std_info_check");die; 
         }
         
        $query_std = "SELECT st.std_reg, st.std_roll, st.std_session, st.sub_ids, st.opt_ids, st.name, st.fname, st.mname, bt.batch_id, bt.batch_year, bt.year_no, bt.batch_group FROM students as st
                        LEFT JOIN batch as bt ON bt.batch_id=st.batch_id
                        WHERE st.std_reg=$reg_id AND st.std_mobile=$mobile";
		$records = $this->db->query($query_std);
		$stdinfo = $records->result();
	
	    
	    if(empty($stdinfo)){
	        $this->session->set_flashdata('in',1);
	        redirect("academic/std_info_check");die;
	    }
	   
		
		$sub_ids = $stdinfo[0]->sub_ids;
		
		//GPrint($stdinfo[0]->sub_ids); die;
		
		$query_sbj = "SELECT sub_id, sub_title FROM subjects 
                        WHERE sub_id IN (".$stdinfo[0]->sub_ids.");";
                        
		$records1 = $this->db->query($query_sbj);
		$subinfo = $records1->result();
	    //GPrint($stdinfo); GPrint($subinfo); die;
		//echo ($reg_id);
		//echo ($mobile);
		$pdata['stdinfo']=$stdinfo;
		$pdata['subinfo']=$subinfo;
	
		$pdata['LoadViews'] = "std_info";
		$this->LoadView($pdata);	
		
	}
	
	
	
	
	public function syl_science(){
		$pdata = array();
		$content_all = array();
		$this->load->model("database/Mcontent");
		$this->Mcontent->cid(1);
		if($this->Mcontent->Select()){
		    $content_all = $this->Mcontent;
		}
	
		if(empty($content_all)){
			$content_all = array();
		}
	
		$pdata['content_all'] = $content_all;
		//GPrint($content_all);die;
		$pdata['LoadViews'] = "syl_science";
		$this->LoadView($pdata);	
		
	}
	
	public function syl_arts(){
		$pdata = array();
		$content_all = array();
		$this->load->model("database/Mcontent");
		$this->Mcontent->cid(1);
		if($this->Mcontent->Select()){
		    $content_all = $this->Mcontent;
		}
	
		if(empty($content_all)){
			$content_all = array();
		}
	
		$pdata['content_all'] = $content_all;
		//GPrint($content_all);die;
		$pdata['LoadViews'] = "syl_arts";
		$this->LoadView($pdata);	
		
	}
	
	public function syl_commerce(){
		$pdata = array();
		$content_all = array();
		$this->load->model("database/Mcontent");
		$this->Mcontent->cid(1);
		if($this->Mcontent->Select()){
		    $content_all = $this->Mcontent;
		}
	
		if(empty($content_all)){
			$content_all = array();
		}
	
		$pdata['content_all'] = $content_all;
		//GPrint($content_all);die;
		$pdata['LoadViews'] = "syl_commerce";
		$this->LoadView($pdata);	
		
	}
	
	public function calendar(){
		$pdata = array();
		$content_all = array();
		$this->load->model("database/Mcontent");
		$this->Mcontent->cid(1);
		if($this->Mcontent->Select()){
		    $content_all = $this->Mcontent;
		}
	
		if(empty($content_all)){
			$content_all = array();
		}
	
		$pdata['content_all'] = $content_all;
		//GPrint($content_all);die;
		$pdata['LoadViews'] = "aca_cal";
		$this->LoadView($pdata);	
		
	}
	
	public function rules(){
		$pdata = array();
			$content_all = array();
		$this->load->model("database/Mcontent");
		$this->Mcontent->cid(1);
		if($this->Mcontent->Select()){
		    $content_all = $this->Mcontent;
		}
	
		if(empty($content_all)){
			$content_all = array();
		}
	
		$pdata['content_all'] = $content_all;
		//GPrint($content_all);die;
		$pdata['LoadViews'] = "rules";
		$this->LoadView($pdata);	
		
	}
	
	
		
	private function LoadView($rData) {
		$this->load->view("common_view",$rData);
	}
	
	private  function LoadPanel($rData){
		$this->load->view("userBody",$rData);
	}
	


}
?>