本文整理汇总了PHP中Base_Common类的典型用法代码示例。如果您正苦于以下问题:PHP Base_Common类的具体用法?PHP Base_Common怎么用?PHP Base_Common使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Base_Common类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 环境初始化
* @param array $config
* @return void
*/
public static function init(array $config = null)
{
if (is_array($config)) {
self::$config = array_merge(self::$config, $config);
}
/**
* 设置自动载入函数
*/
if (self::$config['autoload']) {
if (function_exists('__autoload')) {
spl_autoload_register('__autoload');
}
spl_autoload_register(array('Base_Common', 'autoload'));
}
/**
* GPC
*/
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$_GET = self::stripslashesRecursive($_GET);
$_POST = self::stripslashesRecursive($_POST);
$_COOKIE = self::stripslashesRecursive($_COOKIE);
reset($_GET);
reset($_POST);
reset($_COOKIE);
}
/**
* 设置异常抛出
*/
set_exception_handler(array('Base_Common', 'exceptionHandle'));
/**
* 设置时区
*/
date_default_timezone_set(self::$config['timezone']);
}
开发者ID:032404cxd,项目名称:xrace_main,代码行数:39,代码来源:Common.php
示例2: indexAction
public function indexAction()
{
//检查权限
$PermissionCheck = $this->manager->checkMenuPermission(0);
if ($PermissionCheck['return']) {
$SexList = $this->oUser->getSexList();
$AuthStatusList = $this->oUser->getAuthStatus();
$AuthIdTypesList = $this->oUser->getAuthIdType();
$params['Sex'] = isset($SexList[strtoupper(trim($this->request->Sex))]) ? substr(strtoupper(trim($this->request->Sex)), 0, 8) : "";
$params['Name'] = urldecode(trim($this->request->Name)) ? substr(urldecode(trim($this->request->Name)), 0, 8) : "";
$params['NickName'] = urldecode(trim($this->request->NickName)) ? substr(urldecode(trim($this->request->NickName)), 0, 8) : "";
$params['AuthStatus'] = isset($AuthStatusList[strtoupper(trim($this->request->AuthStatus))]) ? substr(strtoupper(trim($this->request->AuthStatus)), 0, 8) : "";
$params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1;
$params['PageSize'] = 5;
$params['getCount'] = 1;
$UserList = $this->oUser->getUserLst($params);
//导出EXCEL链接
$export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'user.list.download', $params) . "><导出表格></a>";
//翻页参数
$page_url = Base_Common::getUrl('', 'xrace/user', 'index', $params) . "&Page=~page~";
$page_content = base_common::multi($UserList['UserCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页');
foreach ($UserList['UserList'] as $UserId => $UserInfo) {
echo $UserInfo['auth_state'] . "<br>";
$UserList['UserList'][$UserId]['sex'] = isset($SexList[$UserInfo['sex']]) ? $SexList[$UserInfo['sex']] : "保密";
$UserList['UserList'][$UserId]['AuthStatus'] = isset($AuthStatusList[$UserInfo['auth_state']]) ? $AuthStatusList[$UserInfo['auth_state']] : "未知";
$UserList['UserList'][$UserId]['AuthStatus'] = $UserInfo['auth_state'] == "AUTHED" && isset($AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))]) ? $UserList['UserList'][$UserId]['AuthStatus'] . "/" . $AuthIdTypesList[strtoupper(trim($UserInfo['id_type']))] : $UserList['UserList'][$UserId]['AuthStatus'];
$UserList['UserList'][$UserId]['Birthday'] = is_null($UserInfo['birth_day']) ? "未知" : $UserInfo['birth_day'];
}
include $this->tpl('Xrace_User_UserList');
} else {
$home = $this->sign;
include $this->tpl('403');
}
}
开发者ID:eappl,项目名称:admin_prototype,代码行数:34,代码来源:UserController.php
示例3: pageViewAction
/**
*问题浏览量更新
*/
public function pageViewAction()
{
//基础元素,必须参与验证
$View['PageId'] = abs(intval($this->request->PageId));
$View['ViewIP'] = urldecode(trim($this->request->ViewIP));
$View['Time'] = abs(intval($this->request->Time));
//URL验证码
$sign = $this->request->sign;
//私钥,以后要移开到数据库存储
$p_sign = '5173';
$sign_to_check = base_common::check_sign($View, $p_sign);
//不参与验证的元素
//验证URL是否来自可信的发信方
if ($sign_to_check == $sign) {
//验证时间戳,时差超过600秒即认为非法
if (abs($View['Time'] - time()) <= 600) {
$View['ViewIP'] = Base_Common::ip2long($View['ViewIP']);
$InsertLog = $this->oView->addViewLog($View);
if ($InsertLog) {
$result = array('return' => 1, 'comment' => "添加成功");
} else {
$result = array('return' => 2, 'comment' => "添加失败");
}
} else {
$result = array('return' => 0, 'comment' => "时间有误");
}
} else {
$result = array('return' => 0, 'comment' => "验证失败,请检查URL");
}
echo json_encode($result);
}
开发者ID:eappl,项目名称:prototype,代码行数:34,代码来源:ViewController.php
示例4: insert
public function insert()
{
$result = Base_Common::pputHttpSQS($this->getDbTable(), $this->logArr);
if (!$result) {
$fp = fopen(Base_Common::$config['vars_dir'] . 'error.log', 'a+');
fwrite($fp, var_export($this->logArr, true));
fclose($fp);
}
}
开发者ID:eappl,项目名称:prototype,代码行数:9,代码来源:Web.php
示例5: insertPvAction
/**
*账号生成
*/
public function insertPvAction()
{
//基础元素,必须参与验证
$PV['PageId'] = abs(intval($this->request->PageId));
$PV['Time'] = abs(intval($this->request->Time));
$PV['IP'] = $this->request->IP ? $this->request->IP : "127.0.0.1";
$PV['Browser'] = $this->request->Browser;
$PV['UserSourceId'] = abs(intval($this->request->UserSourceId));
$PV['UserSourceDetail'] = abs(intval($this->request->UserSourceDetail));
$PV['UserSourceProjectId'] = abs(intval($this->request->UserSourceProjectId));
$PV['UserSourceActionId'] = abs(intval($this->request->UserSourceActionId));
$PV['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
//URL验证码
$sign = $this->request->sign;
//私钥,以后要移开到数据库存储
$p_sign = 'lm';
$sign_to_check = base_common::check_sign($PV, $p_sign);
//不参与验证的元素
$PV['IP'] = Base_Common::ip2long($PV['IP']);
//验证URL是否来自可信的发信方
if ($sign_to_check == $sign) {
//验证时间戳,时差超过600秒即认为非法
if (abs($PV['Time'] - time()) <= 600) {
unset($PV['ReturnType']);
if ($PV['UserSourceId'] == 9 && $PV['UserSourceDetail'] == 24) {
$insertLog = true;
} else {
$insertLog = $this->oPV->insertPvLog($PV);
}
if ($insertLog) {
$result = array('return' => 1, 'comment' => "记录成功");
} else {
$result = array('return' => 0, 'comment' => "记录失败");
}
} else {
$result = array('return' => 2, 'comment' => "时间有误");
}
} else {
$result = array('return' => 2, 'comment' => "验证失败,请检查URL");
}
$PV['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
if ($PV['ReturnType'] == 1) {
echo json_encode($result);
}
}
开发者ID:eappl,项目名称:prototype,代码行数:48,代码来源:PvController.php
示例6: remove
/**
* 移除cookie
* @param string $key
* @param string $url
* @return void
*/
public static function remove($key, $url = null)
{
if (!isset($_COOKIE[$key])) {
return;
}
$path = '/';
if (!empty($url)) {
$parsed = parse_url($url);
$path = empty($parsed['path']) ? '/' : Base_Common::url(null, $parsed['path']);
}
if (is_array($_COOKIE[$key])) {
foreach ($_COOKIE[$key] as $name => $val) {
setcookie("{$key}[{$name}]", '', time() - 2592000, $path);
}
} else {
setcookie($key, '', time() - 2592000, $path);
}
}
开发者ID:eappl,项目名称:prototype,代码行数:24,代码来源:Cookie.php
示例7: getServerByIpAction
/**
*获取服务器列表登录
*/
public function getServerByIpAction()
{
//基础元素,必须参与验证
$Config['ServerIp'] = $this->request->ServerIp;
$Config['Time'] = abs(intval($this->request->Time));
$Config['ReturnType'] = $this->request->ReturnType ? $this->request->ReturnType : 2;
//URL验证码
$sign = trim($this->request->sign);
//私钥,以后要移开到数据库存储
$p_sign = 'lm';
$sign_to_check = Base_common::check_sign($Config, $p_sign);
//不参与验证的元素
//验证URL是否来自可信的发信方
if ($sign_to_check == $sign) {
//验证时间戳,时差超过600秒即认为非法
if (abs($Config['Time'] - time()) <= 600) {
if ($Config['ServerIp']) {
$ServerIp = Base_Common::ip2long($Config['ServerIp']);
$ServerInfo = $this->oServer->getByIp($ServerIp);
if ($ServerInfo['ServerId']) {
$result = array('return' => 1, 'ServerInfo' => $ServerInfo, 'comment' => '找到服务器');
} else {
$result = array('return' => 2, 'comment' => '你所查询的IP不属于任何服务器');
}
} else {
$result = array('return' => 0, 'comment' => "请输入服务器IP");
}
} else {
$result = array('return' => 0, 'comment' => "时间有误");
}
} else {
$result = array('return' => 0, 'comment' => "验证失败,请检查URL");
}
if ($Config['ReturnType'] == 1) {
echo json_encode($result);
} else {
$r = $result['return'] . "|" . iconv('UTF-8', 'GBK', $result['comment']);
if ($result['return'] == 1) {
$r = $r . "|" . $result['ServerInfo']['ServerId'] . "|" . iconv('UTF-8', 'GBK', $result['ServerInfo']['name']);
}
echo $r;
}
}
开发者ID:032404cxd,项目名称:prototype_main,代码行数:46,代码来源:ServerController.php
示例8: addSystemLog
public function addSystemLog($QuestionId, $AuthorName, $OperatorName, $LogTypeId, $LogText)
{
$LogType = $this->config->sys_log_arr;
$LogTypeId = intval($LogTypeId);
if (isset($LogType[$LogTypeId])) {
$tip = $LogType[$LogTypeId];
} else {
return false;
}
$QuestionId = intval($QuestionId);
//if($QuestionId == 0)
//{
// return false;
//}
$log_id = Base_Common::get_log_sn();
$message = $tip . $LogText;
$time = time();
$date = date("Ym", $time);
$table_to_process = Base_Widget::getDbTable($this->table) . "_" . $date;
$dataArr = array('id' => $log_id, 'AuthorName' => $AuthorName, 'qid' => $QuestionId, 'user' => $OperatorName, 'message' => $message, 'time' => $time);
return $this->db->insert($table_to_process, $dataArr);
}
开发者ID:eappl,项目名称:prototype,代码行数:22,代码来源:Common.php
示例9: authLogAction
public function authLogAction()
{
//检查权限
$PermissionCheck = $this->manager->checkMenuPermission(0);
if ($PermissionCheck['return']) {
//页面参数预处理
$params['StartDate'] = isset($this->request->StartDate) ? substr(strtoupper(trim($this->request->StartDate)), 0, 10) : date("Y-m-d", time());
$params['EndDate'] = isset($this->request->EndDate) ? substr(strtoupper(trim($this->request->EndDate)), 0, 10) : date("Y-m-d", time());
$params['AuthResult'] = isset($this->request->AuthResult) ? substr(strtoupper(trim($this->request->AuthResult)), 0, 8) : "";
$params['ManagerId'] = isset($this->request->ManagerId) ? intval($this->request->ManagerId) : 0;
//分页参数
$params['Page'] = abs(intval($this->request->Page)) ? abs(intval($this->request->Page)) : 1;
$params['PageSize'] = 2;
//获取用户列表时需要获得记录总数
$params['getCount'] = 1;
//获取实名认证记录的状态列表
$AuthLogIdStatusList = $this->oUser->getAuthLogStatusTypeList();
//获取所有管理员列表
$ManagerList = $this->manager->getAll('id,name');
//获取实名认证记录
$AuthLog = $this->oUser->getAuthLog($params);
//导出EXCEL链接
$export_var = "<a href =" . Base_Common::getUrl('', 'xrace/user', 'auth.log.download', $params) . "><导出表格></a>";
//翻页参数
$page_url = Base_Common::getUrl('', 'xrace/user', 'auth.log', $params) . "&Page=~page~";
$page_content = base_common::multi($AuthLog['AuthLogCount'], $page_url, $params['Page'], $params['PageSize'], 10, $maxpage = 100, $prevWord = '上一页', $nextWord = '下一页');
//初始化一个空的用户数组
$UserList = array();
foreach ($AuthLog['AuthLog'] as $AuthId => $LogInfo) {
//管理员账号
$AuthLog['AuthLog'][$AuthId]['ManagerName'] = isset($ManagerList[$LogInfo['op_uid']]) ? $ManagerList[$LogInfo['op_uid']]['name'] : "未知";
$AuthLog['AuthLog'][$AuthId]['AuthResultName'] = isset($AuthLogIdStatusList[$LogInfo['auth_result']]) ? $AuthLogIdStatusList[$LogInfo['auth_result']] : "未知";
// 如果管理员记录已经获取到
if (isset($UserList[$LogInfo['user_id']])) {
$ManagerInfo = $UserList[$LogInfo['user_id']];
} else {
$ManagerInfo = $this->oUser->getUserInfo($LogInfo['user_id'], "name");
}
$AuthLog['AuthLog'][$AuthId]['UserName'] = $ManagerInfo['name'];
//实名认证提交的照片
$AuthLog['AuthLog'][$AuthId]['submit_img1'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img1']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img1']) : "";
$AuthLog['AuthLog'][$AuthId]['submit_img2'] = isset($AuthLog['AuthLog'][$AuthId]['submit_img2']) ? urldecode($AuthLog['AuthLog'][$AuthId]['submit_img2']) : "";
}
//模板渲染
include $this->tpl('Xrace_User_AuthLog');
} else {
$home = $this->sign;
include $this->tpl('403');
}
}
开发者ID:032404cxd,项目名称:xrace_main,代码行数:50,代码来源:UserController.php
示例10: getItemPickUpCount
public function getItemPickUpCount($StartTime, $EndTime, $UserId, $ServerId, $oWherePartnerPermission, $ItemListText)
{
//查询列
$select_fields = array('PickUpCount' => 'count(*)');
//初始化查询条件
$whereStartTime = $StartTime ? " ItemPickUpTime >= '" . strtotime($StartTime) . "' " : "";
$whereEndTime = $EndTime ? " ItemPickUpTime <= '" . strtotime($EndTime) . "' " : "";
$whereServer = $ServerId ? " ServerId = " . $ServerId . " " : "";
$whereItemID = $ItemListText ? " ItemID in ( " . $ItemListText . " )" : "";
$whereUser = $UserId ? " UserId = " . $UserId . " " : "";
$whereCondition = array($whereStartTime, $whereEndTime, $whereUser, $whereServer, $oWherePartnerPermission, $whereItemID);
//生成查询列
$fields = Base_common::getSqlFields($select_fields);
//生成条件列
$where = Base_common::getSqlWhere($whereCondition);
if ($UserId) {
$position = Base_Common::getUserDataPositionById($UserId);
$table_to_process = Base_Common::getUserTable($this->table_list['pickitem_user'], $position);
} else {
$Date = date("Ymd", strtotime($StartTime));
$table_to_process = Base_Widget::getDbTable($this->table_list['pickitem']) . "_" . $Date;
}
$sql = "SELECT {$fields} FROM {$table_to_process} as log where 1 " . $where;
$PickUpCount = $this->db->getOne($sql, false);
if ($PickUpCount) {
return $PickUpCount;
} else {
return 0;
}
}
开发者ID:eappl,项目名称:prototype,代码行数:30,代码来源:Item.php
示例11: UserLoginSumDate
public function UserLoginSumDate($UserId, $oWherePartnerPermission)
{
//初始化查询条件
$whereCondition = array($oWherePartnerPermission);
$where = Base_common::getSqlWhere($whereCondition);
$position = Base_Common::getUserDataPositionById($UserId);
$table_to_process = Base_Widget::getDbTable($this->table_user) . "_" . $position['db_fix'];
$sql = "SELECT sum(`LogoutTime`-`LoginTime`) as `LoingTime` FROM {$table_to_process} WHERE `UserId` = {$UserId} and `LogoutTime` > 0 and `LogoutTime` > `LoginTime` " . $where;
return $this->db->getOne($sql, false);
}
开发者ID:eappl,项目名称:prototype,代码行数:10,代码来源:Login.php
示例12: upload
public function upload($path)
{
$this->savePath = $path;
if (!is_dir($this->fileDir . $this->savePath) && !mkdir($this->fileDir . $this->savePath)) {
throw new Base_Exception(sprintf('目录 %s 不存在', $this->fileDir . $this->savePath), 403);
}
@chmod($this->fileDir . $this->savePath);
if (!is_writeable($this->fileDir . $this->savePath)) {
throw new Base_Exception(sprintf('目录 %s 不可写', $this->fileDir . $this->savePath), 403);
}
foreach ($this->fileArr as $k => $file) {
if (!self::isUploadedFile($file['tmp_name'])) {
$this->resultArr[$k]['errno'] = 1;
$this->resultArr[$k]['description'] = '文件上传失败';
continue;
}
$suffix = Base_Common::fileSuffix($file['name']);
$isImage = in_array($suffix, $this->allowImageExtArr);
// if ($this->onlyAllowImage && !$isImage) {
// $this->resultArr[$k]['errno'] = 2;
// $this->resultArr[$k]['description'] = '不允许上传非图片类型文件';
// continue;
// }
if (!in_array($suffix, $this->allowFileExtArr)) {
$this->resultArr[$k]['errno'] = 3;
$this->resultArr[$k]['description'] = '类型文件不允许';
continue;
}
if ($file['size'] > $this->maxFileSize) {
$this->resultArr[$k]['errno'] = 4;
$this->resultArr[$k]['description'] = '文件大小超过限制';
continue;
}
$filename = $file['name'];
$target = $this->fileDir . $this->savePath . '/' . $filename;
$target_root = $this->fileUrl . "/" . $this->savePath . '/' . $filename;
if (move_uploaded_file($file['tmp_name'], $target) || @copy($file['tmp_name'], $target)) {
$this->resultArr[$k]['errno'] = 0;
$this->resultArr[$k]['description'] = '文件上传成功';
$this->resultArr[$k]['path'] = $target;
$this->resultArr[$k]['path_root'] = $target_root;
$this->uploadedFileArr[] = array('name' => $file['name'], 'url' => $this->savePath . $filename, 'type' => $file['type'], 'size' => $file['size'], 'description' => $file['description'], 'is_image' => $isImage);
} else {
$this->resultArr[$k]['errno'] = 5;
$this->resultArr[$k]['description'] = '文件上传失败';
}
}
return $this;
}
开发者ID:032404cxd,项目名称:xrace_main,代码行数:49,代码来源:Upload.php
示例13: detailAction
public function detailAction()
{
//检查权限
$this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
$SourceProjectId = intval($this->request->SourceProjectId);
$SourceProject = $this->oSourceProject->getRow($SourceProjectId, '*');
$SourceProjectDetail = $this->oSourceProject->getDetail($SourceProjectId);
$SourceList = $this->oSource->getAll();
$SourceDetailList = $this->oSourceDetail->getAll(0);
//下载参数
$export = $this->request->export ? intval($this->request->export) : 0;
$links = 'http://passport.wjyx.com/?c=media&PageId=2';
foreach ($SourceProjectDetail as $key => $value) {
$SourceProjectDetail[$key]['SourceName'] = $SourceList[$value['SourceId']]['name'];
$SourceProjectDetail[$key]['SourceDetailName'] = $value['SourceDetail'] ? $SourceDetailList[$value['SourceDetail']]['name'] : "<font color = 'red'>全部</font>";
$SourceProjectDetail[$key]['SourceUrl'] = $links . "&UserSourceId=" . $value['SourceId'] . "&UserSourceDetail=" . $value['SourceDetail'] . "&UserSourceProjectId=" . $value['SourceProjectId'];
//$SourceProjectDetail[$key]['SourceUrl'] = "&UserSourceId=".$value['SourceId']."UserSourceDetail".$value['SourceDetail']."UserSourceProjectId".$value['SourceProjectId'];
// $SourceProjectDetail[$key]['SourceUrl'] = Base_Common::my_authcode($SourceProjectDetail[$key]['SourceUrl'],'','limaogame');
}
$param['SourceProjectId'] = $SourceProjectId;
$execlParam = $param + array("export" => 1);
$export_var = "<a href =" . Base_Common::getUrl('', 'config/source/project', 'detail', $execlParam) . "><导出表格></a>";
if ($export == 1) {
$oExcel = new Third_Excel();
$FileName = '广告位列表--' . $SourceProject['name'];
//标题栏
$title = array("广告商", "广告位", "连接参数");
$oExcel->download($FileName)->addSheet('广告位列表');
$oExcel->addRows(array($title));
foreach ($SourceProjectDetail as $key => $sourceproject_detail) {
//生成单行数据
$t['SourceName'] = $sourceproject_detail['SourceName'];
$t['SourceDetailName'] = $sourceproject_detail['SourceDetailName'];
$t['SourceUrl'] = $sourceproject_detail['SourceUrl'];
$oExcel->addRows(array($t));
unset($t);
}
//结束excel
$oExcel->closeSheet()->close();
}
include $this->tpl('Config_Source_Project_Detail_list');
}
开发者ID:eappl,项目名称:prototype,代码行数:42,代码来源:ProjectController.php
示例14: getPvpLogTotal
public function getPvpLogTotal($whereTime)
{
$table_to_process = Base_Widget::getDbTable($this->table_pvp_log_total);
$sql = "truncate {$table_to_process}";
$this->db->query($sql);
for ($i = 0; $i <= 255; $i++) {
$position = Base_Common::getUserDataPositionById(sprintf("%03d", $i));
$table_to_get = Base_Common::getUserTable($this->table_pvp_log_user, $position);
$sql = "replace into {$table_to_process} (ServerId,UserId,Won,PvpCount) select ServerId,UserId,Won,Count(*) from {$table_to_get} where {$whereTime} group by ServerId,UserId,Won";
echo $this->db->query($sql) . "-";
}
}
开发者ID:eappl,项目名称:prototype,代码行数:12,代码来源:Task.php
示例15: getOperatorFromVadmin
function getOperatorFromVadmin($OperatorName, $Detail = "")
{
Base_Common::getLocalIP();
$array = array('CurrentIp' => $IP, 'OpLoginId' => $OperatorName);
$Data = json_encode($array);
$key = "987654321!@#\$%";
$txt = "6" . $Data . $key;
$sign = md5(strtoupper($txt));
$Data = urlencode(base64_encode($Data));
$url = "http://tradeservice.5173esb.com/CommService/CommonRequest.ashx?OperationType=6&Data={$Data}&Sign={$sign}";
$return = file_get_contents($url);
$return_arr = json_decode(base64_decode($return), true);
if (is_array($return_arr)) {
$OperatorInfo = json_decode($return_arr['JsonData'], true);
if ($OperatorInfo['OpLoginId'] != "") {
$Operator = array('photo' => $OperatorInfo['OpAvatar'], 'QQ' => $OperatorInfo['OPQQ'], 'mobile' => $OperatorInfo['OPMObile'], 'tel' => $OperatorInfo['OPTel'], 'weixin' => $OperatorInfo['OPWeiXin'], 'name' => $OperatorInfo['OPName'], 'cno' => $OperatorInfo['OpRealName'], 'login_name' => $OperatorInfo['OpLoginId'], 'weixinPicUrl' => $OperatorInfo['OPWeiXinPicUrl'], 'weixinPicUrl_officer' => $OperatorInfo['OPWeiXinPicUrl2'], 'xnGroupId' => $OperatorInfo['OPSmallCanUID'], 'xnGroupId_officer' => $OperatorInfo['OPSmallCanUID2'], 'photo_officer' => $OperatorInfo['OpAvatar2'], 'qq_url' => $OperatorInfo['OPQQIdKey'] == "" ? "" : 'http://sighttp.qq.com/authd?IDKEY=' . $OperatorInfo['OPQQIdKey'], 'qq_url_officer' => $OperatorInfo['OPQQIdKey2'] == "" ? "" : 'http://sighttp.qq.com/authd?IDKEY=' . $OperatorInfo['OPQQIdKey2'], 'QQ_officer' => $OperatorInfo['OPQQ2'], 'mobile_officer' => $OperatorInfo['OPMObile2'], 'tel_officer' => $OperatorInfo['OPTel2'], 'weixin_officer' => $OperatorInfo['OPWeiXin2'], 'name_officer' => $OperatorInfo['OPName2'], 'cno_officer' => $OperatorInfo['OpRealName2'], 'login_name_officer' => $OperatorInfo['OpLoginId2'], 'qq_link_type' => $OperatorInfo['IsNewPopQQ'] == 0 ? 'js' : 'http');
//去除所需列表之外的数据
$t = explode(",", $Detail);
if (count($t) > 1) {
foreach ($Operator as $key => $value) {
if (!in_array($key, $t)) {
unset($Operator[$key]);
}
}
}
return $Operator;
} else {
return false;
}
} else {
return false;
}
}
开发者ID:032404cxd,项目名称:prototype_main,代码行数:33,代码来源:Operator.php
示例16: raceSportsTypeInsertAction
public function raceSportsTypeInsertAction()
{
//检查权限
$PermissionCheck = $this->manager->checkMenuPermission("RaceStageModify");
if ($PermissionCheck['return']) {
//分站ID
$RaceStageId = intval($this->request->RaceStageId);
//分组ID
$RaceGroupId = intval($this->request->RaceGroupId);
//比赛ID
$RaceId = intval($this->request->RaceId);
//运动类型ID
$SportsTypeId = intval($this->request->SportsTypeId);
//需要添加的运动类型置于哪个位置之后,默认为开头
$After = isset($this->request->After) ? intval($this->request->After) : -1;
//获取当前分站信息
$RaceStageInfo = $this->oRace->getRaceStage($RaceStageId, '*');
//解包压缩数组
$RaceStageInfo['comment'] = json_decode($RaceStageInfo['comment'], true);
//如果当前分站未配置了当前分组
if (!isset($RaceStageInfo['comment']['SelectedRaceGroup'][$RaceGroupId])) {
$response = array('errno' => 1);
} else {
//获取赛事分组信息
$RaceGroupInfo = $this->oRace->getRaceGroup($RaceGroupId, '*');
//如果赛事分组尚未配置
if (!$RaceGroupInfo['RaceGroupId']) {
$response = array('errno' => 2);
} else {
$this->oSports = new Xrace_Sports();
//获取运动类型信息
$SportsTypeInfo = $this->oSports->getSportsType($SportsTypeId, '*');
//如果未获取到有效的运动类型
if (!isset($SportsTypeInfo['SportsTypeId'])) {
$response = array('errno' => 3);
} else {
//获取比赛信息
$RaceInfo = $this->oRace->getRaceInfo($RaceId);
//如果有获取到比赛信息 并且 赛事分站ID和赛事分组ID相符
if (isset($RaceInfo['RaceId']) && $RaceStageId == $RaceInfo['RaceStageId'] && $RaceGroupId == $RaceInfo['RaceGroupId']) {
//数据解包
$RaceInfo['comment'] = isset($RaceInfo['comment']) ? json_decode($RaceInfo['comment'], true) : array();
//初始运动类型信息列表
$RaceInfo['comment']['DetailList'] = isset($RaceInfo['comment']['DetailList']) ? $RaceInfo['comment']['DetailList'] : array();
//运动类型列表排序
ksort($RaceInfo['comment']['DetailList']);
//如果添加在某个元素之后 且 元素下标不越界
if ($After >= 0 && $After <= count($RaceInfo['comment']['DetailList'])) {
//添加元素
$RaceInfo['comment']['DetailList'] = Base_Common::array_insert($RaceInfo['comment']['DetailList'], array('SportsTypeId' => $SportsTypeId), $After + 1);
} elseif ($After == -1) {
//添加元素
$RaceInfo['comment']['DetailList'] = Base_Common::array_insert($RaceInfo['comment']['DetailList'], array('SportsTypeId' => $SportsTypeId), $After + 1);
} else {
//默认为在表尾部添加元素
$RaceInfo['comment']['DetailList'][count($RaceInfo['comment']['DetailList'])] = array('SportsTypeId' => $SportsTypeId);
}
//数据打包
$RaceInfo['comment'] = json_encode($RaceInfo['comment']);
//更新比赛
$res = $this->oRace->updateRace($RaceId, $RaceInfo);
$response = $res ? array('errno' => 0) : array('errno' => 9);
}
}
}
}
echo json_encode($response);
} else {
$home = $this->sign;
include $this->tpl('403');
}
}
开发者ID:032404cxd,项目名称:xrace_main,代码行数:72,代码来源:RaceStageController.php
示例17: serviceLogUnloggedAction
//.........这里部分代码省略.........
if ($M) {
$ServiceNum['complain']['New'] = 1;
}
if (in_array($QuestionInfo['status'], array(0, 4))) {
$NewLog[$QuestionInfo['time']][] = array('QuestionId' => $QuestionInfo['QuestionId'], 'QuestionType' => 'complain');
}
}
unset($ServiceNum['complain']['List']);
} else {
$ServiceNum['complain']['Num'] = 0;
}
krsort($NewLog);
$i = 0;
$NewServiceList = array();
foreach ($NewLog as $Time => $TimeList) {
foreach ($TimeList as $key => $Question) {
if ($i < $User['NewCount']) {
switch ($Question['QuestionType']) {
case "ask":
$QuestionInfo = $this->oQuestion->getQuestion($Question['QuestionId'], "id,description,time,atime,status,qtype");
//生成问题链接
$QuestionInfo['QuestionUrl'] = $this->oQuestion->getQuestionLink($QuestionInfo['id'], "question");
//复制问题分类
$QuestionInfo['QuestionType'] = $Question['QuestionType'];
//生成问题状态
if ($QuestionInfo['status'] == 1) {
$QuestionInfo['QuestionStatus'] = 1;
} else {
$QuestionInfo['QuestionStatus'] = 2;
}
$NewServiceList[] = $QuestionInfo;
break;
case "suggest":
$QuestionInfo = $this->oQuestion->getQuestion($Question['QuestionId'], "id,description,time,atime,status,qtype");
//生成问题链接
$QuestionInfo['QuestionUrl'] = $this->oQuestion->getQuestionLink($QuestionInfo['id'], "question");
//复制问题分类
$QuestionInfo['QuestionType'] = $Question['QuestionType'];
//生成问题状态
if ($QuestionInfo['status'] == 1) {
$QuestionInfo['QuestionStatus'] = 1;
} else {
$QuestionInfo['QuestionStatus'] = 2;
}
$NewServiceList[] = $QuestionInfo;
break;
case "complain":
$QuestionInfo = $this->oComplain->getComplain($Question['QuestionId'], "id,description,time,atime,status,qtype");
//生成问题链接
$QuestionInfo['QuestionUrl'] = $this->oComplain->getQuestionLink($QuestionInfo['id'], "complain");
//复制问题分类
$QuestionInfo['QuestionType'] = $Question['QuestionType'];
//生成问题状态
if (in_array($QuestionInfo['status'], array(0, 4))) {
$QuestionInfo['QuestionStatus'] = 1;
} elseif (in_array($QuestionInfo['status'], array(1, 3))) {
$QuestionInfo['QuestionStatus'] = 2;
}
if ($QuestionInfo['status'] == 2) {
$QuestionInfo['QuestionStatus'] = 3;
}
$NewServiceList[] = $QuestionInfo;
break;
}
}
$i++;
}
}
foreach ($NewServiceList as $key => $QuestionInfo) {
if (!isset($QtypeList[$QuestionInfo['qtype']])) {
$QtypeList[$QuestionInfo['qtype']] = $this->oQtype->getQtypeById($QuestionInfo['qtype']);
}
$NewServiceList[$key]['Qtype'] = $QtypeList[$QuestionInfo['qtype']]['name'];
//格式化提问时间
$NewServiceList[$key]['AddTime'] = date("Y-m-d H:i", $QuestionInfo['time']);
//格式化回答时间
$NewServiceList[$key]['AnswerTimeLag'] = $QuestionInfo['QuestionStatus'] >= 2 && $QuestionInfo['atime'] ? Base_Common::timeLagToText($QuestionInfo['time'], $QuestionInfo['atime']) : "-";
//获取问题状态名称
$NewServiceList[$key]['QuestionStatusName'] = $QuestionStatusList[$QuestionInfo['QuestionStatus']];
//格式化问题内容
$NewServiceList[$key]['Content'] = Base_Common::cutstr($QuestionInfo['description'], 14);
//获取问题分类
$CategoryInfo = $QuestionTypeList[$QuestionInfo['QuestionType']];
//获取问题主分类
$NewServiceList[$key]['QuestionType'] = $CategoryInfo;
unset($NewServiceList[$key]['description']);
}
//服务记录详情页面信息
$ServiceLogDetail = array('Url' => 'http://sc.5173.com/index.php?question/my_ask.html', 'Content' => '查看全部服务记录');
//入口信息
$ServiceEntrance = array('Url' => 'http://sc.5173.com/index.php?question/ask_skip.html', 'Content' => '我要提问');
$result = array('return' => 1, 'ServiceNum' => $ServiceNum, 'ServiceLogDetail' => $ServiceLogDetail, 'ServiceEntrance' => $ServiceEntrance, 'NewServiceList' => $NewServiceList);
} else {
$result = array('return' => 0, 'comment' => "时间有误");
}
} else {
$result = array('return' => 0, 'comment' => "验证失败,请检查URL");
}
echo json_encode($result);
}
开发者ID:032404cxd,项目名称:prototype_main,代码行数:101,代码来源:UserController.php
示例18: machineMapAction
public function machineMapAction()
{
$sign = "?ctl=config/depot&ac=machine.map";
$this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
$export = $this->request->export ? intval($this->request->export) : 0;
$DepotParame['export'] = 1;
$DepotList = $this->oDepot->getAll();
//用于设置默认的页面参数
$DepotIdStr = Base_Common::getArrList($DepotList);
$DepotArr = explode(",", $DepotIdStr);
//页面参数
$DepotId = $this->request->DepotId ? $this->request->DepotId : $DepotArr[0];
$DepotX = $this->request->X;
$DepotXList = $this->getDepotX($DepotId);
$DepotName = $DepotList[$DepotId]['name'];
if ($DepotId && $DepotX) {
$DepotParame['DepotId'] = $DepotId;
$DepotParame['X'] = $DepotX;
$CageList = $this->oCage->getCageListParams($DepotId, $DepotX);
$MachineFields = "MachineId,MachineCode,EstateCode,Position,Size,LocalIP,WebIP,Purpose,Flag";
foreach ($CageList as $CageId => $CageInfo) {
$MachineList = $this->oMachine->getMachineByCageId($CageId, $MachineFields);
$SizeList = array();
for ($i = 1; $i <= $CageInfo["Size"]; $i++) {
$SizeList[$i] = 0;
}
foreach ($MachineList as $key => $MachineInfo) {
$MachineInfo['LocalIP'] = long2ip($MachineInfo['LocalIP']);
$MachineInfo['WebIP'] = long2ip($MachineInfo['WebIP']);
$SizeList[$MachineInfo['Position']] = $MachineInfo;
for ($i = $MachineInfo['Position']; $i <= $MachineInfo['Position'] + $MachineInfo['Size'] - 1; $i++) {
if ($i > $MachineInfo['Position']) {
unset($SizeList[$i]);
}
}
ksort($SizeList);
$CageList[$CageId]['SizeList'] = $SizeList;
}
}
}
$imgPath = __APP_ROOT_DIR__ . "admin/html/img/machine/";
//导出表格
$export_var = "<a href =" . Base_Common::getUrl('', 'config/depot', 'machine.map', $DepotParame) . "><导出表格></a>";
if ($export == 1) {
/*header("Content-type:application/vnd.ms-excel;charset=UTF-8");
header("Content-Disposition:attachment;filename=test_data.xls");
foreach($CageList as $CageId=> $CageInfo)
{
echo "<table>";
echo "
|
请发表评论