Ejemplo n.º 1
0
<?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();
Ejemplo n.º 2
0
<?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'];
Ejemplo n.º 3
0
<?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) {
Ejemplo n.º 4
0
 *         ┃        ┏┛
 *         ┗┓┓┏━┳┓┏┛ + + + +
 *          ┃┫┫ ┃┫┫
 *          ┗┻┛ ┗┻┛+ + + +
 */
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();