function GetStudentInfo($zkzh)
 {
     $sql = "select * from t_StudentInfo where zkzh='{$zkzh}'";
     $sqlHelper = new SqlHelper();
     $arr = $sqlHelper->execute_dql2($sql);
     $sqlHelper->close_connect();
     // 二次封装,$arr=>StudentInfo对象实例
     $studentInfo = new StudentInfo();
     if (count($arr) > 0) {
         $studentInfo->setZkzh($arr[0]['zkzh']);
         $studentInfo->setName($arr[0]['name']);
         $studentInfo->setSex($arr[0]['sex']);
         $studentInfo->setKslb($arr[0]['kslb']);
         $studentInfo->setZzmm($arr[0]['zzmm']);
         $studentInfo->setNation($arr[0]['nation']);
         $studentInfo->setByxx($arr[0]['byxx']);
         $studentInfo->setHkszd($arr[0]['hkszd']);
         $studentInfo->setAddress($arr[0]['address']);
         $studentInfo->setTelephone($arr[0]['telephone']);
         $studentInfo->setZcxx($arr[0]['zcxx']);
         $studentInfo->setCardNumber($arr[0]['cardNumber']);
         $studentInfo->setXjh($arr[0]['xjh']);
         $studentInfo->setGysznj($arr[0]['gysznj']);
         $studentInfo->setGesznj($arr[0]['gesznj']);
         $studentInfo->setGssznj($arr[0]['gssznj']);
         $studentInfo->setMemo($arr[0]['memo']);
         $studentInfo->setPhoto($arr[0]['photo']);
     }
     return $studentInfo;
 }
Ejemplo n.º 2
0
     $studentInfo->setGesznj($array_studentInfo['gesznj']);
     $studentInfo->setGssznj($array_studentInfo['gssznj']);
     $studentInfo->setMemo($array_studentInfo['memo']);
     $photo = "/upload/NoImage.jpg";
     if ($_FILES['photo']['name'] != '') {
         /*--  实例化上传类  --*/
         $file = $_FILES['photo'];
         $upload_path = '../upload';
         $allow_type = array('jpg', 'bmp', 'png', 'gif', 'jpeg');
         $max_size = 2048000;
         $upload = new upFiles($file, $upload_path, $max_size, $allow_type);
         $upload->upload();
         $pic = $upload->getSaveFileInfo();
         $photo = substr($pic['path'], 2) . "/" . $pic['savename'];
     }
     $studentInfo->setPhoto($photo);
     //完成添加->数据库
     $res = $studentInfoService->AddStudentInfo($studentInfo);
     if ($res == 1) {
         header("Location: /ok.php");
         exit;
     } else {
         //失败
         header("Location: /error.php");
         exit;
     }
 } else {
     if ($action == "query") {
         //查询学生信息信息
         require_once '../service/StudentInfoService.class.php';
         require_once '../service/FenyePage.class.php';