Example #1
0
 public function actionHome()
 {
     $this->docName = 'optionsHome';
     if (isset($_POST['pageId'])) {
         SystemController::savePage('home');
     }
     $page = SystemController::getPageContent($this->docName);
     $this->render('home', ['page' => $page]);
 }
Example #2
0
 public function actionIndex()
 {
     $this->docName = 'adminEvaHome';
     if (isset($_POST['pageId'])) {
         SystemController::savePage('index');
     }
     $page = SystemController::getPageContent($this->docName);
     $this->render('index', compact('page'));
 }
Example #3
0
 /**
  * actionIndex
  */
 public function actionIndex()
 {
     //$this->setPageTitle($this->id . 'Introduction');
     Yii::log("actionIndex ContextController called", "trace", self::LOG_CAT);
     $this->docName = 'survIndex';
     if (isset($_POST['pageId'])) {
         SystemController::savePage($this->createUrl('index'));
     }
     $page = SystemController::getPageContent($this->docName);
     if (empty($page)) {
         throw new CHttpException(404, 'The page requested does not exist');
     }
     $this->render('index', ['content' => $page['content'], 'editAccess' => $page['editAccess'], 'editMode' => $page['editMode']]);
 }
 static function addRoutes($app, $authenticateForRole)
 {
     //* /cron/ routes - admin db cleanup routes
     $app->group('/system', $authenticateForRole('admin'), function () use($app) {
         $app->map("/cron/", function () use($app) {
             SystemController::cronJob($app);
         })->via(['DELETE', 'POST']);
         $app->map("/auth/delete/expired-tokens/", function () use($app) {
             SystemController::deleteExpiredAuthTokens($app);
         })->via(['DELETE', 'POST']);
         $app->map("/auth/delete/broken-lookup-entries/", function () use($app) {
             SystemController::deleteBrokenLookupEntries($app);
         })->via(['DELETE', 'POST']);
     });
 }
Example #5
0
<?php

/*************************************************
 * 管理者実行スクリプト
 * 
 */
define('_ROOT_DIR', __DIR__ . '/');
require_once _ROOT_DIR . '../php_lib/init.php';
$controller = new SystemController();
$controller->run();
exit;
 /**
  * actionReport
  */
 public function actionReport()
 {
     $this->docName = 'evaluationReport';
     if (isset($_POST['pageId'])) {
         SystemController::savePage('reports');
     }
     $page = SystemController::getPageContent($this->docName);
     $this->render('//system/_page', ['content' => $page['content'], 'editAccess' => $page['editAccess'], 'editMode' => $page['editMode']]);
     return;
 }
Example #7
0
         $controller = new SetSuperController($parameters);
         break;
     case COMMAND_BUY_STADIUM:
         $controller = new BuyStadiumController($parameters);
         break;
     case COMMAND_BUY_STUDY_POINTS:
         $controller = new BuyStudyPointsController($parameters);
         break;
     case COMMAND_FRESH_ENERGY:
         $controller = new FreshEnergyController($parameters);
         break;
     case COMMAND_GET_TEAM_INFO:
         $controller = new TeamProfileController($parameters);
         break;
     case COMMAND_SYSTEM:
         $controller = new SystemController($parameters);
         break;
     default:
         $actionResult = new ErrorPoint(ErrorPoint::CODE_SYSTEM, "Неразрешенная команда", ErrorPoint::TYPE_SYSTEM);
         break 2;
 }
 track_stats();
 // Отслеживаем производительность
 if ($controller->getCurrentError() instanceof ErrorPoint) {
     $return["error"] = $controller->getCurrentError();
 } else {
     $actionResult = $controller->action();
 }
 if (isset($statistic)) {
     $controller->accountingStatistic($statistic);
 }
