Exemplo n.º 1
0
/**
*
*@file        ajax.php
*@author      xieyoujiang
*@data        2016年1月30日
*@language    PHP
*@e-mail      xie_youjiang@163.com
*@copyright(c) 扬州格佳科技有限公司
*
*/
require_once './classpackage/Db.class.php';
if (isset($_GET['id'])) {
    $strUserSql = "select f_id,f_username,f_password,f_fullname,f_phone,f_rank,f_head,f_head_phone,f_boss_phone,f_time,f_last_login,f_last_ip,f_last_time from t_users where f_id = ?";
    $strRankSql = "select f_id,f_title from t_rank where f_type=1";
    $strBossSql = "select f_id,f_fullname from t_head where f_boss>0";
    $rsUser = DbOperator::querySql($strUserSql, array($_GET['id']));
    $rsRank = DbOperator::queryAll($strRankSql);
    $rsBoss = DbOperator::queryAll($strBossSql);
    $rsUser['rank'] = $rsRank;
    $rsUser['boss'] = $rsBoss;
    echo json_encode($rsUser, JSON_UNESCAPED_UNICODE);
} else {
    if (isset($_GET['active']) && $_GET['active'] == "addStaff") {
        $strRankSql = "select f_id,f_title from t_rank where f_type=1";
        $strBossSql = "select f_id,f_fullname from t_head where f_boss>0";
        $rsRank = DbOperator::queryAll($strRankSql);
        $rsBoss = DbOperator::queryAll($strBossSql);
        $rs['rank'] = $rsRank;
        $rs['boss'] = $rsBoss;
        echo json_encode($rs, JSON_UNESCAPED_UNICODE);
    }
Exemplo n.º 2
0
 public static function getByName($userName)
 {
     try {
         $strSql = "select f_rank, f_fullname from t_users where f_username= '******'";
         $bRet = DbOperator::querySql($strSql);
         return $bRet;
     } catch (Exception $e) {
         print "Error: " . $e->getMessage() . "<br/>";
         die;
     }
 }