Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Occupations::find()->orderBy('name');
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'period' => $this->period, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }
Exemplo n.º 2
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\modules\occupations\models\Occupations;
use frontend\models\Specialists;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;
use dosamigos\datepicker\DatePicker;
/* @var $this yii\web\View */
/* @var $form ActiveForm */
$this->title = "Заявки";
$specList = ArrayHelper::map(Occupations::find()->all(), 'id', 'name');
?>

<div class="request-edit">
    <div class="panel panel-info" style="width: 300px; float: left;">
        <div class="panel-heading">
            <h4 class="panel-title">
                Заполните начальные данные
            </h4>
        </div><!-- panel-heading -->
        <div class="panel-body form-group">
<?php 
echo Select2::widget(['class' => "form-control", 'id' => "ocupations", 'name' => "ocupations", 'value' => '', 'data' => $specList, 'options' => ['multiple' => false, 'placeholder' => 'Выберите специальность ...']]);
echo '<p />';
echo Select2::widget(['class' => "form-control", 'id' => "specialists", 'name' => "specialists", 'value' => '', 'options' => ['multiple' => false, 'placeholder' => '...']]);
echo '<p /><label for="date">
                Дата приёма с:
            </label>';
echo DatePicker::widget(['id' => 'date_from', 'name' => 'date_from', 'language' => 'ru', 'value' => date('d-m-Y', time()), 'template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd-mm-yyyy']]);
Exemplo n.º 3
0
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);
Exemplo n.º 4
0
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 
Exemplo n.º 5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getOccupation()
 {
     return $this->hasOne(Occupations::className(), ['id' => 'occupation_id']);
 }
Exemplo n.º 6
0
/* @var $form yii\widgets\ActiveForm */
?>

<div class="specialists-form">

    <?php 
$form = ActiveForm::begin();
?>
    
    <?php 
$list = ArrayHelper::map(Doctors::find()->orderBy('name')->all(), 'id', 'name');
echo $form->field($model, 'doctor_id')->widget(Select2::classname(), ['data' => $list, 'language' => 'ru', 'options' => ['placeholder' => 'Выберите врача ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <?php 
$list = ArrayHelper::map(Occupations::find()->orderBy('name')->all(), 'id', 'name');
echo $form->field($model, 'occupation_id')->widget(Select2::classname(), ['data' => $list, 'language' => 'ru', 'options' => ['placeholder' => 'Выберите специальность ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Добавить') : Yii::t('app', 'Изменить'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Exemplo n.º 7
0
$this->title = 'График';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="records-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
Pjax::begin();
echo Html::beginTag('div', ['class' => 'panel panel-info']);
$content = Html::tag('h3', '<i class="glyphicon glyphicon-calendar"></i> Графики', ['class' => "panel-title"]);
echo Html::tag('div', $content, ['class' => "panel-heading"]);
echo Html::endTag('div');
$occList = Occupations::getList();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function ($model) {
    $class = '';
    if ($model->reserved) {
        $class = 'success';
    }
    if ($model->visited) {
        $class = 'info';
    }
    return ['class' => $class];
}, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => 'yii\\grid\\CheckboxColumn', 'checkboxOptions' => function ($model) {
    return [$model->id];
}], ['attribute' => 'specialist_id', 'value' => 'specialist.doctor.name', 'format' => 'text', 'label' => 'Врач'], ['attribute' => 'occupationName', 'value' => 'specialist.occupation.name', 'format' => 'text', 'label' => 'Специальность'], ['attribute' => 'start_time', 'value' => function ($model) {
    $day = date('d', strtotime($model->start_time));
    $year = date('Y', strtotime($model->start_time));
    $month = date('m', strtotime($model->start_time));
Exemplo n.º 8
0
 public function actionIsDouble($name)
 {
     $result = false;
     $model = Occupations::findOne(['name' => $name]);
     if ($model) {
         $result = true;
     }
     return $result;
 }
Exemplo n.º 9
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\modules\occupations\models\Occupations;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model \frontend\modules\occupations\models\Occupations */
/* @var $form ActiveForm */
?>
<div class="admin-occupations">

    <?php 
$form = ActiveForm::begin();
?>

        <div class="jumbotron">
            <p class="lead">Выберите специальность.</p>
            <?php 
$models = Occupations::find()->orderBy('name')->all();
//массив
for ($i = 0; $i < count($models); $i++) {
    $url = Url::to(['records/admin-specialists', 'id' => $models[$i]->id]);
    $text = $models[$i]->name;
    $classes = 'btn btn-lg btn-info';
    echo '<p><a style="font-size: small; width: 250px;" class="' . $classes . '" href="' . $url . '">' . $text . '</a></p>';
}
?>
 
        </div>

</div><!-- admin-occupations -->
Exemplo n.º 10
0
 public static function getList()
 {
     $result = Occupations::find()->select(['id', 'name'])->all();
     $result = ArrayHelper::map($result, 'id', 'name');
     return $result;
 }