<?php
    //error_reporting(E_ERROR | E_WARNING | E_PARSE);
    //ini_set("error_reporting","E_ALL & ~E_NOTICE"); 
    header("Content-Type: text/html;charset=utf-8");
    define('DB_HOST','127.0.0.1');
    define('DB_USER','root');
    define('DB_PASS','123456');
    define('DB_DATA','wuye');

/*  define('DB_HOST','weblexue027.gotoftp2.com');
    define('DB_USER','weblexue027');
    define('DB_PASS','23a34mkq');
    define('DB_DATA','weblexue027');*/
    
    define('DB_TablePre','site_');
    define('CO_SitePath','/');
    class dbo{
        function dbo()
        {
            $config = array (

                    'dbconfig' => 
                          array (
                            'db_host_name' => '10.220.232.72/ccnu',
                            'db_user_name' => 'erweima',
                            'db_password' => 'erweima',
                             
                          ),
                );
                //返回值  
                $arr_result = array(); 
                $arr_result['result'] = 'false';  //true false 为黑名单
                $arr_result['callerid'] = $callerid;  
                 
                //取数据库参数
                $db_host_name=$config['dbconfig']['db_host_name']; //'localhost/ORCL''
                $db_user_name=$config['dbconfig']['db_user_name'];//'asgr'
                $db_pwd=$config['dbconfig']['db_password']; //'asgr'
                 //连接Oracle
                $conn = oci_connect($db_user_name,$db_pwd,$db_host_name);//oci_connect('asgr','asgr','localhost/ORCL');
                if (!$conn) { 
                    $e = oci_error(); 
                    //print htmlentities($e['message']); 
                    //WriteLog("连接Oracle时出错,oci_connect(".$db_user_name.",".$db_pwd.",".$db_host_name.")  ".htmlentities($e['message']));
                    $arr_result['result'] = 'false';
                    echo json_encode($arr_result);  //默认为不是黑名单
                    return;
                } 
                else {
                    echo("连接成功！");
                }

       }
       





      /* function query($sql)
       {
          $this->sql=$sql;        
          $result=mysql_query($this->sql,$this->conn);
          $this->res=$result;
          $this->result=$result;
          return $result;
       }
       */
     /*
     *说明：插入记录函数，该函数将返回插入记录的ID
     *参数：$table = 表名
     *     $array = 二维数组   该数组键为数据表字段名，其值为该字段所对应的值
     */
   /*  public function insert($table,$array){
         $field = '';
         $value = '';
        if( !is_array($array) || count($array)<=0) {
            $this->show_error("Sql插入数据错误","没有要插入的数据！");
            return false;
        }
         for(reset($array);$i=key($array);next($array)){
             $field .= ','.$i;
             $value .= ',\''.$array[$i].'\'';
         }
         $sql = 'Insert INTO '.$table.'('.substr($field,1).') VALUES('.substr($value,1).')';
         $this->query($sql);
         return @mysql_insert_id();
         //return $sql;
     }*/

    /* public function insert_sql($table,$array){
         $field = '';
         $value = '';
        if( !is_array($array) || count($array)<=0) {
            $this->show_error("Sql插入数据错误","没有要插入的数据！");
            return false;
        }
         for(reset($array);$i=key($array);next($array)){
             $field .= ','.$i;
             $value .= ',\''.$array[$i].'\'';
         }
         $sql = 'Insert INTO '.$table.'('.substr($field,1).') VALUES('.substr($value,1).')';
         //$this->query($sql);
         //return @mysql_insert_id();
         return $sql;
     }
     */
     
     /*
     *说明：更新记录函数
     *参数：$table = 表名
     *     $array = 二维数组   该数组键为数据表字段名，其值为该字段所对应的值
     *     $condition = 更新条件   'user=\''.$user.'\''
     */
     /*public function update($table,$array,$condition){
         $field = '';
        if( !is_array($array) || count($array)<=0) { $this->show_error("Sql更新数据错误","没有要更新的数据！");    return false;}
         for(reset($array);$i=key($array);next($array)) $field .= ','.$i.'=\''.$array[$i].'\'';
         $sql = 'Update '.$table.' SET '.substr($field,1).' Where '.$condition;
         $this->query($sql);
         //return $sql;
     }*/
     
        // 取得结果数据
       /* public function result(){return mysql_result($str);}
        
        // 取得记录集,获取数组-索引和关联,使用$row['content']
        public function fetch_array($t=MYSQL_BOTH){return mysql_fetch_array($this->result,$t);}
        
        // 获取关联数组,使用$row['字段名']
        public function fetch_assoc(){return mysql_fetch_assoc($this->result);}
        
        // 获取数字索引数组,使用$row[0],$row[1],$row[2]
        public function fetch_row(){return mysql_fetch_row($this->result);}
        
        // 获取对象数组,使用$row->content 
        public function fetch_obj(){return mysql_fetch_object($this->result);}
        
        // 取得上一步 INSERT 操作产生的 ID
        public function insert_id(){return mysql_insert_id();}

       
        // 释放结果集
        public function free(){@mysql_free_result($this->result);}
        
        // 关闭数据库
        public function close(){mysql_close($this->conn);}*/
    }

    $listNumberA = 6;   //新闻列表每页数量
    $listNumberB = 9;   //图片(产品)列表每页数量
    $listNumberC = 15;  //下载列表每页数量
    $listNumberD = 15;  //招聘信息列表每页数量
    require 'lib/function.php';
?>