Example #8
0
});
//友情链接分页
Macaw::get('/admin/link_update/(:num)', function ($slug) {
    $System = new SystemController();
    $System->link_update($slug);
});
Macaw::post('/admin/link_update/(:num)', function ($slug) {
    $System = new SystemController();
    $System->link_update($slug);
});
//添加友链
Macaw::get('/admin/link_add/', 'SystemController@add_link');
Macaw::post('/admin/link_add/', 'SystemController@add_link');
//删除友情链接
Macaw::get('/admin/link_del/(:num)', function ($slug) {
    $System = new SystemController();
    $System->del_link($slug);
});
//分类链接
Macaw::get('/category/(:num).html', function ($slug) {
    $home = new HomeController();
    $home->category($slug);
});
//ajax刷新
Macaw::get('/home/getdata/', function () {
    $home = new HomeController();
    $home->getAjaxData();
});
//文章链接
Macaw::get('/article/(:num).html', function ($slug) {
    $home = new HomeController();
Example #9
0
 public function actionReports($system = null)
 {
     $systemDropdown = CHtml::listData(FrameworkContext::model()->findAll('userId=:userId', [':userId' => Yii::app()->user->id]), 'frameworkId', 'name');
     //		$model = new DesignForm();
     //		$model->setPropertyName('systemSelect', '');
     //		$model->setAttributeLabels(['systemsSelect' => 'Surveillance system']);
     //		$model->setRules([['systemSelect', 'required']]);
     //		$form = new CForm($elements, $model);
     $reportData = [];
     if ($system !== null) {
         $rsFramework = FrameworkContext::model()->with(['fields' => ['condition' => "inputName='hazardName' OR inputName='survObj'"]])->findByPk($system);
         if ($rsFramework !== null) {
             $reportData[] = ['Surveillance system', $rsFramework->name, 'Surveillance System'];
             $specialInputTypes = array_flip(['dropdownlist', 'checkboxlist', 'radiolist']);
             foreach ($rsFramework->fields as $surField) {
                 foreach ($rsFramework->data as $surData) {
                     if ($surData->frameworkFieldId == $surField->id) {
                         $fieldValue = $surData->value;
                         $fieldLabel = 'Hazard name';
                         if (isset($specialInputTypes[$surField->inputType])) {
                             $fieldLabel = 'Surveillance objective';
                             $fieldValue = Options::model()->findByPk($surData->value, ['select' => 'optionId, label'])->label;
                         }
                         $reportData[] = [$fieldLabel, $fieldValue, 'Surveillance System'];
                         break;
                     }
                 }
             }
             $rsDesign = ComponentHead::model()->with('compData', 'compDetails')->findAll('frameworkId=:framework', [':framework' => $system]);
             if ($rsDesign !== null) {
                 foreach ($rsDesign as $design) {
                     $reportData[] = ['Component name', $design->componentName, $design->componentName];
                     foreach ($design->compData as $designField) {
                         foreach ($design->compDetails as $designData) {
                             if ($designField->subFormId == $designData->subFormId) {
                                 $fieldValue = $designData->value;
                                 $fieldLabel = isset($designField->label) ? $designField->label : ComponentHead::model()->generateAttributeLabel($designField->inputName);
                                 if (isset($specialInputTypes[$designField->inputType])) {
                                     //										$fieldLabel = 'Surveillance objective';
                                     $option = Options::model()->findByPk($designData->value, ['select' => 'optionId, label']);
                                     //print_r($option); echo "\n";
                                     $fieldValue = isset($option) ? $option->label : '';
                                 }
                                 $reportData[] = [$fieldLabel, $fieldValue, $design->componentName];
                                 break;
                             }
                         }
                     }
                 }
             }
         }
         echo json_encode(['aaData' => $reportData], JSON_PRETTY_PRINT);
         return;
     }
     $this->docName = 'detDesign';
     if (isset($_POST['pageId'])) {
         SystemController::savePage($this->createUrl('reports'));
     }
     $page = SystemController::getPageContent($this->docName);
     $this->render('reports', ['systemDropdown' => $systemDropdown, 'page' => $page]);
 }