本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::getVehiclePriceSelected方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::getVehiclePriceSelected方法的具体用法?PHP Application_Model_DbTable_DbGlobal::getVehiclePriceSelected怎么用?PHP Application_Model_DbTable_DbGlobal::getVehiclePriceSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_DbTable_DbGlobal
的用法示例。
在下文中一共展示了Application_Model_DbTable_DbGlobal::getVehiclePriceSelected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bookingAction
public function bookingAction()
{
$db = new Application_Model_DbTable_DbGlobal();
$step_one = 0;
$step_two = 0;
$step_three = 0;
$step_five = 0;
//$step_four=0;
$customer_user_session = "";
$session_step_one = new Zend_Session_Namespace('booking');
$step_booking = $session_step_one->step_one;
$user_ip = $session_step_one->user_ip;
$step_4 = new Zend_Session_Namespace('step_four');
$session_step_four = $step_4->step4;
$customer_session = new Zend_Session_Namespace('customer');
$user_session = $customer_session->customer_session;
if (!empty($session_step_four)) {
$step_four = $session_step_four;
} else {
$step_four = 0;
}
if (!empty($user_session)) {
$customer_user_session = $user_session;
$customer_user = $customer_session->customer_id;
$this->view->user_name = $customer_session->customer_name;
$this->view->user_info = $customer_session->user_info;
} else {
$customer_user_session = 0;
}
if ($step_booking == "") {
$step_one = 0;
} else {
$step_one = $step_booking;
}
$data_first_step = array();
$row_vehicle = array();
$row_vehicle_price = array();
$row_equipment_price = array();
$row_driver_price = array();
$row_equipment = array();
$row_driver = array();
if ($step_one != 0) {
$post = $this->getRequest()->getPost();
if (isset($post["search_vehicle"])) {
$db->deleteVisaulBooking($user_ip, 2);
$row = $db->getAllAvailableVehicle($post);
if (!empty($row)) {
$db->updateVisualBookingStepOne($post, $user_ip);
}
$session_step_two = new Zend_Session_Namespace('step_two');
$session_step_two->unsetAll();
$session_step_three = new Zend_Session_Namespace('step_three');
$session_step_three->unsetAll();
$session_step_four = new Zend_Session_Namespace('step_four');
$session_step_four->unsetAll();
$session_step_five = new Zend_Session_Namespace('step_five');
$session_step_five->unsetAll();
//Application_Form_FrmMessage::redirectUrl("/index/booking");
}
$data_first_step = $db->getFirstStepData($user_ip);
$row_driver = $db->getAvailableDriver($data_first_step);
$row_equipment = $db->getEquipment($data_first_step);
$row_vehicle = $db->getAllAvailableVehicle($data_first_step);
$session_step_two = new Zend_Session_Namespace('step_two');
if ($session_step_two->step_two == "") {
$step_two = 0;
} else {
$step_two = $session_step_two->step_two;
}
if ($step_two != 0) {
$row_vehicle_price = $db->getVehiclePriceSelected($user_ip);
$session_step_three = new Zend_Session_Namespace('step_three');
if ($session_step_three->step_three == "") {
$step_three = 0;
} else {
$step_three = $session_step_three->step_three;
}
if ($step_three != 0) {
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
if (isset($data["pro_equip"])) {
if ($data["identity_equipment"] != "" or $data["identity_driver"] != "") {
$db->updateVisualBookingStebthree($user_ip, $data);
}
}
}
$row_equipment_price = $db->getProductAndServicesSelected($user_ip, 3);
$row_driver_price = $db->getProductAndServicesSelected($user_ip, 2);
if ($step_four != 0) {
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
if (isset($data["confirm_book"])) {
$session_step_five = new Zend_Session_Namespace('step_five');
$step_five = $session_step_five->step_five = 1;
} elseif (isset($data["term_condiction"])) {
$db->addCuFlight($data, $user_ip);
}
}
} else {
if ($this->getRequest()->isPost()) {
//.........这里部分代码省略.........
示例2: updateVisualBookingStepTwo
public function updateVisualBookingStepTwo($user_ip, $vehicle_id)
{
$db = $this->getAdapter();
$db_globle = new Application_Model_DbTable_DbGlobal();
$data_first_step = $this->getFirstStepData($user_ip);
$pickup_date = date_create($data_first_step["pickup_date"]);
$return_date = date_create($data_first_step["return_date"]);
$row_vehicle = $db_globle->getVehiclePriceSelected($user_ip);
$diff = date_diff($pickup_date, $return_date);
$total_day = $diff->format("%a%") + 1;
$sql = "SELECT v.`price`,v.`extraprice`,v.`vat_value` FROM `ldc_vehiclefee_detail` AS v WHERE v.`packageday_id`=(SELECT r.id FROM `ldc_rankday` AS r WHERE r.`from_amountday`<={$total_day} AND r.`to_amountday`>={$total_day} LIMIT 1) AND v.`vehicle_id` = {$vehicle_id}";
$row = $db->fetchRow($sql);
if (empty($row)) {
$sql = "SELECT v.`price`,v.`extraprice`,v.`vat_value` FROM `ldc_vehiclefee_detail` AS v WHERE v.`packageday_id`=(SELECT r.id FROM `ldc_rankday` AS r WHERE r.`is_morethen`=1 LIMIT 1) AND v.`vehicle_id` = {$vehicle_id}";
$row_data = $db->fetchRow($sql);
} else {
$row_data = $row;
}
$sqlv = "SELECT (SELECT m.`title` FROM `ldc_make` AS m WHERE m.id = v.`make_id`) AS make,(SELECT m.`title` FROM `ldc_model` AS m WHERE m.id = v.`model_id`) AS model,(SELECT s.`title` FROM `ldc_submodel`AS s WHERE s.id = v.`sub_model`) AS sub_model,(SELECT v.`title` FROM `ldc_vechicletye` AS v WHERE v.`id`=v.`car_type`) AS car_type,(SELECT t.`tran_name` FROM `ldc_transmission` AS t WHERE t.`id`=v.`transmission`) AS transation,v.`reffer`,v.ordering FROM `ldc_vehicle` AS v WHERE v.`id`={$vehicle_id}";
$row_vehicle = $db->fetchRow($sqlv);
//print_r($sql);
$total_price = $row_data["price"] * $total_day;
$total_vat = $total_price * ($row_data["vat_value"] / 100);
$bank_charge = ($total_price + $total_vat) * (3 / 100);
$deposite = ($total_price + $total_vat) * (50 / 100) + $bank_charge;
$arr = array('item_id' => $vehicle_id, 'item_name' => $row_vehicle["make"] . " " . $row_vehicle["model"] . " " . $row_vehicle["sub_model"] . " " . $row_vehicle["car_type"] . " " . $row_vehicle["transation"] . "(" . $row_vehicle["reffer"] . ")", 'price' => $row_data["price"], 'VAT' => $row_data["vat_value"], 'item_type' => 1, 'number_of_rent' => 1, 'deposite' => $deposite, 'refund_deposit' => $row_vehicle["ordering"], 'total' => $total_price + $total_vat, 'total_paymented' => $deposite);
$this->_name = "ldc_visurl_booking_detail";
$where = array("user_id=?" => $user_ip, "item_type=?" => 1);
$this->update($arr, $where);
}