示例#1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Viziting::find();
     $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;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'title', $this->title]);
     return $dataProvider;
 }
示例#2
0
文件: _form.php 项目: arsik/xfit
?>

    <?php 
echo $form->field($model, 'cost')->textInput();
?>

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

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

    <?php 
$vizitings = \app\models\Viziting::find()->all();
$items = ArrayHelper::map($vizitings, 'id', 'title');
$params = ['prompt' => 'Выберите время'];
echo $form->field($model, 'vizitingID')->dropDownList($items, $params);
?>

    <?php 
$durations = \app\models\Duration::find()->all();
$items = ArrayHelper::map($durations, 'id', 'title');
$params = ['prompt' => 'Выберите срок'];
echo $form->field($model, 'durationID')->dropDownList($items, $params);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
示例#3
0
 public function actionViziting()
 {
     if (Yii::$app->request->isAjax) {
         $vizitingID = Yii::$app->request->get('viziting');
         if ($vizitings = Viziting::find()->where(['id' => $vizitingID])->asArray()->one()) {
             return json_encode($vizitings, JSON_UNESCAPED_UNICODE);
         } else {
             return 'Viziting is not found';
         }
     }
     return $this->redirect('index');
 }
示例#4
0
 /**
  * Finds the Viziting model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Viziting the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Viziting::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#5
0
文件: index.php 项目: arsik/xfit
<div class="col-xs-12 col-sm-9">
  <p class="pull-right visible-xs">
    <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Меню</button>
  </p>
  <div class="row">

  </div><!--/row-->
</div><!--/span-->

  <?php 
$cities = \app\models\City::find()->count();
$clubs = \app\models\Clubs::find()->count();
$cards = \app\models\Cards::find()->count();
$types = \app\models\Types::find()->count();
$orders = \app\models\Order::find()->count();
$viziting = \app\models\Viziting::find()->count();
$duration = \app\models\Duration::find()->count();
?>

<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
  <div class="list-group">
    <?php 
if (Yii::$app->user->identity->username == "admin") {
    echo '<a href="/city" class="list-group-item">Города (' . $cities . ')</a>
      <a href="/clubs" class="list-group-item">Клубы (' . $clubs . ')</a>
      <a href="/cards" class="list-group-item">Карты (' . $cards . ')</a>
      <a href="/types" class="list-group-item">Типы карт (' . $types . ')</a>
      <a href="/viziting" class="list-group-item">Время посещений (' . $viziting . ')</a>
      <a href="/duration" class="list-group-item">Сроки действия карт (' . $duration . ')</a>';
}
?>