本文整理汇总了PHP中BFCHelper::setInfoRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::setInfoRequest方法的具体用法?PHP BFCHelper::setInfoRequest怎么用?PHP BFCHelper::setInfoRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::setInfoRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inforequest_process
function inforequest_process()
{
$formData = isset($_POST['form']) ? $_POST['form'] : $_POST;
$checkin = isset($formData['CheckIn']['date']) ? $formData['CheckIn']['date'] : $formData['CheckIn'];
$checkout = isset($formData['CheckOut']['date']) ? $formData['CheckOut']['date'] : $formData['CheckOut'];
$customer = RSFormHelper::getCustomerData($formData);
$suggestedStay = null;
$redirect = $formData['Redirect'];
$otherData = "persone:" . RSFormHelper::getOptionsFromSelect($formData, 'Totpersons') . "|" . "accettazione:" . RSFormHelper::getOptionsFromSelect($formData, 'accettazione');
if (!empty($checkin) && !empty($checkout)) {
$sStay = array('CheckIn' => DateTime::createFromFormat('d/m/Y', $checkin)->format('Y-m-d\\TH:i:sO'), 'CheckOut' => DateTime::createFromFormat('d/m/Y', $checkout)->format('Y-m-d\\TH:i:sO'));
if ($formData['orderType'] == 'c') {
// $sStay['UnitId'] = '11' .$formData['resourceId'];
$resourceid = 0;
if (!empty($formData['resourceId'])) {
$resourceid = $formData['resourceId'];
}
if (!empty($_REQUEST['resourceid'])) {
$resourceid = $_REQUEST['resourceid'];
}
if (!empty($_POST['resourceid'])) {
$resourceid = $_POST['resourceid'];
}
$sStay['UnitId'] = $resourceid;
}
$suggestedStay = new stdClass();
foreach ($sStay as $key => $value) {
$suggestedStay->{$key} = $value;
}
$otherData .= "|" . "CheckIn:" . DateTime::createFromFormat('d/m/Y', $checkin)->format('Y-m-d') . "|" . "CheckOut:" . DateTime::createFromFormat('d/m/Y', $checkout)->format('Y-m-d');
if ($formData['orderType'] == 'c') {
$resourceid = 0;
if (!empty($formData['resourceId'])) {
$resourceid = $formData['resourceId'];
}
if (!empty($_REQUEST['resourceid'])) {
$resourceid = $_REQUEST['resourceid'];
}
if (!empty($_POST['resourceid'])) {
$resourceid = $_POST['resourceid'];
}
$otherData = $otherData . "|" . "UnitId:" . $resourceid;
}
} else {
if (!empty($formData['resourceId'])) {
$sStay = array('UnitId' => $formData['resourceId']);
$suggestedStay = new stdClass();
foreach ($sStay as $key => $value) {
$suggestedStay->{$key} = $value;
}
$otherData .= "|" . "UnitId:" . $formData['resourceId'];
}
}
$orderData = BFCHelper::prepareOrderData($formData, $customer, $suggestedStay, $otherData, null);
$orderData['processOrder'] = true;
$orderData['label'] = $formData['label'];
//echo '<PRE>';print_r($orderData);die();
$return = BFCHelper::setInfoRequest($orderData['customerData'], $orderData['suggestedStay'], $orderData['otherNoteData'], $orderData['merchantId'], $orderData['orderType'], $orderData['userNotes'], $orderData['label'], $orderData['cultureCode'], $orderData['processOrder']);
if (!empty($return)) {
if ($orderData['orderType'] == 'c') {
wp_redirect($redirect);
exit;
} else {
wp_redirect($redirect);
exit;
}
}
}
示例2: sendOnSellrequest
function sendOnSellrequest()
{
$formData = $_POST['form'];
$customer = RSFormHelper::getCustomerData($formData);
$suggestedStay = null;
$redirect = $formData['Redirect'];
$otherData = [];
if (!empty($formData['resourceId'])) {
$sStay = array('UnitId' => $formData['resourceId']);
$suggestedStay = new stdClass();
foreach ($sStay as $key => $value) {
$suggestedStay->{$key} = $value;
}
$otherData["UnitId:"] = "UnitId:" . $formData['resourceId'];
}
if (!empty($formData['pageurl'])) {
$otherData["pageurl:"] = "pageurl:" . $formData['pageurl'];
}
if (!empty($formData['title'])) {
$otherData["title:"] = "title:" . $formData['title'];
}
if (!empty($formData['resourceId'])) {
$otherData["onsellunitid:"] = "onsellunitid:" . $formData['resourceId'];
}
if (!empty($formData['accettazione'])) {
$otherData["accettazione:"] = "accettazione:" . RSFormHelper::getOptionsFromSelect($formData, 'accettazione');
}
$orderData = BFCHelper::prepareOrderData($formData, $customer, $suggestedStay, implode("|", $otherData), null);
$orderData['processOrder'] = true;
$orderData['label'] = $this->formlabel;
$return = BFCHelper::setInfoRequest($orderData['customerData'], $orderData['suggestedStay'], $orderData['otherNoteData'], $orderData['merchantId'], $orderData['orderType'], $orderData['userNotes'], $orderData['label'], $orderData['cultureCode'], $orderData['processOrder']);
if (empty($return)) {
$return = "";
}
echo json_encode($return);
$app = JFactory::getApplication();
$app->redirect($redirect, false);
$app->close();
}