<?php include_once 'common/class.dbconnection.php'; include_once 'common/class.errorconfig.php'; include_once 'common/config.define.php'; include_once 'common/class.token.php'; include_once 'common/functions.php'; /********************测试代码*******************************/ /**********************************************************/ $result = new ErrorConfig(); if (!isset($_GET['action'])) { $result->outputErrResult('002'); } switch ($_GET['action']) { /* * 成绩录入 */ case 'giveGrade': if (!array_key_exists('user_id', $_POST) || !array_key_exists('lesson_id', $_POST) || !array_key_exists('theory_score', $_POST) || !array_key_exists('practical_score', $_POST) || !array_key_exists('communicate_ability', $_POST) || !array_key_exists('study_ability', $_POST) || !array_key_exists('study_attitube', $_POST) || !array_key_exists('innovation', $_POST)) { $result->outputErrResult('001'); } $user_id = $_POST['user_id']; $lesson_id = $_POST['lesson_id']; $theory_score = $_POST['theory_score']; $practical_score = $_POST['practical_score']; $communicate_ability = $_POST['communicate_ability']; $study_ability = $_POST['study_ability']; $study_attitube = $_POST['study_attitube']; $innovation = $_POST['innovation']; //检查学习关系是否存在 $db = new WebTrainDBConnection();
<?php include_once 'common/class.dbconnection.php'; include_once 'common/class.errorconfig.php'; include_once 'common/config.define.php'; include_once 'common/class.token.php'; include_once 'common/functions.php'; /********************测试代码*******************************/ /**********************************************************/ $result = new ErrorConfig(); if (!isset($_GET['action'])) { $result->outputErrResult('002'); } switch ($_GET['action']) { /* * 添加资源 */ case 'addRes': //检查参数 if (!array_key_exists('resource_name', $_POST) || !array_key_exists('resource_type', $_POST) || !array_key_exists('resource_tag', $_POST) || !array_key_exists('instruction', $_POST) || !array_key_exists('user_id', $_POST)) { $result->outputErrResult('001'); } $user_id = $_POST['user_id']; $resource_name = $_POST['resource_name']; $resource_type = $_POST['resource_type']; $resource_tag = $_POST['resource_tag']; $instruction = $_POST['instruction']; $db = new WebTrainDBConnection(); //检查用户是否通过验证 $userRS = $db->query("SELECT user_id,user_name FROM pineapple_user WHERE user_id='{$user_id}' AND active=1 AND user_type=2 LIMIT 1"); if (!$userRS) {
* ┃┫┫ ┃┫┫ * ┗┻┛ ┗┻┛+ + + + */ include_once 'common/class.dbconnection.php'; include_once 'common/class.errorconfig.php'; include_once 'common/class.pineapple.phpmailer.php'; include_once 'common/config.define.php'; include_once 'common/class.token.php'; include_once 'common/functions.php'; session_start(); /********************测试代码*******************************/ //$_SESSION['authnum'] = '2222'; /**********************************************************/ $result = new ErrorConfig(); if (!isset($_GET['action'])) { $result->outputErrResult('002'); } switch ($_GET['action']) { /* * 登陆 */ case 'loginPost': //检查参数 if (!array_key_exists('user', $_POST) || !array_key_exists('password', $_POST)) { $result->outputErrResult('001'); } $user = $_POST['user']; $password = md5($_POST['password']); $db = new WebTrainDBConnection(); $userRS = $db->query("SELECT user_pwd,user_type,user_id,token FROM pineapple_user WHERE user_name='{$user}' LIMIT 1"); if (!$userRS) {
<?php include_once 'common/class.dbconnection.php'; include_once 'common/class.errorconfig.php'; include_once 'common/config.define.php'; include_once 'common/class.token.php'; include_once 'common/functions.php'; /********************测试代码*******************************/ /*session_start(); $_SESSION['identify_number'] = '3112000729';*/ /**********************************************************/ $result = new ErrorConfig(); if (!isset($_GET['action'])) { $result->outputErrResult('002'); } switch ($_GET['action']) { /* * 行业信息添加 */ case 'addNews': if (!array_key_exists('title', $_POST) || !array_key_exists('from', $_POST) || !array_key_exists('contents', $_POST) || !array_key_exists('author', $_POST) || !array_key_exists('type', $_POST)) { $result->outputErrResult('001'); } //获取session session_start(); if (!array_key_exists('identify_number', $_SESSION)) { session_destroy(); $result->outputErrResult('601'); } $identify_number = $_SESSION['identify_number']; $title = $_POST['title'];
<?php include_once 'common/class.dbconnection.php'; include_once 'common/class.errorconfig.php'; include_once 'common/config.define.php'; include_once 'common/class.token.php'; include_once 'common/functions.php'; include_once 'common/class.phpqrcode.php'; /********************测试代码*******************************/ /**********************************************************/ $result = new ErrorConfig(); if (!isset($_GET['action'])) { $result->outputErrResult('002'); } switch ($_GET['action']) { /* * 添加课程 */ case 'addLesson': //检查参数 session_start(); if (!array_key_exists('lesson_name', $_POST) || !array_key_exists('subject', $_POST) || !array_key_exists('address', $_POST) || !array_key_exists('lesson_start', $_POST) || !array_key_exists('lesson_hours', $_POST) || !array_key_exists('lesson_price', $_POST) || !array_key_exists('instruction', $_POST)) { $result->outputErrResult('001'); } if (!array_key_exists('user_id', $_SESSION)) { $result->outputErrResult('007'); } $user_id = $_SESSION['user_id']; $lesson_name = $_POST['lesson_name']; $subject = $_POST['subject']; $address = $_POST['address'];