本文整理汇总了PHP中Reservation::addReservation方法的典型用法代码示例。如果您正苦于以下问题:PHP Reservation::addReservation方法的具体用法?PHP Reservation::addReservation怎么用?PHP Reservation::addReservation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reservation
的用法示例。
在下文中一共展示了Reservation::addReservation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reserveAction
public function reserveAction()
{
$form = new Form_Reserve();
$submit = $this->_request->getParam("submit");
$params = $this->_getAllParams();
$user = Zend_Auth::getInstance()->getIdentity()->user;
$subaction = isset($params['subaction']) ? $params['subaction'] : null;
$this->view->subaction = $subaction;
$this->view->title = self::$_translate->_("Add Reservation");
switch ($subaction) {
case "submit":
$this->view->isValid = true;
$params['user_id'] = $user->id;
if (Reservation::isAvailable($params)) {
Reservation::addReservation($params);
$this->reservationNotifyAdmins($user, $params);
// $this->view->redirect = $this->baseUrl."/index/index";
$this->setMessage($this->_("Reservation added"));
} else {
$this->setMessage($this->_("You reservation is not valid"));
$this->createAjaxButton("Close", "close");
}
break;
default:
$form->startDate->setValue(date("Y-m-d H:i", strtotime($params['startDate'])));
$form->endDate->setValue(date("Y-m-d H:i", strtotime($params['endDate'])));
$form->aircraft->setMultiOptions(App_Utils::toList($user->Aircraft, 'id', 'name'));
$this->view->form = $form->toArray();
$this->createAjaxButton("Add", "submit", $params, "/index/reserve/format/json/subaction/submit");
break;
}
$this->view->messages = $this->getMessages();
}
示例2: header
//$user_id=mysqli_real_escape_string($adduserobj->conxn,$_POST['user_id']);
$reservationname = mysqli_real_escape_string($adduserobj->conxn, $_POST['reservationname']);
$telephone_home = mysqli_real_escape_string($adduserobj->conxn, $_POST['telephone_home']);
$address = mysqli_real_escape_string($adduserobj->conxn, $_POST['address']);
$telephone_business = mysqli_real_escape_string($adduserobj->conxn, $_POST['telephone_business']);
$no_of_people = mysqli_real_escape_string($adduserobj->conxn, $_POST['no_of_people']);
$date_of_arrival = mysqli_real_escape_string($adduserobj->conxn, $_POST['date_of_arrival']);
$email = mysqli_real_escape_string($adduserobj->conxn, $_POST['email']);
$comments = mysqli_real_escape_string($adduserobj->conxn, $_POST['comments']);
//$adduserobj->setUserID($user_id);
$adduserobj->setReservationname($reservationname);
$adduserobj->setTelephoneHome($telephone_home);
$adduserobj->setAddress($address);
$adduserobj->setTelephoneBusiness($telephone_business);
$adduserobj->setNoOfPeople($no_of_people);
$adduserobj->setDateOfArrival($date_of_arrival);
$adduserobj->setEmail($email);
$adduserobj->setComments($comments);
//$adduserobj->setError($er);
//$adduserobj->setMessage($msg);
$flag = $adduserobj->addReservation();
/*echo '<pre>';
print_r ($adduserobj);
echo '</pre>';
exit;*/
if ($flag) {
header('location:../../rms/reservation.php');
$_SESSION['msg'] = $adduserobj->msg = "Thanks, You have reserved sucessfully";
} else {
echo $_SESSION['msg'] = $adduserobj->msg = "Sorry the user has not been added, please try again later";
}