• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TravelHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中TravelHelper的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper类的具体用法?PHP TravelHelper怎么用?PHP TravelHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TravelHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: do_add_to_cart

 function do_add_to_cart($array = array())
 {
     $default = array('item_id' => '', 'number_room' => 1, 'price' => '', 'check_in' => '', 'check_out' => '', 'adult' => 1, 'children' => 0);
     extract(wp_parse_args($array, $default));
     $data = array('check_in' => $check_in, 'check_out' => $check_out, 'currency' => TravelHelper::get_default_currency('symbol'), 'adult' => $adult, 'children' => $children);
     STCart::add_cart($item_id, $number_room, $price, $data);
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:7,代码来源:class.cruise.php


示例2: product_cat_column

 public function product_cat_column($columns, $column, $id)
 {
     if ($column == 'icon') {
         $icon = get_tax_meta($id, 'st_icon');
         $columns .= '<i style="font-size:24px" class="' . TravelHelper::handle_icon($icon) . '"></i>';
     }
     return $columns;
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:8,代码来源:class.attributes.php


示例3: getListDate

 static function getListDate($start, $end)
 {
     $start = new DateTime($start);
     $end = new DateTime($end . ' +1 day');
     $list = array();
     foreach (new DatePeriod($start, new DateInterval('P1D'), $end) as $day) {
         $list[] = $day->format(TravelHelper::getDateFormat());
     }
     return $list;
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:10,代码来源:class.stadmin.php


示例4: add_scripts

 function add_scripts()
 {
     if (TravelHelper::is_https()) {
         wp_register_script('gmap-api', 'https://maps.google.com/maps/api/js?sensor=false&amp;language=en&amp;libraries=places', null, false, true);
     } else {
         wp_register_script('gmap-api', 'http://maps.google.com/maps/api/js?sensor=false&amp;language=en&amp;libraries=places', null, false, true);
     }
     wp_register_script('gmapv3', $this->_url . 'js/gmap3.min.js', array('jquery', 'gmap-api'), false, true);
     wp_register_script('bt-gmapv3-init', $this->_url . 'js/init.js', array('gmapv3'), false, true);
     wp_register_style('bt-gmapv3', $this->_url . 'css/bt-gmap.css');
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:11,代码来源:gmap.php


示例5: _format_money

 /**
  *
  *
  * @since 1.1.3
  * */
 static function _format_money()
 {
     $data = STInput::post('money_data', array());
     if (!empty($data)) {
         foreach ($data as $key => $value) {
             $data[$key] = TravelHelper::format_money($value);
         }
     }
     echo json_encode(array('status' => 1, 'money_data' => $data));
     die;
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:16,代码来源:travel-helper.php


示例6: init_metabox

 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Room Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('hotel_room'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Hotel', ST_TEXTDOMAIN), 'id' => 'room_parent', 'type' => 'post_select_ajax', 'desc' => __('Choose the hotel that the room belong', ST_TEXTDOMAIN), 'post_type' => 'st_hotel', 'placeholder' => __('Search for a Hotel', ST_TEXTDOMAIN)), array('label' => __('Number of Room', ST_TEXTDOMAIN), 'id' => 'number_room', 'type' => 'text', 'desc' => __('Number of rooms available for book', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('hotel_room')), array('label' => __('Room Price', ST_TEXTDOMAIN), 'id' => 'room_price_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Per night', ST_TEXTDOMAIN)), array('label' => __('Discount Rate', ST_TEXTDOMAIN), 'id' => 'discount_rate', 'type' => 'text', 'desc' => __('Discount by %', ST_TEXTDOMAIN)), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Additional paid options', ST_TEXTDOMAIN), 'desc' => __('Additional paid options', ST_TEXTDOMAIN), 'id' => 'paid_options', 'type' => 'list-item', 'settings' => array(array('id' => 'price', 'type' => 'text', 'std' => 0, 'label' => __('Price', ST_TEXTDOMAIN)))), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Room Facility', ST_TEXTDOMAIN), 'id' => 'room_detail_tab', 'type' => 'tab'), array('label' => __('Adults Number', ST_TEXTDOMAIN), 'id' => 'adult_number', 'type' => 'text', 'desc' => __('Number of Adults in room', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('Children Number', ST_TEXTDOMAIN), 'id' => 'children_number', 'type' => 'text', 'desc' => __('Number of Children in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Beds Number', ST_TEXTDOMAIN), 'id' => 'bed_number', 'type' => 'text', 'desc' => __('Number of Beds in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'desc' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'id' => 'room_footage', 'type' => 'text'), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_room_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>")));
     $data_paypment = STPaymentGateways::$_payment_gateways;
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     parent::register_metabox($this->metabox);
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:18,代码来源:class.admin.room.php


示例7: _get_car_cant_order_by_id

 static function _get_car_cant_order_by_id($car_id, $check_in, $check_out, $order_item_id = '')
 {
     if (!TravelHelper::checkTableDuplicate('st_cars')) {
         return true;
     }
     global $wpdb;
     $string = "";
     if (!empty($order_item_id)) {
         $string = " AND order_item_id NOT IN ('{$order_item_id}') ";
     }
     $sql = "SELECT\r\n\t\t\tst_booking_id as car_id,\r\n\t\t\tmt.meta_value as number_car,\r\n\t\t\tmt.meta_value - COUNT(st_booking_id) as car_free\r\n\t\t\tFROM {$wpdb->prefix}st_order_item_meta\r\n\t\t\tINNER JOIN {$wpdb->prefix}postmeta as mt ON mt.post_id = st_booking_id AND mt.meta_key = 'number_car'\r\n\t\t\tWHERE\r\n\t\t\tst_booking_post_type = 'st_cars'\r\n\t\t\tAND status NOT IN ('trash', 'canceled')\r\n\t\t\tAND st_booking_id = '{$car_id}'\r\n\t\t\tAND (\r\n\t\t\t\t({$check_in} < check_in_timestamp AND {$check_out} > check_out_timestamp)\r\n\t\t\t\tOR(\r\n\t\t\t\t{$check_in} BETWEEN check_in_timestamp AND check_out_timestamp\r\n\t\t\t)\r\n\t\t\t\tOR(\r\n\t\t\t\t{$check_out} BETWEEN check_in_timestamp AND check_out_timestamp\r\n\t\t\t)\r\n\t\t\t)\r\n\t\t\t{$string}\r\n\t\t\tGROUP BY st_booking_id\r\n\t\t\tHAVING (mt.meta_value - COUNT(st_booking_id) <= 0)";
     $result = $wpdb->get_results($sql, ARRAY_A);
     if (is_array($result) && count($result)) {
         return false;
     }
     return true;
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:17,代码来源:car.helper.php


示例8: _save_post

 public function _save_post($id)
 {
     if (!TravelHelper::checkTableDuplicate('st_hotel')) {
         return;
     }
     if (isset($_GET['post_type']) && $_GET['post_type'] == 'st_hotel' && isset($_GET['section']) && $_GET['section'] == 'edit_order_item' && isset($_GET['order_item_id'])) {
         $item_id = $_GET['order_item_id'];
         $status = $_POST['status'];
         if ($status == 'canceled') {
             $status = 'trash';
         }
         global $wpdb;
         $table = $wpdb->prefix . 'st_order_item_meta';
         $data = array('status' => $status);
         $where = array('order_item_id' => $item_id);
         $rs = $wpdb->update($table, $data, $where);
     }
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:18,代码来源:class.admin.normal.checkout.php


示例9: _get_disable_date

 static function _get_disable_date()
 {
     $disable = array();
     $activity_id = STInput::request('activity_id', '');
     $activity_id = apply_filters('st_get_post_id_origin', $activity_id);
     if (empty($activity_id)) {
         echo json_encode($disable);
         die;
     }
     $year = STInput::request('year', date('Y'));
     global $wpdb;
     $sql = "SELECT\r\n\t\t\t\torigin_id as activity_id,\r\n\t\t\t\tcheck_in_timestamp as check_in,\r\n\t\t\t\tcheck_out_timestamp as check_out,\r\n\t\t\t\tadult_number,\r\n\t\t\t\tchild_number,\r\n\t\t\t\tinfant_number\r\n\t\t\t\tFROM\r\n\t\t\t\t\t{$wpdb->prefix}st_order_item_meta\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tst_booking_post_type = 'st_activity'\r\n\t\t\t\tAND origin_id = '{$activity_id}'\r\n\t\t\t\tAND status NOT IN ('trash', 'canceled')\r\n\t\t\t\tAND YEAR (\r\n\t\t\t\t\tFROM_UNIXTIME(check_in_timestamp)\r\n\t\t\t\t) = {$year}\r\n\t\t\t\tAND YEAR (\r\n\t\t\t\t\tFROM_UNIXTIME(check_out_timestamp)\r\n\t\t\t\t) = {$year}";
     $result = $wpdb->get_results($sql, ARRAY_A);
     if (is_array($result) && count($result)) {
         $list_date = array();
         foreach ($result as $key => $val) {
             $list_date[] = array('check_in' => $val['check_in'], 'check_out' => $val['check_out'], 'adult_number' => $val['adult_number'], 'child_number' => $val['child_number'], 'infant_number' => $val['infant_number']);
         }
     }
     if (isset($list_date) && count($list_date)) {
         $min_max = self::_get_minmax($activity_id, $year);
         if (is_array($min_max) && count($min_max)) {
             $max_people = intval(get_post_meta($activity_id, 'max_people', true));
             for ($i = intval($min_max['check_in']); $i <= intval($min_max['check_out']); $i = strtotime('+1 day', $i)) {
                 $people = 0;
                 foreach ($result as $key => $date) {
                     if ($i == intval($date['check_in'])) {
                         $people += intval($date['adult_number']) + intval($date['child_number']) + intval($date['infant_number']);
                     }
                 }
                 if ($people >= $max_people) {
                     $disable[] = date(TravelHelper::getDateFormat(), $i);
                 }
             }
         }
     }
     if (count($disable)) {
         echo json_encode($disable);
         die;
     }
     echo json_encode($disable);
     die;
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:43,代码来源:activity.helper.php


示例10: _e

            _e('review', ST_TEXTDOMAIN);
        }
        ?>
                                </p>
                            <?php 
    }
    ?>
                            <?php 
    if (!empty($offer)) {
        ?>
                                <p class="mb0">
                                    <?php 
        if ($offer > 1) {
            printf(__('%d offers from %s', ST_TEXTDOMAIN), $offer, TravelHelper::format_money($min_price));
        } else {
            printf(__('%d offer from %s', ST_TEXTDOMAIN), $offer, TravelHelper::format_money($min_price));
        }
        ?>
                                </p>
                            <?php 
    }
    ?>
                        </div>
                    </div>
                </a>
            </div>
        </div>
<?php 
}
?>
</div>
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:loop-normal.php


示例11: __

    ?>
                        </td>
                    </tr>
                    <?php 
}
?>
                    <tr>
                        <td  style="border-bottom: 1px dashed #ccc;padding:10px;">
                            <strong><?php 
echo __('Pay Amount :', ST_TEXTDOMAIN);
?>
</strong>
                        </td>
                        <td style="border-bottom: 1px dashed #ccc;padding:10px;">
                            <?php 
echo TravelHelper::format_money($total_price);
?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

    </tfoot>


            </table>
            <?php 
echo st()->load_template('email/booking_customer_infomation', null, array('order_id' => $order_id));
?>
        </td>
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:booking_infomation_tours.php


示例12: wp_nonce_field

wp_nonce_field('submit_form_order', 'travel_order');
?>

    <?php 
$info_price = STCars::get_info_price();
$cars_price = $info_price['price'];
$count_sale = $info_price['discount'];
if (!empty($count_sale)) {
    $price = $info_price['price'];
    $price_sale = $info_price['price_old'];
}
$pick_up_date = TravelHelper::convertDateFormat(STInput::request('pick-up-date'));
if (!$pick_up_date) {
    $pick_up_date = date('m/d/Y', strtotime("now"));
}
$drop_off_date = TravelHelper::convertDateFormat(STInput::request('drop-off-date'));
if (!$drop_off_date) {
    $drop_off_date = date('m/d/Y', strtotime("+1 day"));
}
$pick_up_time = STInput::request('pick-up-time', '12:00 PM');
$drop_off_time = STInput::request('drop-off-time', '12:00 PM');
$pick_up = STInput::request('pick-up');
$drop_off = STInput::request('drop-off');
$start = $pick_up_date . ' ' . $pick_up_time;
$start = strtotime($start);
$end = $drop_off_date . ' ' . $drop_off_time;
$end = strtotime($end);
$time = STCars::get_date_diff($start, $end);
$data_price_tmp = $cars_price * $time;
$data = array('price_cars' => $cars_price, "pick_up" => $pick_up, "drop_off" => $drop_off, 'date_time' => array("pick_up_date" => $pick_up_date, "pick_up_time" => $pick_up_time, "drop_off_date" => $drop_off_date, "drop_off_time" => $drop_off_time, "total_time" => $time));
?>
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:31,代码来源:modal_booking.php


示例13: add_col_content

 function add_col_content($column_name, $post_ID)
 {
     if ($column_name == 'activity_date') {
         $check_in = get_post_meta($post_ID, 'check_in', true);
         $check_out = get_post_meta($post_ID, 'check_out', true);
         $date = mysql2date('d/m/Y', $check_in) . ' <i class="fa fa-long-arrow-right"></i> ' . mysql2date('d/m/Y', $check_out);
         if (!empty($check_in) and !empty($check_out)) {
             echo balanceTags($date);
         } else {
             _e('none', ST_TEXTDOMAIN);
         }
     }
     if ($column_name == 'duration') {
         $parent = get_post_meta($post_ID, 'duration', true);
         if ($parent) {
             echo esc_html($parent);
         }
     }
     if ($column_name == 'price') {
         $price = get_post_meta($post_ID, 'price', true);
         $type_price = get_post_meta($post_ID, 'type_price', true);
         if ($type_price != 'people_price') {
             echo '<strong>' . TravelHelper::format_money($price) . '</strong>';
         } else {
             $adult_price = get_post_meta($post_ID, 'adult_price', true);
             $child_price = get_post_meta($post_ID, 'child_price', true);
             echo '<span>' . __('Adult Price', ST_TEXTDOMAIN) . ' : ' . TravelHelper::format_money($adult_price) . '</span><br>';
             echo '<span>' . __('Child Price', ST_TEXTDOMAIN) . ' : ' . TravelHelper::format_money($child_price) . '</span><br>';
         }
     }
     if ($column_name == 'activity_time') {
         $time = get_post_meta($post_ID, 'activity-time', true);
         if ($time) {
             echo esc_html($time);
         }
     }
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:37,代码来源:class.admin.activity.php


示例14: esc_html

    <label for="field-hotel-location"><?php 
    echo esc_html($title);
    ?>
</label>
    <i class="fa fa-map-marker input-icon"></i>
   <select id="field-hotel-location" name="location_id" class="form-control" <?php 
    echo esc_attr($is_required);
    ?>
>
       <option value=""><?php 
    _e('-- Select --', ST_TEXTDOMAIN);
    ?>
</option>
       <?php 
    foreach ($list_location as $key => $value) {
        $name = TravelHelper::showNameLocation($value->ID);
        $name = explode('||', $name);
        $name = $name[0];
        ?>
               <option <?php 
        selected($value->ID, $location_id);
        ?>
 value="<?php 
        echo $value->ID;
        ?>
"><?php 
        echo $name;
        ?>
</option>
           <?php 
    }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:field_list_location.php


示例15: foreach

if (!empty($get)) {
    foreach ($get as $key => $value) {
        if (is_array($value)) {
            if (!empty($value)) {
                if (!empty($value) and is_array($value)) {
                    foreach ($value as $key2 => $value2) {
                        if (!empty($value2) and is_array($value2)) {
                            foreach ($value2 as $key3 => $value3) {
                                echo "<input  type='hidden' name='{$key}[{$key2}][{$key3}]' value='{$value3}' >";
                            }
                        }
                    }
                }
            }
        } else {
            if ($key != "price_range") {
                echo "<input type='hidden' name='{$key}' value='{$value}' >";
            }
        }
    }
}
$data_min_max = TravelerObject::get_min_max_price('st_cars');
echo '<input type="text" name="price_range" value="' . STInput::get('price_range') . '" class="price-slider" data-symbol="' . TravelHelper::get_current_currency('symbol') . '" data-min="' . $data_min_max['price_min'] . '" data-max="' . $data_min_max['price_max'] . '" data-step="' . st()->get_option('search_price_range_step', 0) . '">';
?>
    <button style="margin-top: 4px;" type="submit" class="btn btn-primary"><?php 
st_the_language('car_filter');
?>
</button>
</form>

开发者ID:HatchForce,项目名称:bachtraveller,代码行数:29,代码来源:filter_price.php


示例16: get_terms

                break;
            case "taxonomy":
                $terms = get_terms($value->taxonomy);
                $key = $value->taxonomy;
                foreach ($terms as $key2 => $value2) {
                    $current = STInput::get('taxonomy');
                    if (isset($current[$key])) {
                        $current = $current[$value->taxonomy];
                    } else {
                        $current = '';
                    }
                    $checked = TravelHelper::checked_array(explode(',', $current), $value2->term_id);
                    if ($checked) {
                        $link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id, false);
                    } else {
                        $link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id);
                    }
                    ?>
                                    <div class="checkbox">
                                        <label>
                                            <input <?php 
                    if ($checked) {
                        echo "checked";
                    }
                    ?>
 value="<?php 
                    echo esc_attr($value2->term_id);
                    ?>
" name="star_rate" data-url="<?php 
                    echo esc_url($link);
                    ?>
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:filter.php


示例17: get_post_meta

                        <?php 
    }
} else {
    ?>
                        <?php 
    $check_in = get_post_meta(get_the_ID(), 'check_in', true);
    $check_out = get_post_meta(get_the_ID(), 'check_out', true);
    if (!empty($check_out) and !empty($check_out)) {
        ?>
                            <i class="fa fa-calendar"></i>
                            <span class=""><?php 
        st_the_language('holiday_date');
        ?>
 : </span>
                            <?php 
        $format = TravelHelper::getDateFormat();
        $date = date_i18n($format, strtotime($check_in)) . ' <i class="fa fa-long-arrow-right"></i> ' . date_i18n($format, strtotime($check_out));
        echo balanceTags($date);
    }
    ?>
                    <?php 
}
?>
                </small>
            </p>
            <?php 
