use yii\helpers\Html; use yii\grid\GridView; use frontend\modules\doctors\models\Doctors; use frontend\models\Specialists; use frontend\modules\occupations\models\Occupations; use frontend\models\Records; use yii\helpers\Url; //use Yii; /* @var $this yii\web\View */ /* @var $searchModel frontend\models\RecordsSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $dt = date('d-m-Y', $date); $spec = Specialists::findOne($id); $doctor = Doctors::findOne($spec->doctor_id); $occupation = Occupations::findOne($spec->occupation_id); $this->title = 'Выбор времени приёма'; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Выбор даты'), 'url' => ['specialists/viewss', 'id' => $spec->occupation_id]]; $this->params['breadcrumbs'][] = $this->title; echo Html::beginTag('div'); echo Html::beginTag('div', ['class' => "page-header"]); echo Html::tag('h3', Html::encode($this->title)); echo Html::tag('h2', $doctor->name); echo Html::tag('h4', $doctor->description); $month = Records::$monthsFull[(int) date('m', $date) - 1]; echo '<h4><strong>' . date("d", $date) . ' ' . $month . ' ' . date('Y', $date) . '</strong></h4>'; echo Html::endTag('div'); ?> <div class="records-list"> <?php
use yii\widgets\ActiveForm; use frontend\models\Specialists; use yii\helpers\Url; use frontend\modules\doctors\models\Doctors; use frontend\modules\occupations\models\Occupations; use frontend\models\Records; /* @var $this yii\web\View */ /* @var $model frontend\models\Specialists */ /* @var $form ActiveForm */ ?> <div class="viewSpec"> <div class="jumbotron"> <p class="lead"> <?php $occupation = Occupations::findOne(['id' => $id]); $this->title = 'Выбор даты приёма'; $this->params['breadcrumbs'][] = $this->title; ?> </p> <?php $models = Specialists::findAll(['occupation_id' => $id]); //setlocale(LC_ALL, 'ru_RU.UTF-8'); //setlocale(LC_TIME, 'ru_RU.CP1251', 'rus_RUS.CP1251', 'Russian_Russia.1251', 'ru_RU.UTF-8'); if (count($models) > 0) { echo '<div class="page-header">'; echo '<h2>' . $occupation->name . ': Выберите дату приёма</h2>'; echo '</div><p />'; $tm = time(); $dt = date("w", $tm); $numberOfDay = date("w", $tm);
public function actionIsDouble($name) { $result = false; $model = Occupations::findOne(['name' => $name]); if ($model) { $result = true; } return $result; }