<?php

/**
 *      【橙创家校通v4.0】 (C)2010-2012 Tuntron Inc.
 *      
 *    	 http://www.tuntron.com   QQ：1121251729
 *
 *      &用户组基类文件&
 */
 
if (!defined('IS_RUN')) die('Forbidden');

class tj_access extends tj_model {

    var $table = 'dbpre_access';
    var $key = 'name';

    function __construct() {
        parent::__construct();
        $this->init_field();
    }

    function tj_access() {
        $this->__construct();
    }

    function init_field() {
        $this->add_field('name,action,type,cate,des');
        $this->add_field_fun('name,action,type,cate,des', '_T');
    }
	
	function read_all($type,$cate) {
        $this->db->from($this->table);
		if($type) $this->db->where('type', $type);
		if($cate) $this->db->where('cate', $cate);
		$this->db->select('name,action,type,cate,des');
        return $this->db->fetch_all_assoc();
    }

    function write_cache() {
   
    }

    function check_post(& $post, $edit = FALSE) {
       
    }
}
?>