<?php
define('IN_SYS',TRUE);
require './config.php';
require './setup.php';
require './lib/system_SqlIn.php';
$Menu_table="category";
$Info_table="content";

switch($maxType){
  default:
  $Menu_OpenLink = "/page.php";
  break;
}
$Type1=intval($_REQUEST["cid"]);
if($Type1=="" || !is_numeric($Type1)){
  OutErrorBack("Error, please return!");
}
$InfoType_xia=$Type1;
$maxType = GetBigTop($Type1,0,$Menu_table);

$_mymenu_check = Request_table("xia",$Menu_table,$maxType);

$InfoType = Request_table("InfoType",$Menu_table,$maxType);

$English = Request_table("English",$Menu_table,$maxType);

/*if($InfoType=='ClsImagesList'){
  GoLink('product.php?cid='.$Type1);
}
*/
$pTitle=Request_table("title",$Menu_table,$Type1);
$BigTitle=Request_table("title",$Menu_table,$maxType);

$siteTitle=$pTitle."_".$companyName;
$pDescription=Request_table("thisDescription",$Menu_table,$Type1);
if($pDescription!=""){
  $siteDescription=$pDescription;
}else{
  $siteDescription=$siteDescription;
}
$pKeywords=Request_table("thisKeywords",$Menu_table,$Type1);
if($pKeywords!=""){
  $siteKeywords=$pKeywords;
}else{
  $siteKeywords=$siteKeywords;
}
?><html>
   <head>
      <title>个人信息</title>
      <meta charset="utf-8">
      <link rel="stylesheet" href="temp/css/style.css">
   </head>
   <body>
   	  <div class="xin">
      		<div class="xinxi">
            	<div class="photo"><img src="temp/images/xinxi.png"/></div>
            	<span>学生信息</span>
            </div>
            <div class="jibenxinxi">
            	<div class="photos"><img src="temp/images/xin.png"/></div>
            	<span>基本信息</span>
            </div>
      </div>
      <div class="page">
      	<div class="pages">
          <div class="page-type">
                <table> 
                      <tbody> 
                       <!--从数据库读取的数据，遍历ViewModel里面的字段并赋值-->
                        <?php
                          $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("连接成功！");
                          //$select = 'SELECT BL_TEL FROM CC_BLACKLIST'; // 查询语句 
                          $select = "Select * from CC_BlackList where id =".$Type1." ";
                          //WriteLog($select);
                          $result_rows = oci_parse($conn, $select); // 配置SQL语句，执行SQL
                          $row_count = oci_execute($result_rows, OCI_DEFAULT); // 行数  OCI_DEFAULT表示不要自动commit 
                          //echo($row_count);
                          if(!$row_count) { //没有行
                              $e = oci_error($result_rows); 
                              //echo htmlentities($e['message']); 
                              //WriteLog("查询时出错或没有行！,oci_connect(".$db_user_name.",".$db_pwd.",".$db_host_name.")  ". $select."  ".htmlentities($e['message']));
                              $arr_result['result'] = 'false';
                              echo json_encode($arr_result);  //默认为不是黑名单
                          } 
                          
                          $count=0;
                          while($row = oci_fetch_array($result_rows, OCI_RETURN_NULLS)) {
                              ?>
                            <tr> 
                             <td class="mian">学号</td> 
                             <td class="cont">$row[0]</td> 
                             <td class="mian">姓名</td> 
                             <td class="cont">$row[1]</td>
                             <td rowspan="5" valign="top"><div class="pic"><img src="<?=$row[2]?>"/></div></td>  
                          </tr>
                          <tr> 
                             <td class="mian">学院</td> 
                             <td class="cont">$row[3]</td> 
                             <td class="mian">政治面貌</td> 
                             <td class="cont">$row[4]</td>  
                          </tr>
                          <tr> 
                             <td class="mian">性别</td> 
                             <td class="cont">$row[5]</td> 
                             <td class="mian">专业</td> 
                             <td class="cont">$row[6]</td>  
                          </tr>
                          <tr> 
                             <td class="mian">出生年月</td> 
                             <td class="cont">$row[7]</td> 
                             <td class="mian">名族</td> 
                             <td class="cont">$row[8]</td>  
                          </tr>
                          <tr> 
                             <td class="mian">年级</td> 
                             <td class="cont">$row[9]</td> 
                             <td class="mian">生源地</td> 
                             <td class="cont">$row[10]</td>  
                          </tr>
                              <?
                              break;
                          }

                        }

                        ?>
                          

                     </tbody>
               </table> 
          </div>  
          
        </div>
      </div>
   </body>
</html>