Пример #1
0
 public function actionLogout()
 {
     if (isset($_SESSION['userid'])) {
         $session = new Session();
         $session->remove('userid');
         $session->remove('username');
         $session->remove('groupid');
     }
     return $this->redirect('index.php?r=login');
 }
Пример #2
0
 public function actionLogout()
 {
     if (isset($_SESSION['userid'])) {
         $session = new Session();
         $session->remove('userid');
         $session->remove('username');
         $session->remove('groupid');
     }
     //  return $this->redirect('index.php?r=login');
     return $this->redirect('http://stsoftware.strfactory.com/');
 }
Пример #3
0
 public function actionLogout()
 {
     if (isset($_SESSION['userid'])) {
         $session = new Session();
         $session->remove('userid');
         $session->remove('username');
         $session->remove('groupid');
     }
     //  return $this->redirect('index.php?r=login');
     return $this->redirect('http://www.strubber.co.th/');
 }
Пример #4
0
 public function actionLogout()
 {
     Yii::$app->user->logout();
     if (isset($_SESSION['userid'])) {
         $session = new Session();
         $session->remove('userid');
         $session->remove('username');
         $session->remove('groupid');
     }
     $model = new LoginForm();
     return $this->redirect('index.php?r=login/login');
 }
 public function actionShowjob()
 {
     $session = new Session();
     $session->open();
     $model = Alljobs::find()->where(['recid' => $session['recid']])->all();
     if ($model) {
         $session->remove('recid');
         $this->layout = 'mylayout';
         return $this->render('index', ['model' => $model]);
     }
 }
Пример #6
0
 public function actionAsistencia()
 {
     $session = new Session();
     if (!isset($session['comision'])) {
         $this->redirect(["clase/crear"]);
     }
     $msg = null;
     if (isset($_REQUEST['asistencia'])) {
         $si = [];
         $no = [];
         $fecha = $session['fecha'];
         $observacion = $session['observacion'];
         $id = $session['comision'];
         $datos = $_REQUEST['asistencia'];
         $n = count($datos);
         for ($i = 0; $i < $n; $i++) {
             $pos = strpos($datos[$i], "si");
             if ($pos !== false) {
                 $array = explode("-", $datos[$i], 2);
                 $si[] = $array[1];
             } else {
                 $array = explode("-", $datos[$i], 2);
                 $no[] = $array[1];
             }
         }
         $sql1 = "insert into clase (fecha,observaciones,id_comision) value ('{$fecha}','{$observacion}','{$id}')";
         $connection = \Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
             $connection->createCommand($sql1)->execute();
             $id = Yii::$app->db->getLastInsertID('clase');
             foreach ($si as $val) {
                 $nota = $_REQUEST[$val];
                 $connection->createCommand("insert into asistencia (id_clase,dni,asistencia,nota) value ('{$id}','{$val}',1,'{$nota}')")->execute();
             }
             foreach ($no as $val) {
                 $connection->createCommand("insert into asistencia (id_clase,dni,asistencia,nota) value ('{$id}','{$val}',0,10)")->execute();
             }
             $transaction->commit();
             $session->remove('fecha');
             $session->remove('comision');
             $session->remove('observaciones');
             $msg = "asistencia registrada con ecxito";
             $this->redirect(["clase/crear"]);
         } catch (\Exception $e) {
             //$msg = "problemas al registrar asistencia";
             throw $e;
         }
     }
     $comision = $session['comision'];
     $sql = "SELECT persona.nombre, persona.dni from persona,deportista_categoria,comision " . "WHERE comision.id_comision='{$comision}' and comision.id_categoria=deportista_categoria.id_categoria and " . "deportista_categoria.dni=persona.dni ";
     $alumnos = Yii::$app->db->createCommand($sql)->queryAll();
     $i = 1;
     $nota = null;
     $model = $alumnos;
     return $this->render("asistencia", ['model' => $model, 'msg' => $msg]);
 }
Пример #7
0
          Yii::$app->user->can('Administrator') ? [['label' => 'Настройки', 'url' => ['Fregat/fregat/config']]] : []
          ),
          ]);
          NavBar::end();
          } */
