public function indexAction() { //检查权限 $PermissionCheck = $this->manager->checkMenuPermission(0); if ($PermissionCheck['return']) { $RootUrl = "http://" . $_SERVER['HTTP_HOST']; $RaceCatalogArr = $this->oRaceCatalog->getAllRaceCatalogList(); include $this->tpl('Xrace_Race_RaceCatalogList'); } else { $home = $this->sign; include $this->tpl('403'); } }
public function raceGroupUpdateAction() { $bind = $this->request->from('RaceGroupId', 'RaceGroupName', 'RaceCatalogId'); $RaceCatalogArr = $this->oRace->getAllRaceCatalogList(); if (trim($bind['RaceGroupName']) == "") { $response = array('errno' => 1); } elseif (intval($bind['RaceGroupId']) == "") { $response = array('errno' => 2); } elseif (!isset($RaceCatalogArr[$bind['RaceCatalogId']])) { $response = array('errno' => 3); } else { $res = $this->oRace->updateRaceGroup($bind['RaceGroupId'], $bind); $response = $res ? array('errno' => 0) : array('errno' => 9); } echo json_encode($response); return true; }
public function raceStageUpdateAction() { //获取 页面参数 $bind = $this->request->from('RaceStageId', 'RaceStageName', 'RaceCatalogId', 'StageStartDate', 'StageEndDate'); //获取已经选定的分组列表 $SelectedRaceGroup = $this->request->from('SelectedRaceGroup'); //赛事列表 $RaceCatalogArr = $this->oRace->getAllRaceCatalogList(); //分站名称不能为空 if (trim($bind['RaceStageName']) == "") { $response = array('errno' => 1); } elseif (intval($bind['RaceStageId']) <= 0) { $response = array('errno' => 2); } elseif (!isset($RaceCatalogArr[$bind['RaceCatalogId']])) { $response = array('errno' => 3); } elseif (count($SelectedRaceGroup['SelectedRaceGroup']) == 0) { $response = array('errno' => 4); } else { //获取原有数据 $oRaceStage = $this->oRace->getRaceStage($bind['RaceStageId']); $bind['comment'] = json_decode($oRaceStage['comment'], true); $bind['comment']['SelectedRaceGroup'] = $SelectedRaceGroup['SelectedRaceGroup']; //文件上传 $oUpload = new Base_Upload('RaceStageIcon'); $upload = $oUpload->upload('RaceStageIcon'); $res = $upload->resultArr; foreach ($upload->resultArr as $iconkey => $iconvalue) { $path = $iconvalue; //如果正确上传,就保存文件路径 if (strlen($path['path']) > 2) { $bind['comment']['RaceStageIconList'][$iconkey]['RaceStageIcon'] = $path['path']; $bind['comment']['RaceStageIconList'][$iconkey]['RaceStageIcon_root'] = $path['path_root']; } } //数据压缩 $bind['comment'] = json_encode($bind['comment']); //更新数据 $res = $this->oRace->updateRaceStage($bind['RaceStageId'], $bind); $response = $res ? array('errno' => 0) : array('errno' => 9); } echo json_encode($response); return true; }
public function raceStageUpdateAction() { $bind = $this->request->from('RaceStageId', 'RaceStageName', 'RaceCatalogId', 'StageStartDate', 'StageEndDate'); $SelectedRaceGroup = $this->request->from('SelectedRaceGroup'); $RaceCatalogArr = $this->oRaceStage->getAllRaceCatalogList(); if (trim($bind['RaceStageName']) == "") { $response = array('errno' => 1); } elseif (intval($bind['RaceStageId']) <= 0) { $response = array('errno' => 2); } elseif (!isset($RaceCatalogArr[$bind['RaceCatalogId']])) { $response = array('errno' => 3); } elseif (count($SelectedRaceGroup['SelectedRaceGroup']) == 0) { $response = array('errno' => 4); } else { $bind['comment']['SelectedRaceGroup'] = $SelectedRaceGroup['SelectedRaceGroup']; $bind['comment'] = json_encode($bind['comment']); $res = $this->oRaceStage->updateRaceStage($bind['RaceStageId'], $bind); $response = $res ? array('errno' => 0) : array('errno' => 9); } echo json_encode($response); return true; }