$is_st_show_number_user_book = st()->get_option('st_show_number_user_book', 'off');
if ($is_st_show_number_user_book == 'on') {
    ?>
            <p class="mb0">
                <small>
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:loop-2.php


示例18: getRentalInfo

 static function getRentalInfo()
 {
     $rental_id = intval(STInput::request('rental_id', ''));
     $data = array('price' => '', 'extras' => 'None', 'adult_html' => '', 'child_html' => '');
     if ($rental_id <= 0 || get_post_type($rental_id) != 'st_rental') {
         echo json_encode($data);
     } else {
         $adult_number = intval(get_post_meta($rental_id, 'rental_max_adult', true));
         if ($adult_number <= 0) {
             $adult_number = 1;
         }
         $adult_html = '<select name="adult_number" class="form-control" style="width: 100px;">';
         for ($i = 1; $i <= $adult_number; $i++) {
             $adult_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $adult_html .= '</select>';
         $child_number = intval(get_post_meta($rental_id, 'rental_max_children', true));
         if ($child_number <= 0) {
             $child_number = 0;
         }
         $child_html = '<select name="child_number" class="form-control" style="width: 100px;">';
         for ($i = 0; $i <= $child_number; $i++) {
             $child_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $child_html .= '</select>';
         $html = '';
         $price = floatval(get_post_meta($rental_id, 'price', true));
         $extras = get_post_meta($rental_id, 'extra_price', true);
         if (is_array($extras) && count($extras)) {
             $html = '<table class="table">';
             foreach ($extras as $key => $val) {
                 $html .= '
             <tr>
                 <td width="80%">
                     <label for="' . $val['extra_name'] . '" class="ml20">' . $val['title'] . ' (' . TravelHelper::format_money($val['extra_price']) . ')' . '</label>
                     <input type="hidden" name="extra_price[price][' . $val['extra_name'] . ']" value="' . $val['extra_price'] . '">
                     <input type="hidden" name="extra_price[title][' . $val['extra_name'] . ']" value="' . $val['title'] . '">
                 </td>
                 <td width="20%">
                     <select style="width: 100px" class="form-control" name="extra_price[value][' . $val['extra_name'] . ']" id="">';
                 $max_item = intval($val['extra_max_number']);
                 if ($max_item <= 0) {
                     $max_item = 1;
                 }
                 for ($i = 0; $i <= $max_item; $i++) {
                     $html .= '<option value="' . $i . '">' . $i . '</option>';
                 }
                 $html .= '
                     </select>
                 </td>
             </tr>';
             }
             $html .= '</table>';
         }
         $data['price'] = TravelHelper::format_money_from_db($price, false);
         $data['extras'] = $html;
         $data['adult_html'] = $adult_html;
         $data['child_html'] = $child_html;
         echo json_encode($data);
     }
     die;
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:62,代码来源:class.admin.rental.php


示例19: __

         }
         echo __("Duration", ST_TEXTDOMAIN) . ": " . $duration;
     }
     ?>
                         </td>
                         <td class="post-title page-title column-title">
                            <?php 
     $price = get_post_meta($post_id, 'total_price', true);
     $currency = get_post_meta($post_id, 'currency', true);
     $rate = floatval(get_post_meta($post_id, 'currency_rate', true));
     echo TravelHelper::format_money_from_db($price, $currency, $rate);
     ?>
                         </td>
                         <td class="post-title page-title column-title">
                             <?php 
     echo date(TravelHelper::getDateFormat(), strtotime($value->post_date));
     ?>
                         </td>
                         <td class="post-title page-title column-title">
                             <?php 
     echo get_post_meta($order_id, 'status', true);
     ?>
                         </td>
                         <td class="post-title page-title column-title">
                             <?php 
     echo STPaymentGateways::get_gatewayname(get_post_meta($order_id, 'payment_method', true));
     ?>
                         </td>
                     </tr>
                 <?php 
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:booking_index.php


示例20: st_the_language

                        <?php 
        echo '<span class="onsale">' . $price_old . '</span> <i class="fa fa-arrow-right "></i>';
        ?>
                        <?php 
    }
    ?>
                        <strong><?php 
    echo TravelHelper::format_money($price_car);
    ?>
</strong>
                        <small>/<?php 
    echo STCars::get_price_unit();
    ?>
</small>
                    </p>
                </li>
                <li>
                    <p class="booking-item-payment-price-title"><?php 
    st_the_language('car_total');
    ?>
 </p>
                    <p class="booking-item-payment-price-amount"><?php 
    echo TravelHelper::format_money($item['data']['price_total']);
    ?>
                    </p>
                </li>
            </ul>
        </li>
    </ul>
<?php 
}
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:31,代码来源:cart_item_html.php



注:本文中的TravelHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Tree类代码示例发布时间:2022-05-23
下一篇:
PHP Translator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap