/** Add My Booth */ public function actionBoothschedule() { if (Yii::$app->request->post()) { $boothschedule = new BoothSchedules(); $value = \Yii::$app->request->post(); if (isset($value['booth_id']) && isset($value['attendee_id'])) { $userid = User::findOne(['id' => $value['attendee_id']]); if ($userid) { $contact = AmgenContactList::findOne($userid->attendee_id); $checkboothexits = $boothschedule->findOne(['booth_id' => $value['booth_id'], 'attendee_id' => $userid->attendee_id]); if ($checkboothexits) { echo "Booth is already added for this attendee"; } else { $boothschedule->booth_id = $value['booth_id']; $boothschedule->attendee_id = $userid->attendee_id; $boothschedule->function_id = $contact->function_Id; $boothschedule->cost_center_id = ""; $boothschedule->status_id = 1; if ($boothschedule->save(FALSE)) { echo "Booth Schedule is Added"; } } } else { echo "Contact List not exist"; } } else { echo "Please fill required "; } } }
/** * Creates a new BoothSchedules model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new BoothSchedules(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }