示例#1
0
 /**
  * Finds the Locality model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Locality the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Locality::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#2
0
 public function actionContact()
 {
     $this->layout = 'main_without_container';
     $models = Locality::find()->andWhere(['not', ['contact' => '']])->andWhere(['not', ['contact' => null]])->all();
     return $this->render('contact', ['models' => $models]);
 }
示例#3
0
文件: _form.php 项目: andreyvaslv/crb
echo $form->field($model, 'snils')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'last_name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'first_name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'patronymic')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'localities')->checkboxList(Locality::getList(), ['class' => 'checkbox-list']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-success']);
?>
    </div>

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

</div>
示例#4
0
文件: _form.php 项目: andreyvaslv/crb
/* @var $model app\modules\appointment\models\Patient */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="patient-form">

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

    <?php 
echo $form->field($model, 'blocked')->checkbox();
?>

    <?php 
echo $form->field($model, 'locality_id')->dropDownList(Locality::getList());
?>

    <?php 
echo $form->field($model, 'physician_id')->dropDownList(\app\modules\appointment\models\Physician::getList());
?>

    <?php 
echo $form->field($model, 'policy')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'last_name')->textInput(['maxlength' => true]);
?>

    <?php 
示例#5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLocality()
 {
     return $this->hasOne(Locality::className(), ['locality_id' => 'locality_id']);
 }
示例#6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLocalities()
 {
     return $this->hasMany(Locality::className(), ['locality_id' => 'locality_id'])->viaTable('physician_locality', ['physician_id' => 'physician_id']);
 }