Exemplo n.º 1
0
 public function actionOrder($id, $hallid)
 {
     $res = Hall::find()->select('hall_seat')->where(['id' => $hallid])->asArray()->one();
     $res = $res['hall_seat'];
     $res2 = Order::find()->select('seats')->where(['session_id' => $id])->asArray()->one();
     $res2 = $res2['seats'];
     $res2 = explode(",", $res2);
     return $this->render('seats', ['id' => $id, 'res' => $res, 'res2' => $res2]);
 }
Exemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Hall::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]);
     $query->andFilterWhere(['like', 'hall_name', $this->hall_name]);
     return $dataProvider;
 }
Exemplo n.º 3
0
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $model common\models\Session */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="session-form">

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



    <?php 
echo $form->field($model, 'hall_id')->dropDownList(\yii\helpers\ArrayHelper::map(\common\models\Hall::find()->all(), 'id', 'hall_name'), ['prompt' => 'Select Hall']);
?>

    <?php 
echo $form->field($model, 'start_time')->dropDownList(\yii\helpers\ArrayHelper::map(\common\models\Time::find()->where(['6' => '0'])->all(), 'time_id', 'time_list'), ['prompt' => 'Select time', "disabled" => "disabled"]);
?>

    <?php 
echo $form->field($model, 'movie_id')->dropDownList(\yii\helpers\ArrayHelper::map(\common\models\Movie::find()->all(), 'id', 'name'), ['prompt' => 'Select Movie', "disabled" => "disabled"]);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>