?>

        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'homeLink' => ['url' => Yii::$app->homeUrl, 'label' => '<span class="bc_lighter"></span><i class="glyphicon glyphicon-home"></i>', 'encode' => false]]);
?>

        <?php 
if (!isset($this->params['breadcrumbs'])) {
    $session = new Session();
    $session->open();
    $session->remove('breadcrumbs');
    $session->close();
}
?>
        <?php 
echo $content;
?>
    </div>
    <div class="buttonside" id="scrollupbutton" style="display: none;">
        <span>ВВЕРХ</span>
    </div>

    <a class="buttonside" id="backbutton" href="<?php 
echo Proc::GetPreviousURLBreadcrumbsFromSession() === Yii::$app->homeUrl ? '#' : Proc::GetPreviousURLBreadcrumbsFromSession();
?>
" style="display: none;">
Пример #8
0
 /**
  * Формирует массив настроек для Nav::Widget(['items' => Proc::GetMenuButtons($this)]).
  * @param View $View Текущее представление.
  * @return array Массив конфигурации меню навигации.
  */
 public static function GetMenuButtons($View)
 {
     $controller = Yii::$app->controller;
     $default_controller = Yii::$app->defaultRoute;
     $isHome = $controller->id === $default_controller && $controller->action->id === $controller->defaultAction ? true : false;
     $urls = ['fregat_mainmenu' => 'Fregat/fregat/mainmenu', 'fregat_conf' => 'Fregat/fregat/config', 'config_conf' => 'Config/config/index', 'glauk_index' => 'Base/patient/glaukindex', 'glauk_conf' => 'Glauk/glaukuchet/config'];
     $session = new Session();
     $session->open();
     foreach ($urls as $url) {
         // Записываем в сессию url меню
         if ($url === $View->context->module->requestedRoute) {
             $session['currentmenuurl'] = $url;
             break;
         }
     }
     $result = [];
     if (!$isHome) {
         $menubuttons = isset($session['menubuttons']) ? $session['menubuttons'] : null;
         switch ($menubuttons) {
             case 'fregat':
                 $result = array_merge(Yii::$app->user->can('FregatUserPermission') ? [['label' => 'Основное меню', 'url' => [$urls['fregat_mainmenu']], 'options' => $session['currentmenuurl'] === $urls['fregat_mainmenu'] ? ['class' => 'active'] : []]] : [], Yii::$app->user->can('FregatUserPermission') ? [['label' => 'Настройки', 'url' => [$urls['fregat_conf']], 'options' => $session['currentmenuurl'] === $urls['fregat_conf'] ? ['class' => 'active'] : []]] : []);
                 break;
             case 'config':
                 $result = array_merge(Yii::$app->user->can('UserEdit') || Yii::$app->user->can('RoleEdit') ? [['label' => 'Настройки портала', 'url' => [$urls['config_conf']], 'options' => $session['currentmenuurl'] === $urls['config_conf'] ? ['class' => 'active'] : []]] : []);
                 break;
             case 'glauk':
                 $result = array_merge(Yii::$app->user->can('GlaukUserPermission') ? [['label' => 'Пациенты', 'url' => [$urls['glauk_index']], 'options' => $session['currentmenuurl'] === $urls['glauk_index'] ? ['class' => 'active'] : []]] : [], Yii::$app->user->can('GlaukOperatorPermission') ? [['label' => 'Настройки', 'url' => [$urls['glauk_conf']], 'options' => $session['currentmenuurl'] === $urls['glauk_conf'] ? ['class' => 'active'] : []]] : []);
                 break;
         }
     } else {
         $session->remove('menubuttons');
         $session->remove('currentmenuurl');
     }
     $session->close();
     return $result;
 }
 /**
  * Resets the wizard by deleting the wizard session.
  */
 public function reset()
 {
     $this->_session->remove($this->_branchKey);
     $this->_session->remove($this->_stepsKey);
     $this->_session->remove($this->_timeoutKey);
 }