• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ST类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ST的典型用法代码示例。如果您正苦于以下问题:PHP ST类的具体用法?PHP ST怎么用?PHP ST使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ST类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: storeRequest

 public function storeRequest($vks_id)
 {
     try {
         $vks = Vks::with('tech_support_requests')->findOrFail($vks_id);
     } catch (Exception $e) {
         $this->error('404');
     }
     $request = $this->request->request;
     $this->validator->validate(['Сообщение' => [$request->get('user_message'), 'max(255)'], 'Точка' => [$request->get('att_id'), 'required|int']]);
     //if no passes
     if (!$this->validator->passes()) {
         $this->backWithData($this->validator->errors()->all());
     }
     $request_new = new TechSupportRequest(array('att_id' => $request->get('att_id'), 'vks_id' => $vks->id, 'owner_id' => App::$instance->user->id, 'user_message' => $request->get('user_message'), 'status' => $vks->status == VKS_STATUS_APPROVED ? TechSupportRequest::STATUS_READY_FOR_SEND : TechSupportRequest::STATUS_WAIT_VKS_DECISION));
     $flag = false;
     if (count($vks->tech_support_requests)) {
         foreach ($vks->tech_support_requests as $request) {
             if ($request_new->att_id == $request->att_id) {
                 $flag = true;
             }
         }
     }
     if (!$flag) {
         $request_new->save();
     }
     App::$instance->MQ->setMessage("Запрос успешно создан");
     ST::redirectToRoute('TechSupport/showRequests/' . $vks->id);
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:28,代码来源:TechSupport_controller.php


示例2: store

 public function store()
 {
     Token::checkToken();
     $xml = new SimpleXMLElement('<root/>');
     //        dump($this->request->request->get('modules'));
     //        die;
     if ($this->request->request->has('modules')) {
         foreach ($this->request->request->get('modules') as $module) {
             $this->validator->validate(['name' => [$module['name'], 'required|max(255)'], 'description' => [$module['description'], 'required|max(560)'], 'help' => [$module['help'], 'required|max(1000)'], 'value' => [$module['value'], 'between(0,1)']]);
             //if no passes
             if (!$this->validator->passes()) {
                 $this->putUserDataAtBackPack($this->request);
                 App::$instance->MQ->setMessage($this->validator->errors()->all());
                 ST::redirect("back");
             }
             $srvXml = $xml->addChild('module');
             $srvXml->addAttribute('name', $module['name']);
             $srvXml->addAttribute('description', $module['name']);
             $srvXml->addAttribute('help', $module['help']);
             $srvXml->addAttribute('value', intval($module['value']));
         }
     }
     $xml->asXML("config/modules-cfg.xml");
     App::$instance->MQ->setMessage('Список обновлен');
     App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'Изменен список модулей системы');
     ST::redirect("back");
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:27,代码来源:Modules_controller.php


示例3: run

 public function run()
 {
     //add counter
     $params = count($this->params) ? "/" . implode("/", $this->params) : "";
     $mskTime = date_create()->setTimezone(new DateTimeZone(App::$instance->opt->ca_timezone));
     Counter::create(['origin' => MY_NODE, 'ip' => App::$instance->user->ip, 'request' => $this->controller . "/" . $this->action . urlencode($params), 'type' => ST::isAjaxRequest() ? REQUEST_AJAX : REQUEST_REGULAR, 'created_at' => $mskTime, 'updated_at' => $mskTime]);
     call_user_func_array(array(new $this->controller(), $this->action), $this->params);
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:8,代码来源:FrontController.class.php


示例4: isDefaultUserIteractBlock

 private function isDefaultUserIteractBlock($id)
 {
     Auth::isAdminOrDie(App::$instance);
     if (in_array($id, [1])) {
         App::$instance->MQ->setMessage('Нелья редактировать системныe записи');
         ST::redirect("back");
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:8,代码来源:Initiators_controller.php


示例5: unmark

 public function unmark($caVksId)
 {
     Auth::isAdminOrDie(App::$instance);
     foreach (AdminCaNote::where('vks_id', $caVksId)->get() as $caVks) {
         $caVks->delete();
     }
     App::$instance->MQ->setMessage("У ВКС ЦА {$caVksId} удален флаг");
     ST::redirect('back');
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:9,代码来源:NotesCa_controller.php


示例6: show

 function show()
 {
     //        $this->render("test/
     $s = ST::microtime_float();
     $start = '2015-11-30';
     $end = '2016-01-11';
     $events = Vks::where('start_date_time', ">=", $start)->where('start_date_time', '<=', $end)->where('status', VKS_STATUS_APPROVED)->get();
     $e = ST::microtime_float();
     print $e - $s;
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:10,代码来源:test_controller.php


示例7: logout

 public function logout()
 {
     global $_TB_IDENTITY;
     if (Auth::isLogged(App::$instance)) {
         setcookie(md5("logged" . $_TB_IDENTITY[App::$instance->user->origin]['serviceName']), false, time() - 3600, '/', Null, 0);
     } else {
         App::$instance->MQ->setMessage('Вы не авторизированы');
     }
     ST::redirectToRoute("Index/index");
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:10,代码来源:AuthNew_controller.php


示例8: isAdminOrDie

 static function isAdminOrDie($init)
 {
     if ($init->user->isLogged && ($init->user->role == ROLE_ADMIN || $init->user->role == ROLE_ADMIN_MODERATOR)) {
         return true;
     } else {
         App::$instance->log->logWrite(LOG_SECURITY, "Restricted access: Try to enter admin only allowed zone");
         ST::routeToErrorPage('only-admin');
         exit;
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:10,代码来源:Auth.class.php


示例9: search

 public function search($phrase)
 {
     if (ST::isAjaxRequest()) {
         $vksWSC = new Vks_controller();
         $result = [];
         $result['ws'] = Vks::where("id", $phrase)->whereIn('status', [VKS_STATUS_APPROVED, VKS_STATUS_PENDING])->take(1)->get();
         foreach ($result['ws'] as $vks) {
             $vksWSC->humanize($vks);
         }
         print json_encode($result);
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:12,代码来源:Search_controller.php


示例10: MenuChanger

 static function MenuChanger()
 {
     if (Auth::isAdmin(App::$instance)) {
         ST::deployTemplate('menus/admin.inc');
     } else {
         ST::deployTemplate('menus/user.inc');
     }
     //под меню добавить слушателя сообщений
     ExceptionHandler::messageException();
     //выдать путь для js, $init должен быть инициирован выше
     ST::setVarPhptoJS(App::$instance->opt->appHttpPath, "appHttpPath");
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:12,代码来源:RenderEngine.class.php


示例11: isExist

 public function isExist($key)
 {
     $result = false;
     if (file_exists(self::SAVE_PATH . App::$instance->user->id . "_" . $key)) {
         $result = true;
     }
     if (!ST::isAjaxRequest()) {
         return $result;
     } else {
         print json_encode($result);
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:12,代码来源:LocalStorage_controller.php


示例12: sendDeleteMail

 public function sendDeleteMail($vks, $toRequester = true)
 {
     $vks->link = ST::linkToVksPage($vks->id, false, true);
     $vksArray = $vks->toArray();
     $message = App::$instance->twig->render('mails/v2/vks-delete.twig', array('vks' => $vksArray, 'http_path' => HTTP_BASE_PATH, 'appHttpPath' => NODE_HTTP_PATH));
     if (!$toRequester) {
         Mail::sendMailToStack($vks->owner->email, "Ваша ВКС #{$vks['id']} аннулирована", $message);
     } else {
         Mail::sendMailToStack(App::$instance->user->email, "ВКС #{$vks['id']} аннулирована", $message);
     }
     App::$instance->log->logWrite(LOG_MAIL_SENDED, "VKS WS #{$vks['id']} аннулирована");
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:12,代码来源:VksMailReportBuilder.php


示例13: delete

 public function delete($id)
 {
     Auth::isAdminOrDie(App::$instance);
     if ($id == 1) {
         App::$instance->MQ->setMessage("Это удалить нельзя, просто переименуйте как вам нужно");
         ST::redirect('back');
     }
     $department = Department::findorFail($id);
     $department->delete();
     App::$instance->MQ->setMessage("Успешно удалено");
     App::$instance->log->logWrite(LOG_CONFIG_CHANGE, 'Подразделение удалено' . $department->name);
     ST::redirectToRoute('Departments/index');
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:13,代码来源:Departments_controller.php


示例14: put

 function put($adress, $theme, $message)
 {
     $this->validator->validate(['address' => [$adress, 'required|max(160)'], 'theme' => [$theme, 'required|max(512)'], 'message' => [$message, 'required']]);
     //if no passes
     if (!$this->validator->passes()) {
         foreach ($this->validator->errors()->all() as $message) {
             App::$instance->log->logWrite(LOG_MAIL_SENDED, $message);
         }
         return false;
     }
     $mailToStack = new MailStack();
     $mailToStack->address = $adress;
     $mailToStack->theme = ST::cleanUpText($theme);
     $mailToStack->message = ST::cleanUpText($message);
     $mailToStack->owner_ip = 0;
     $mailToStack->save();
     return true;
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:18,代码来源:MailStack_controller.php


示例15: checkToken

 static function checkToken()
 {
     return true;
     if (!isset($_SESSION['token']) || is_null($_SESSION['token']) || is_null(Request::createFromGlobals()->get('csrf_token'))) {
         throw new RuntimeException("Bad Token initialization");
     }
     $flag = false;
     foreach ($_SESSION['token'] as $key => $token) {
         if ($token === Request::createFromGlobals()->get('csrf_token')) {
             $flag = true;
             //drop this token
             unset($_SESSION['token'][$key]);
         }
     }
     if ($flag) {
         return true;
     } else {
         ST::routeToErrorPage('bad-token');
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:20,代码来源:Token.class.php


示例16: ask

 public function ask($file, $key)
 {
     $result = null;
     if (file_exists(NODE_REAL_PATH . "config/" . $file . ".xml")) {
         $helpfile = (object) simplexml_load_file(NODE_REAL_PATH . "config/" . $file . ".xml");
         foreach ($helpfile as $element) {
             if (strval($element->name) == $key) {
                 $result = "<div style='font-size: 16px;'>" . strval($element->content) . "</div>";
                 if (isset($element->image)) {
                     $result = "<div class='text-center'><image style='width:95%;' src='" . $element->image . "'/></div>" . $result;
                 }
             }
         }
     }
     if (ST::isAjaxRequest()) {
         print json_encode([$result]);
     } else {
         return $result;
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:20,代码来源:Help_Controller.php


示例17: __construct

 function __construct()
 {
     if (isset($_GET['r'])) {
         //разбить запрос
         $splitReq = explode('/', $_GET['r']);
         //получить имя файла, достать последний массив из конца сстроки запроса
         $this->filename = array_pop($splitReq);
         //все остальное в массиве, это путь к файлу
         $this->sect = $splitReq;
         //process request
         $this->processRequest();
     } else {
         if (isset($_GET['route'])) {
             $frontController = new FrontController();
             $frontController->run();
             exit;
         }
         ST::redirectToRoute("Index/index");
     }
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:20,代码来源:Router.class.php


示例18: pushToStack

 function pushToStack($vks_id, $force = false)
 {
     try {
         $vks = Vks::approved()->notEnded()->findOrFail($vks_id);
     } catch (Exception $e) {
         $this->error('404');
     }
     if (!OutlookCalendarRequest::where('user_id', App::$instance->user->id)->where('vks_id', $vks->id)->count()) {
         OutlookCalendarRequest::create(array('user_id' => App::$instance->user->id, 'vks_id' => $vks->id, 'request_type' => OutlookCalendarRequest::REQUEST_TYPE_NEW, 'send_status' => OutlookCalendarRequest::SEND_STATUS_REQUIRED));
         App::$instance->log->logWrite(LOG_OTHER_EVENTS, "New Outlook request create for " . App::$instance->user->login . ', vks: ' . $vks->id);
         App::$instance->MQ->setMessage("Приглашение сформировано, ожидайте, отправка будет произведена в течении 2х минут");
     } else {
         if ($force) {
             $reSend = OutlookCalendarRequest::where('user_id', App::$instance->user->id)->where('vks_id', $vks->id)->first();
             $reSend->send_status = OutlookCalendarRequest::SEND_STATUS_REQUIRED;
             $reSend->save();
             App::$instance->log->logWrite(LOG_OTHER_EVENTS, "New Outlook request create for " . App::$instance->user->login . ', vks: ' . $vks->id);
             App::$instance->MQ->setMessage("Приглашение сформировано, ожидайте, отправка будет произведена в течении 2х минут");
         } else {
             App::$instance->MQ->setMessage("Приглашение уже отправлялось в ваш календарь, <a class='confirmation' href='" . ST::route('OutlookCalendarRequest/pushToStack/' . $vks->id . '/forced') . "'>Отправить еще раз</a>");
         }
     }
     ST::redirect('back');
 }
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:24,代码来源:OutlookCalendarRequest_controller.php


示例19: foreach

    ?>
            <table class="table table-bordered">

                <th>#ВКС</th>
                <th>Название</th>
                <th>Дата\время</th>
                <th>Точка</th>
                <th>Статус</th>
                <th>Создано</th>
                <?php 
    $c = 1;
    foreach ($calls as $call) {
        ?>
                    <tr>
                        <td><?php 
        echo ST::linkToVksPage($call->vks->id, true);
        ?>
</td>
                        <td><?php 
        echo $call->vks->title;
        ?>
</td>
                        <td>
                            <?php 
        echo date_create($call->vks->date)->format("d.m.Y");
        ?>
,
                            <?php 
        echo date_create($call->vks->start_date_time)->format("H:i");
        ?>
                            - <?php 
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:31,代码来源:showMyTsCalls.php


示例20:

<!--">Инициаторы</a> </li>-->
            <li><a href="<?php 
echo ST::route("Settings/editCodeDelivery");
?>
"><h3
                        style="margin-top: -15px;"><span
                            class="glyphicon glyphicon-globe"></span></h3>Шаблоны выдачи кодов подключения</a></li>
            <li><a href="<?php 
echo ST::route("BlockedTime/index");
?>
"><h3 style="margin-top: -15px;"><span
                            class="glyphicon glyphicon-time"></span></h3>Блокировки</a></li>
            <li><a href="<?php 
echo ST::route("Settings/managePublicMessage");
?>
"><h3 style="margin-top: -15px;"><span
                            class="glyphicon glyphicon-comment"></span></h3>Публичное сообщение</a></li>
            <li><a href="<?php 
echo ST::route("Settings/manageHelp");
?>
"><h3 style="margin-top: -15px;"><span
                            class="glyphicon glyphicon-question-sign"></span></h3>Подсказки на формах</a></li>
            <li><a href="<?php 
echo ST::route("Settings/editOther");
?>
"><h3 style="margin-top: -15px;"><span
                            class="glyphicon glyphicon-cog"></span></h3>Разное</a></li>

        </ul>
    </div>
开发者ID:inilotic,项目名称:vks_nodes_core,代码行数:30,代码来源:index.php



注:本文中的ST类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP STInput类代码示例发布时间:2022-05-23
下一篇:
PHP SS_Log类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap