Exemple #1
0
<?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"]) . '   ';
 public function actionDeleteRecord($items)
 {
     $items = explode(",", $items);
     Yii::$app->session->setFlash('success', $items);
     foreach ($items as $item) {
         $model = Records::findOne($item)->delete();
     }
     $searchModel = new RecordsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }