<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use frontend\modules\doctors\models\Doctors; use frontend\models\Records; use frontend\models\Specialists; /* @var $this yii\web\View */ /* @var $model frontend\models\records */ /* @var $form ActiveForm */ $record = Records::findOne($id); $spec = Specialists::findOne($record->specialist_id); $doctor = Doctors::findOne($spec->doctor_id); $date = strtotime($record->start_time); $specialist_id = $record->specialist_id; $this->title = 'Регистрация заявки'; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Выбор времени приёма'), 'url' => ['list', 'date' => $date, 'id' => $specialist_id]]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="register"> <div class="jumbotron"> <?php echo '<h2>' . Html::label($doctor->name) . '</h2>'; echo '<h3>' . Html::label($doctor->description) . '</h3>'; echo '</div>'; $form = ActiveForm::begin(); echo $form->field($model, 'name')->input('text', ['value' => '']); echo $form->field($model, 'phone')->input('text', ['value' => '']); echo '<p />'; echo '<h3>' . Html::label('Время приёма:', 'lblTime', ['class' => "control-label"]) . ' ';
<?php 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">
public static function isDouble($doctor_id, $occupation_id) { $result = false; $model = Specialists::findOne(['doctor_id' => $doctor_id, 'occupation_id' => $occupation_id]); if ($model) { $result = true; } return $result; }
public function actionGetName($id) { $result = Specialists::findOne($id); $result = Doctors::findOne($result->doctor_id); return $result->name; }