예제 #1
0
 public function saveDbStepOne()
 {
     if (isset($this->airport, $this->date, $this->flight_time, $this->name, $this->add1, $this->postCode, $this->email, $this->contact_num, $this->size, $this->flight_number, $this->type)) {
         $model = new BookService();
         $model->airport = $this->airport;
         $model->date = $this->date;
         $model->flight_time = $this->flight_time;
         $model->flight_number = $this->flight_number;
         $model->name = $this->name;
         $model->add1 = $this->add1;
         $model->type = $this->type;
         $model->city = $this->city;
         $model->post_code = $this->postCode;
         $model->email = $this->email;
         $model->contact_num = $this->contact_num;
         $model->contact_num_2 = $this->contact_num_2;
         $model->size = $this->size;
         $model->status = 1;
         $model->save(FALSE);
         Yii::app()->session['order_id'] = $model->id;
     }
 }
예제 #2
0
 public function saveDb($id)
 {
     if ($id != "") {
         $model = BookService::model()->findByAttributes(array('id' => $id));
     } else {
         $model = new BookService();
     }
     $model->airport = $this->airport;
     $model->date = $this->date;
     $model->flight_time = $this->flight_time;
     $model->flight_number = $this->flight_number;
     $model->name = $this->name;
     $model->add1 = $this->add1;
     $model->type = $this->type;
     //            $model->add2 = $this->add2;
     //            $model->add3 = $this->add3;
     $model->city = $this->city;
     //  $model->province = $this->province;
     //   $model->country = $this->country;
     $model->post_code = $this->postCode;
     $model->email = $this->email;
     $model->contact_num = $this->contact_num;
     $model->contact_num_2 = $this->contact_num_2;
     $model->size = $this->size;
     $model->save(FALSE);
 }