예제 #1
0
 /**
  * Creates a new Venue model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Venue();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->Id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
예제 #2
0
 /**
  * Creates a new Venue model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Venue();
     $map = new \common\models\VenueMap();
     //$dataVenue=array();
     //$dataVenue=Yii::$app->request->post();
     //echo '<pre>';
     //if(count($dataVenue['Venue'])>0)
     // {
     // $data = Locality::find()->where(['Id'=>$dataVenue['Venue']['localityId']])->one();
     //$dataVenue['Venue']['zoneId']= $data['zoneId'];
     //}
     //var_dump($dataVenue);
     //die;
     if ($model->load(Yii::$app->request->post()) && $model->editsave()) {
         //if ($model->load($dataVenue) && $model->save())
         //{
         Yii::$app->session->setFlash("venue_notification", Yii::t("app", "Venue Created!"));
         return $this->redirect(['view', 'id' => $model->Id]);
         //echo "raj";
     } else {
         return $this->render('create', ['model' => $model, 'map' => $map]);
     }
 }