//if(!$ghd) { throw new NotFoundHttpException('Страница не найдена.');} $this->title = 'Расписание группы ' . $model->name; $this->params['breadcrumbs'][] = ['label' => 'Информация', 'url' => Url::to(['site/information'])]; $this->params['breadcrumbs'][] = ['label' => 'Расписание', 'url' => Url::to(['lesson/index'])]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="lesson-index"> <h3><?php echo "Расписание группы: " . Html::a($model->name, ['//group/view', 'id' => $model->id]); ?> </h3> <?php /* $ghd_id_arr = array(); foreach ($ghd as $grouphasdisc){ array_push($ghd_id_arr,$grouphasdisc->id); }; $lessons = Lesson::find()->where(['ghd_id' => $ghd_id_arr])->orderBy('week ASC, day ASC, time ASC')->all(); */ $lessons = Lesson::getLessonsList(['group' => $group]); echo Tabs::widget(['options' => ['class' => 'nav nav-pills nav-justified'], 'items' => [['label' => 'Неделя - 1', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 1])], ['label' => 'Неделя - 2', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 2])]]]); ?> </div> <?php Modal::begin(['header' => '', 'id' => 'modal', 'size' => 'modal-lg']); echo "<div id='modalContent'></div>"; Modal::end();
<?php use common\widgets\Schedule; use common\models\Lesson; use yii\bootstrap\Tabs; use yii\bootstrap\Html; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $lessons = Lesson::getLessonsList(['group' => $model->id]); echo Tabs::widget(['options' => ['class' => 'nav nav-pills nav-justified'], 'items' => [['label' => 'Неделя - 1', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 1])], ['label' => 'Неделя - 2', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 2])]]]);
$date = new DateTime(); $todayDate = $date->format("Y-m-d"); $Teacher = Teacher::findOne($teacher); if (!$Teacher) { throw new NotFoundHttpException('Страница не найдена.'); } //if(!$ghd) { echo Html::tag('h3','Расписания данной группы не существует или оно еще не заполнено!'); return;} $this->title = 'Расписание преподавателя ' . $Teacher->user->fullname; $this->params['breadcrumbs'][] = ['label' => 'Информация', 'url' => Url::to(['site/information'])]; $this->params['breadcrumbs'][] = ['label' => 'Расписание', 'url' => Url::to(['lesson/index'])]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="lesson-index"> <h3><?php echo "Расписание преподавателя: " . Html::button($Teacher->user->fullname, ['class' => 'btn btn-lg btn-link modalButton', 'value' => Url::to(['//teacher/view', 'id' => $Teacher->id])]); ?> </h3> <?php //$lessons = Lesson::find()->where(['teacher_id' => $teacher])->orderBy('week ASC, day ASC, time ASC')->all(); $lessons = Lesson::getLessonsList(['teacher' => $teacher]); echo Tabs::widget(['options' => ['class' => 'nav nav-pills nav-justified'], 'items' => [['label' => 'Неделя - 1', 'content' => Schedule::widget(['scenario' => Schedule::SCENARIO_TEACHER, 'lessons' => $lessons, 'week' => 1])], ['label' => 'Неделя - 2', 'content' => Schedule::widget(['scenario' => Schedule::SCENARIO_GROUP, 'lessons' => $lessons, 'week' => 2])]]]); ?> </div> <?php Modal::begin(['header' => '', 'id' => 'modal', 'size' => 'modal-lg']); echo "<div id='modalContent'></div>"; Modal::end();
<?php use yii\helpers\Html; use common\models\Lesson; use yii\bootstrap\Tabs; use common\widgets\Schedule; use yii\helpers\Url; $model = Yii::$app->user->identity->student->group; //Дисциплины $this->beginBlock('disciplines'); echo Html::beginTag('ul', ['class' => 'list-group']); foreach ($model->currentDisciplines as $ghd) { $teachers = array(); foreach ($ghd->teacherHasDiscipline as $thd) { $teachers[] = $thd->teacher; } echo Html::beginTag('li', ['class' => 'list-group-item']); echo Html::a($ghd->discipline->name, Url::to(['//group-has-discipline', 'id' => $ghd->id])); echo " Преподаватели:"; foreach ($teachers as $teacher) { echo Html::button($teacher->user->fullname, ['value' => Url::to(['user/view', 'id' => $teacher->user->id]), 'class' => 'btn-link modalButton']); } echo Html::endTag('li'); } echo Html::endTag('ul'); $this->endBlock('disciplines'); $lessons = Lesson::getLessonsList(['teacher' => Yii::$app->user->identity->student->id]); $schedule = Tabs::widget(['options' => ['class' => 'nav nav-pills nav-justified'], 'items' => [['label' => 'Неделя - 1', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 1])], ['label' => 'Неделя - 2', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 2])]]]); echo Tabs::widget(['options' => ['class' => 'nav nav-pills nav-justified'], 'items' => [['label' => 'Дисциплины', 'content' => $this->render('/group/_disciplines', ['model' => $model])], ['label' => 'Расписание', 'content' => $schedule]]]);
$this->params['breadcrumbs'][] = ['label' => 'Расписание', 'url' => Url::to(['lesson/index'])]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="lesson-index"> <h3><?php echo "Архив расписания группы: " . Html::a($groupModel->name, ['//group/view', 'id' => $groupModel->id]); ?> <?php echo Html::encode($formatter->asDate($semesterModel->begin_date) . "-" . $formatter->asDate($semesterModel->end_date)); ?> </h3> <?php /* $ghd_id_arr = array(); foreach ($ghd as $grouphasdisc){ array_push($ghd_id_arr,$grouphasdisc->id); }; $lessons = Lesson::find()->where(['ghd_id' => $ghd_id_arr])->orderBy('week ASC, day ASC, time ASC')->all(); */ $lessons = Lesson::getLessonsList(['group' => $group, 'semester' => $semester]); echo Tabs::widget(['items' => [['label' => 'Неделя - 1', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 1])], ['label' => 'Неделя - 2', 'content' => Schedule::widget(['scenario' => 'group', 'lessons' => $lessons, 'week' => 2])]]]); ?> </div> <?php Modal::begin(['header' => '', 'id' => 'modal', 'size' => 'modal-lg']); echo "<div id='modalContent'></div>"; Modal::end();