<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Super_admin_user_rights
 *
 * @author zmq163
 */
class Super_admin_user_rights extends CI_Model{
    //put your code here
    var $mdb;
    public function __construct() {
        parent::__construct();
        $this->mdb=  $this->load->database('mdb',TRUE);
    }
    /**
     * 
     * 
     * 
     * 
     */
    public function getSuperAdminRignt(){
        $this->mdb->select('*');
        $this->mdb->from('sadmin_app_rights');
        return $this->getData($this->mdb->get());
    }
    /**
     * 
     * 
     * 
     * 
     */
    public function mappinApplicationRight($_mapping_batch_array=NULL){
        if($_mapping_batch_array!=NULL){
            $this->mdb->insert_batch('mapping_app_rights',$_mapping_batch_array);
            return ($this->mdb->affected_rows() != 1) ? FALSE : TRUE;
        }
    }
    
    /**
     * 
     * 
     * 
     * 
     * 
     */
    private function getData($_query=NULL){
        if($_query!=NULL){
            return $_query->result_array(); 
        }  else {
            return FALSE;
        }
    }
}
