/** * 删除房间 * @param 房间Id $id * @return boolean */ public function delRoom($id) { $delPath = ROOMS_DIR . "/{$id}.serialize.php"; if ($this->_modelRooms->execute("delete from {$this->_modelRooms->tName()} where Id={$id}")) { unlink($delPath); return true; } else { return false; } }
/** * 对象管理页面 */ private function _orderIndex() { $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object'); $this->_modelAutoOrderQueue = $this->_getGlobalData('Model_AutoOrderQueue', 'object'); $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object'); $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object'); $onlineUsers = $this->_utilOnline->getOnlineUser(); $users = $this->_getGlobalData('user_index'); foreach ($onlineUsers as &$user) { $user = $users[$user]; } $objectOrderManage = $this->_utilWorkOrder->getOrderManage(); $dataList = $this->_modelAutoOrderQueue->findAll(); if ($dataList) { $this->_utilRooms = $this->_getGlobalData('Util_Rooms', 'object'); $roomList = $this->_modelRooms->findAll(); $roomList = Model::getTtwoArrConvertOneArr($roomList, 'Id', 'name'); $gameTypes = $this->_getGlobalData('game_type'); $operators = $this->_getGlobalData('operator_list'); foreach ($dataList as &$list) { $roomClass = $this->_utilRooms->getRoom($list['room_id']); $roomUsers = $roomClass->findAllUser(); if (count($roomUsers)) { $list['add_users'] = $roomUsers; } $list['game_type_id'] = $gameTypes[$list['game_type_id']]['name']; $list['operator_id'] = $operators[$list['operator_id']]['operator_name']; $list['room_id'] = $roomList[$list['room_id']]; $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']); $list['order_detail'] = Tools::url('WorkOrder', 'Detail', array('Id' => $list['work_order_id'])); } $this->_view->assign('dataList', $dataList); } $this->_view->assign('onlineUsers', $onlineUsers); $this->_view->assign('orderNum', $objectOrderManage['_orderNum']); $this->_view->assign('dataList', $dataList); $this->_view->set_tpl(array('body' => 'Master/OrderIndex.html')); $this->_view->display(); }
private function _edit() { if ($this->_isPost()) { $_POST["autoreply"] = serialize($_POST["autoreply"]); $this->_utilRooms->editRoom($_POST); $this->_utilMsg->showMsg(Tools::getLang('UPDATE_SUCCESS', 'Common'), 1, Tools::url(CONTROL, 'Room')); } else { $gameTypes = Model::getTtwoArrConvertOneArr($this->_getGlobalData('game_type'), 'Id', 'name'); $operatorList = Model::getTtwoArrConvertOneArr($this->_getGlobalData('operator_list'), 'Id', 'operator_name'); $this->_view->assign('gameTypes', $gameTypes); $this->_view->assign('operatorList', $operatorList); $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object'); $room = $this->_modelRooms->findById($_GET['Id']); if ($room["autoreply"]) { $room["autoreply"] = unserialize($room["autoreply"]); } $this->_view->assign('roomClass', $room); $this->_utilMsg->createNavBar(); $this->_view->set_tpl(array('body' => 'Group/Edit.html')); $this->_view->display(); } }
<?php $root = '../../..'; require_once $root . '/config/config.php'; require_once $root . '/core/mysql.php'; require_once $root . '/core/models/maincomponentsModel.php'; require_once $root . '/core/models/roomsModel.php'; require_once $root . '/core/models/suppliersModel.php'; $db = getMysqlConnection(); $maincomponentdata = NULL; $maincomponentTypes = Model_Maincomponents::getMaincomponentTypes($db); $rooms = Model_Rooms::getAllRooms($db); $suppliers = Model_Suppliers::getAllSuppliers($db); if (!isset($_GET['Seriennummer'])) { $form = array('txtDescription' => '', 'txtSerialNumber' => '', 'txtWarrantyYears' => '', 'cmbComponentType' => '', 'cmbRoomNumber' => '', 'txtBuyDate' => '', 'txtManufacturer' => '', 'cmbSupplierID' => '', 'txtNote' => ''); } else { $maincomponentdata = Model_Maincomponents::getMaincomponentBySerialNumber($db, $_GET['Seriennummer']); $form = array('txtDescription' => $maincomponentdata['Beschreibung'], 'txtSerialNumber' => $maincomponentdata['Seriennummer'], 'txtWarrantyYears' => $maincomponentdata['Gewaehrleistungsdauer'], 'cmbComponentType' => $maincomponentdata['FK_Komponentenart'], 'cmbRoomNumber' => $maincomponentdata['FK_Raum'], 'txtBuyDate' => $maincomponentdata['Einkaufsdatum'], 'txtManufacturer' => $maincomponentdata['Hersteller'], 'cmbSupplierID' => $maincomponentdata['FK_Lieferant'], 'txtNote' => $maincomponentdata['Notiz']); } if (isset($_POST['btnSave'])) { $form['txtDescription'] = $_POST['txtDescription']; $form['txtSerialNumber'] = $_POST['txtSerialNumber']; $form['txtWarrantyYears'] = $_POST['txtWarrantyYears']; $form['cmbComponentType'] = $_POST['cmbComponentType']; $form['cmbRoomNumber'] = $_POST['cmbRoomNumber']; $form['txtBuyDate'] = $_POST['txtBuyDate']; $form['txtManufacturer'] = $_POST['txtManufacturer']; $form['cmbSupplierID'] = $_POST['cmbSupplierID']; $form['txtNote'] = $_POST['txtNote']; if (!isset($_GET['Seriennummer'])) { Model_Maincomponents::createNewMaincomponent($db, $form);
/** * 工单显示列表 */ public function actionIndex() { #------初始化------# $this->_utilOnline = $this->_getGlobalData('Util_Online', 'object'); $workOrderStatusArr = $this->_modelSysconfig->getValueToCache('workorder_status'); $verifyStatusArr = $this->_getGlobalData('verify_status'); //bug 状态 $gameTypeArr = Model::getTtwoArrConvertOneArr($this->_modelSysconfig->getValueToCache('game_type'), 'Id', 'name'); $operatorList = $this->_getGlobalData('operator_list'); $operatorList = Model::getTtwoArrConvertOneArr($operatorList, 'Id', 'operator_name'); $this->_modelUser = $this->_getGlobalData('Model_User', 'object'); $orgList = $this->_getGlobalData('org'); $evArr = $this->_modelWorkOrder->getEvArr(); //获取评价数组 $badEvArr = $this->_getGlobalData('player_evaluation'); $badEvArr = $badEvArr[3]['Description']; //差评数组 $questionTypes = $this->_getGlobalData('question_types'); foreach ($orgList as &$value) { $curOrgUser = $this->_modelUser->findByOrgId($value['Id']); if ($curOrgUser) { $curOrgUser = Model::getTtwoArrConvertOneArr($curOrgUser, 'Id', 'nick_name'); $value['user'] = $curOrgUser; } } $this->_modelRooms = $this->_getGlobalData('Model_Rooms', 'object'); $roomList = $this->_modelRooms->findAll(); $roomList = Model::getTtwoArrConvertOneArr($roomList, 'Id', 'name'); $roomList[''] = Tools::getLang('All', 'Common'); $this->_utilWorkOrder = $this->_getGlobalData('Util_WorkOrder', 'object'); $orderManage = $this->_utilWorkOrder->getOrderManage(); $orderVipNum = $orderManage['_orderNum']; $orderVipNum[''] = array_sum($orderVipNum); #------初始化------# $onlineUsers = $this->_utilOnline->getOnlineUser('user_id'); //在线用户,一维数组,value值为user_id #------分页生成sql------# $helpSqlSearch = $this->_loadCore('Help_SqlSearch'); $helpSqlSearch = new Help_SqlSearch(); $helpSqlSearch->set_tableName($this->_modelWorkOrder->tName()); if ($_GET['game_type_id'] != '') { $helpSqlSearch->set_conditions("game_type={$_GET['game_type_id']}"); $this->_view->assign('selectedGameTypeId', $_GET['game_type_id']); #------提问类型------# $qTypes = array(); foreach ($questionTypes as $key => $list) { if ($list['game_type_id'] == $_GET['game_type_id']) { $qTypes[$key] = $list['title']; } } $qTypes[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('qType', $qTypes); if ($_GET['question_type']) { $helpSqlSearch->set_conditions("question_type={$_GET['question_type']}"); $this->_view->assign('selectedQtype', $_GET['question_type']); } #------提问类型------# #------运营商------# $operatorListTemp = array(); $gameOperatorIndex = $this->_getGlobalData('Model_GameOperator', 'object')->findByGameTypeId($_GET['game_type_id']); foreach ($gameOperatorIndex as $value) { if (array_key_exists($value['operator_id'], $operatorList)) { $operatorListTemp[$value['operator_id']] = $operatorList[$value['operator_id']]; } } $operatorList = $operatorListTemp; unset($operatorListTemp); #------运营商------# } if ($_GET['operator_id'] != '') { $helpSqlSearch->set_conditions("operator_id={$_GET['operator_id']}"); $this->_view->assign('selectedOperatorId', $_GET['operator_id']); } //增加服务器选择列表 if ($_GET['game_type_id'] != '' && $_GET['operator_id'] != '') { $gameOptServerLists = $this->_getServers($_GET['game_type_id'], $_GET['operator_id']); if ($_GET['server_id'] != '') { $helpSqlSearch->set_conditions('game_server_id=' . intval($_GET['server_id'])); } $this->_view->assign('gameOptServerLists', $gameOptServerLists); } if ($_GET['Id']) { $helpSqlSearch->set_conditions("Id={$_GET['Id']}"); $this->_view->assign('selectedId', $_GET['Id']); } if ($_GET['room_id']) { $helpSqlSearch->set_conditions("room_id={$_GET['room_id']}"); $this->_view->assign('selectedRoomId', $_GET['room_id']); } if ($_GET['evaluation_status'] != '') { $helpSqlSearch->set_conditions("evaluation_status={$_GET['evaluation_status']}"); $this->_view->assign('selectedEv', $_GET['evaluation_status']); if ($_GET['evaluation_status'] == 3) { //如果为差评 $this->_view->assign('badev_display', true); } } if ($_GET['is_verify'] != '') { $helpSqlSearch->set_conditions("is_verify={$_GET['is_verify']}"); $this->_view->assign('selectedIsVerify', $_GET['is_verify']); } if ($_GET['evaluation_desc'] != '') { $helpSqlSearch->set_conditions("evaluation_desc={$_GET['evaluation_desc']}"); $this->_view->assign('selectedBadEv', $_GET['evaluation_desc']); } if ($_GET['vip_level'] != '') { //如果设置了vip等级,将显示等级 $helpSqlSearch->set_conditions("vip_level={$_GET['vip_level']}"); $this->_view->assign('selectedVipLevel', $_GET['vip_level']); } $helpSqlSearch->setPageLimit($_GET['page'], 20); if ($_GET['order_status']) { $helpSqlSearch->set_conditions("status={$_GET['order_status']}"); $this->_view->assign('selectedOrderStatus', $_GET['order_status']); } if ($_GET['user_nickname']) { $helpSqlSearch->set_conditions("user_nickname='{$_GET['user_nickname']}'"); $this->_view->assign('selectedUserNickname', $_GET['user_nickname']); $_GET['user_nickname'] = urlencode($_GET['user_nickname']); } if ($_GET['user_account']) { $helpSqlSearch->set_conditions("user_account='{$_GET['user_account']}'"); $this->_view->assign('selectedUserAccount', $_GET['user_account']); $_GET['user_account'] = urlencode($_GET['user_account']); } if ($_GET['title']) { $helpSqlSearch->set_conditions("title like '%{$_GET['title']}%'"); $this->_view->assign('selectedTitle', $_GET['title']); $_GET['title'] = urlencode($_GET['title']); } if ($_GET['service_ids']) { //如果选择了客服 $this->_view->assign('selectedServiceIds', $_GET['service_ids']); $serviceIds = implode(',', $_GET['service_ids']); $helpSqlSearch->set_conditions("owner_user_id in ({$serviceIds})"); } if ($_GET['start_time'] && $_GET['end_time']) { $this->_view->assign('selectedStartTime', $_GET['start_time']); $this->_view->assign('selectedEndTime', $_GET['end_time']); $helpSqlSearch->set_conditions('create_time between ' . strtotime($_GET['start_time']) . ' and ' . strtotime($_GET['end_time'])); } $helpSqlSearch->set_orderBy('status asc,create_time desc'); $sql = $helpSqlSearch->createSql(); $conditions = $helpSqlSearch->get_conditions(); $this->_loadCore('Help_Page'); $helpPage = new Help_Page(array('total' => $this->_modelWorkOrder->findCount($conditions), 'perpage' => 20)); $this->_view->assign('pageBox', $helpPage->show()); #------分页生成sql------# $dataList = $this->_modelWorkOrder->select($sql); #------载入缓存------# $workOrderSourceArr = $this->_modelSysconfig->getValueToCache('workorder_source'); $vipLevel = Tools::getLang('VIP_LEVEL', 'Common'); foreach ($vipLevel as $key => &$vipCount) { $vipCount .= " [<font color='#ff0000'>" . intval($orderVipNum[$key]) . "</font>]"; } $users = $this->_getGlobalData('user_all'); $serverList = $this->_getGlobalData('gameser_list'); #------载入缓存------# if ($dataList) { Tools::import('Util_FontColor'); $timeInterval = array(); //定时器计时 foreach ($dataList as &$list) { $TimeDifference = intval($serverList[$list['game_server_id']]['time_zone']); //时差 $list['url_dialog'] = Tools::url('QualityCheck', 'OrderDialog', array('Id' => $list['Id'], 'TimeDifference' => $TimeDifference)); $list['word_game_type'] = Util_FontColor::getGameTypeColor($list['game_type'], $gameTypeArr[$list['game_type']]); $list['word_source'] = Util_FontColor::getWorkOrderSource($list['source'], $workOrderSourceArr[$list['source']]); $list['word_status'] = Util_FontColor::getWorkOrderStatus($list['status'], $workOrderStatusArr[$list['status']]); $list['word_status'] .= $list['is_verify'] ? Tools::getLang('VERIFY_STATUS', 'Common') : ''; $list['word_operator_id'] = $operatorList[$list['operator_id']]; $list['word_question_type'] = $questionTypes[$list['question_type']]['title'] ? $questionTypes[$list['question_type']]['title'] : Tools::getLang('NOT_QUESTION_TYPE', 'Common'); $list['url_detail'] = Tools::url('WorkOrder', 'Detail', array('Id' => $list['Id'])); $list['word_owner_user_id'] = $users[$list['owner_user_id']]['nick_name']; $list['word_game_server_id'] = $serverList[$list['game_server_id']]['server_name']; $list['word_ev'] = Util_FontColor::getPlayerEvaluation($list['evaluation_status'], $evArr[$list['evaluation_status']]); //提问类型 $list['url_reply_detail'] = Tools::url(CONTROL, 'ReplyIndex', array('user_id' => $list['owner_user_id'])); $list['word_room_id'] = $list['room_id'] ? $roomList[$list['room_id']] : '<font color="#666666">' . Tools::getLang('NOT', 'Common') . '</font>'; if ($list['evaluation_status'] == 3) { $list['word_ev_desc'] = $badEvArr[$list['evaluation_desc']]; } if ($list['status'] == 1) { $isTimeout = Tools::isTimeOut($list['create_time'], $list['timeout']); if ($isTimeout === true) { //已超时 $list['time_out_true'] = true; } else { //未超时 $list['lost_time'] = Tools::getTimeFormat($isTimeout); $timeInterval[$list['Id']]['div'] = $list['Id']; $timeInterval[$list['Id']]['time'] = $isTimeout; } } if ($TimeDifference != 0) { $list['create_time'] = date('Y-m-d H:i:s', $list['create_time'] + $TimeDifference * 3600); $list['create_time'] .= '(' . Tools::getLang('GAME_SERVER_TIME', 'Common') . ')'; } else { $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']); } if ($list['word_owner_user_id']) { $list['word_owner_user_id'] .= in_array($list['owner_user_id'], $onlineUsers) ? Util_FontColor::getOnline(1) : Util_FontColor::getOnline(0); } $verifyInfo = $this->_modelWorkOrder->select('select status from ' . DB_PREFIX . 'verify ' . 'where work_order_id =' . $list['Id'], 1); $verifyStatus = $verifyInfo['status']; $list['word_verify_status'] = $verifyStatusArr[$verifyStatus]; } $this->_view->assign('dataList', $dataList); } $evArr[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('statusurl', Tools::url(CONTROL, 'ChangetheStatus')); $badEvArr[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('verify', $this->_modelWorkOrder->getVerify()); $this->_view->assign('badEvArr', $badEvArr); $this->_view->assign('evArr', $evArr); $this->_view->assign('roomList', $roomList); $this->_view->assign('timeInterval', json_encode($timeInterval)); $gameTypeArr[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('gameTypeList', $gameTypeArr); $operatorList[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('operatorList', $operatorList); $this->_view->assign('orgList', $orgList); $this->_view->assign('vipLevel', $vipLevel); $workOrderStatusArr[''] = Tools::getLang('ALL', 'Common'); $this->_view->assign('workOrderStatusArr', $workOrderStatusArr); $this->_view->assign('js', $this->_view->get_curJs()); $this->_utilMsg->createNavBar(); $this->_view->display(); }