Example #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"]) . '   ';
Example #2
0
 /**
  * Проверка на наличие совпадающих записей
  * @param type $name ФИО доктора
  * @return boolean
  */
 public function actionIsDouble($name)
 {
     $result = false;
     $model = Doctors::findOne(['name' => $name]);
     if ($model) {
         $result = true;
     }
     return $result;
 }
Example #3
0
         $color = 'black';
     }
     $month = date("n", $tm);
     $month = Records::$months[$month - 1];
     echo '<td style="color: ' . $color . ';">' . Records::$days[$dt] . '<br />' . date("j ", $tm) . $month . '</td>';
     $tm += 60 * 60 * 24;
     $numberOfDay = date("w", $tm);
     $dt = date("w", $tm);
 }
 echo '</tr>';
 for ($i = 0; $i < count($models); $i++) {
     $dt = time();
     // сегодняшняя дата
     echo '<tr>';
     $url = '';
     $doctor = Doctors::findOne(['id' => $models[$i]->doctor_id]);
     $text = '<strong>' . $doctor->name . '</strong><br />';
     $text .= $doctor->description;
     echo '<td style="border-bottom: 1px solid red; text-align: justify;">' . $text . '</td>';
     for ($j = 0; $j < 7; $j++) {
         $count = $models[$i]->getCountRecords($dt);
         $href = Url::to(['records/list', 'date' => $dt, 'id' => $models[$i]->id]);
         //                        $href= 'records/list?id='.$models[$i]->id;
         if ($count != 0) {
             $type = '';
             $class = 'btn-primary btn-lg';
             $text = '9:00-14:00<br/ >приёмов:<br />' . $count;
         } else {
             $type = 'disabled';
             //$class = 'btn-success';
             //$class = 'btn-primary';
 public function actionGetName($id)
 {
     $result = Specialists::findOne($id);
     $result = Doctors::findOne($result->doctor_id);
     return $result->name;
 }