function bizz_bookings_metaboxes($meta_boxes) { global $post, $booking_settings; $prefix = 'bizzthemes_'; $opt_s = $booking_settings->get_settings(); // cars $car_args = array('post_type' => 'bizz_cars', 'numberposts' => -1); $car_posts = get_posts($car_args); $car_options = array(); $car_options[0] = array('name' => __('-- Select --', 'bizzthemes'), 'value' => ''); if ($car_posts) { foreach ($car_posts as $car_post) { $car_options[] = array('name' => $car_post->post_title, 'value' => $car_post->ID); } } // count for ($i = 1; $i <= 20; $i++) { $car_count[] = array('name' => $i, 'value' => $i); } // locations $location_posts = get_posts(array('post_type' => 'bizz_locations', 'numberposts' => -1)); $location_options = array(); $location_options[0] = array('name' => __('-- Select --', 'bizzthemes'), 'value' => ''); foreach ($location_posts as $location_post) { $location_options[] = array('name' => $location_post->post_title, 'value' => $location_post->ID); } // months $months = array(); $months[0] = array('name' => __('-- Select --', 'bizzthemes'), 'value' => ''); for ($i = 1; $i <= 12; $i++) { $months[] = array('name' => date("F", mktime(0, 0, 0, $i, 10)), 'value' => $i); } // years $years = array(); $current_year = date("Y"); $start_year = $current_year - 5; $final_year = $start_year + 16; $years[0] = array('name' => __('-- Select --', 'bizzthemes'), 'value' => ''); for ($i = $start_year; $i <= $final_year; $i++) { $years[] = array('name' => $i, 'value' => $i); } $meta_boxes[] = array('id' => 'bizzthemes_bookings_status', 'title' => __('Booking Status', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Status', 'bizzthemes'), 'desc' => __('Updating booking status will automatically send email notification to the customer.', 'bizzthemes'), 'id' => $prefix . 'bookings_status', 'type' => 'select', 'options' => array(array('name' => __('Pending', 'bizzthemes'), 'value' => 'pending'), array('name' => __('Approved', 'bizzthemes'), 'value' => 'approved'), array('name' => __('Cancelled', 'bizzthemes'), 'value' => 'cancelled'), array('name' => __('Refunded', 'bizzthemes'), 'value' => 'refunded'))), array('name' => __('Tracking ID', 'bizzthemes'), 'desc' => __('Tracking number for this booking. Same as post ID.', 'bizzthemes'), 'id' => $prefix . 'bookings_track', 'type' => 'text_small'))); $meta_boxes[] = array('id' => 'bizzthemes_bookings_car', 'title' => __('Vehicle and Extras', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Vehicle', 'bizzthemes'), 'id' => $prefix . 'bookings_car', 'type' => 'select', 'options' => $car_options), array('name' => __('Quantity', 'bizzthemes'), 'id' => $prefix . 'bookings_car_count', 'type' => 'select', 'options' => $car_count), array('name' => '<a href="edit-tags.php?taxonomy=bizz_cars_extra&post_type=bizz_bookings">' . __('Vehicle Extras', 'bizzthemes') . '</a>', 'desc' => '<a href="edit-tags.php?taxonomy=bizz_cars_extra&post_type=bizz_bookings">' . __('Add more', 'bizzthemes') . '</a>', 'id' => $prefix . 'bookings_extras', 'multiple' => true, 'std' => '1', 'type' => 'extras'), array('name' => __('Coupon Code', 'bizzthemes'), 'desc' => __('Coupon code, used with this purchase.', 'bizzthemes'), 'id' => $prefix . 'bookings_coupon', 'type' => 'text_small'))); $meta_boxes[] = array('id' => 'bizzthemes_bookings_date', 'title' => __('Date and Location', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Pickup Location', 'bizzthemes'), 'id' => $prefix . 'bookings_pickup', 'type' => 'location_select', 'options' => $location_options), array('name' => __('Return Location', 'bizzthemes'), 'id' => $prefix . 'bookings_return', 'type' => 'location_select', 'options' => $location_options), array('name' => __('Start Date', 'bizzthemes'), 'id' => $prefix . 'bookings_date1', 'type' => 'date_time'), array('name' => __('Return Date', 'bizzthemes'), 'id' => $prefix . 'bookings_date2', 'type' => 'date_time'), array('name' => __('Flight Number', 'bizzthemes'), 'desc' => __('If available, include both the carrier code and the flight number, like BA2244. This is vital to ensure your vehicle is available if your flight is delayed.', 'bizzthemes'), 'id' => $prefix . 'bookings_flight', 'type' => 'text_small'))); $meta_boxes[] = array('id' => 'bizzthemes_bookings_customer', 'title' => __('Customer Details', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Customer Title', 'bizzthemes'), 'id' => $prefix . 'bookings_ctitle', 'type' => 'select', 'options' => array(array('name' => __('Mr', 'bizzthemes'), 'value' => 'mr'), array('name' => __('Mrs', 'bizzthemes'), 'value' => 'mrs'), array('name' => __('Miss', 'bizzthemes'), 'value' => 'miss'), array('name' => __('Dr', 'bizzthemes'), 'value' => 'dr'), array('name' => __('Prof', 'bizzthemes'), 'value' => 'prof'), array('name' => __('Rev', 'bizzthemes'), 'value' => 'rev'))), array('name' => __('First Name', 'bizzthemes'), 'id' => $prefix . 'bookings_fname', 'type' => 'text_medium'), array('name' => __('Last Name', 'bizzthemes'), 'id' => $prefix . 'bookings_lname', 'type' => 'text_medium'), array('name' => __('Email', 'bizzthemes'), 'id' => $prefix . 'bookings_email', 'type' => 'text_medium'), array('name' => __('Phone', 'bizzthemes'), 'id' => $prefix . 'bookings_phone', 'type' => 'text_medium'), array('name' => __('Contact Option', 'bizzthemes'), 'id' => $prefix . 'bookings_scontact', 'type' => 'select', 'options' => array(array('name' => __('Email', 'bizzthemes'), 'value' => 'email'), array('name' => __('Phone (SMS)', 'bizzthemes'), 'value' => 'sms'), array('name' => __('Phone (Call)', 'bizzthemes'), 'value' => 'call'))), array('name' => __('Address', 'bizzthemes'), 'id' => $prefix . 'bookings_address', 'type' => 'text_medium'), array('name' => __('Postcode/ZIP', 'bizzthemes'), 'id' => $prefix . 'bookings_zip', 'type' => 'text_medium'), array('name' => __('City', 'bizzthemes'), 'id' => $prefix . 'bookings_city', 'type' => 'text_medium'), array('name' => __('State/Province', 'bizzthemes'), 'id' => $prefix . 'bookings_state', 'type' => 'text_medium'), array('name' => __('Country', 'bizzthemes'), 'id' => $prefix . 'bookings_country', 'type' => 'select', 'options' => bizz_country_list()), array('name' => __('Age of Driver', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_age', 'type' => 'text_medium'), array('name' => __('Date of Birth', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_birth', 'type' => 'text_medium'), array('name' => __('Driving Licence Number', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_license', 'type' => 'text_medium'), array('name' => __('Country / State of issue', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_country', 'type' => 'text_medium'), array('name' => __('Issue Date', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_issue', 'type' => 'text_medium'), array('name' => __('Expiry Date', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_expiry', 'type' => 'text_medium'), array('name' => __('Accidents, claims or motoring convictions over the past 3 years?', 'bizzthemes'), 'id' => $prefix . 'bookings_driver_accidents', 'type' => 'select', 'options' => array(array('name' => __('No', 'bizzthemes'), 'value' => 'noe'), array('name' => __('Yes (please provide details in Comments box below)', 'bizzthemes'), 'value' => 'yes'))), array('name' => __('Number of Passengers', 'bizzthemes'), 'id' => $prefix . 'bookings_number_passengers', 'type' => 'text_medium'), array('name' => __('Comments/Questions', 'bizzthemes'), 'id' => $prefix . 'bookings_comm_que', 'type' => 'textarea', 'options' => array('textarea_rows' => 5)))); $meta_boxes[] = array('id' => 'bizzthemes_bookings_invoice', 'title' => __('Invoice', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'side', 'priority' => 'low', 'show_names' => true, 'fields' => array(array('name' => __('Vehicle', 'bizzthemes'), 'desc' => __('enter the car amount', 'bizzthemes'), 'id' => $prefix . 'car_pay_car', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'), array('name' => __('Extras', 'bizzthemes'), 'desc' => __('enter the extras amount', 'bizzthemes'), 'id' => $prefix . 'car_pay_extras', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'), array('name' => __('Tax', 'bizzthemes'), 'desc' => __('enter the tax amount', 'bizzthemes'), 'id' => $prefix . 'car_pay_tax', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'), array('name' => __('Total', 'bizzthemes'), 'desc' => __('enter the total amount', 'bizzthemes'), 'id' => $prefix . 'car_pay_total', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'), array('name' => __('Deposit', 'bizzthemes'), 'desc' => __('Amount paid before rental', 'bizzthemes'), 'id' => $prefix . 'car_pay_deposit', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'))); $meta_boxes[] = array('id' => 'bizzthemes_bookings_payment', 'title' => __('Payment', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'side', 'priority' => 'low', 'show_names' => true, 'fields' => array(array('name' => __('Paid', 'bizzthemes'), 'id' => $prefix . 'car_pay_paid', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'text_money'), array('name' => __('Remaining', 'bizzthemes'), 'id' => $prefix . 'car_pay_remaining', 'currency' => get_bizz_currency($opt_s['pay_currency']), 'type' => 'remaining'), array('name' => __('Payment method', 'bizzthemes'), 'id' => $prefix . 'car_pay_method', 'type' => 'select', 'options' => array(array('name' => __('-- Select --', 'bizzthemes'), 'value' => '0'), array('name' => __('PayPal', 'bizzthemes'), 'value' => 'paypal'), array('name' => __('Credit Card', 'bizzthemes'), 'value' => 'creditcard'), array('name' => __('Cash on Delivery', 'bizzthemes'), 'value' => 'cod'), array('name' => __('Bank Transfer', 'bizzthemes'), 'value' => 'banktransfer'), array('name' => __('Mollie Payment', 'bizzthemes'), 'value' => 'mollie'))), array('id' => $prefix . 'booking_paypal_details', 'type' => 'hidden', 'desc' => ''))); if (isset($opt_s['pay_credit']) && $opt_s['pay_credit']) { $meta_boxes[] = array('id' => 'bizzthemes_bookings_cc', 'title' => __('Credit Card', 'bizzthemes'), 'pages' => array('bizz_bookings'), 'context' => 'side', 'priority' => 'low', 'show_names' => true, 'fields' => array(array('name' => __('Type', 'bizzthemes'), 'id' => $prefix . 'bookings_cc_type', 'type' => 'select', 'options' => array(array('name' => __('-- Select --', 'bizzthemes'), 'value' => '0'), array('name' => __('Visa', 'bizzthemes'), 'value' => 'visa'), array('name' => __('MasterCard', 'bizzthemes'), 'value' => 'mastercard'), array('name' => __('Maestro', 'bizzthemes'), 'value' => 'maestro'), array('name' => __('AmericanExpress', 'bizzthemes'), 'value' => 'amex'))), array('name' => __('Number', 'bizzthemes'), 'id' => $prefix . 'bookings_cc_number', 'type' => 'text_small'), array('name' => __('Expiration Month', 'bizzthemes'), 'id' => $prefix . 'bookings_cc_expiration_m', 'type' => 'select', 'options' => $months), array('name' => __('Expiration Year', 'bizzthemes'), 'id' => $prefix . 'bookings_cc_expiration_y', 'type' => 'select', 'options' => $years), array('name' => __('Security Code', 'bizzthemes'), 'id' => $prefix . 'bookings_cc_security', 'type' => 'text_small'))); } return $meta_boxes; }
?> <span class="req">*</span><?php } ?> </label> <div class="col-sm-7"> <select id="countries" name="countries" class="form-control col-md-12<?php echo $book_opts['f_country'] == 'yes-req' ? ' validate' : ''; ?> "> <option value=""><?php _e('-- Select --', 'bizzthemes'); ?> </option> <?php $countries = bizz_country_list(); foreach ($countries as $country) { echo '<option Selected value="DK">Denmark</option>'; echo '<option value="' . $country['value'] . '">' . $country['name'] . '</option>'; } ?> </select> </div> </div> <?php } ?> <?php if ($book_opts['f_flight_number'] != 'no') {
function bizz_locations_metaboxes($meta_boxes) { $prefix = 'bizzthemes_'; $meta_boxes[] = array('id' => 'bizzthemes_locations_meta', 'title' => __('Location Details', 'bizzthemes'), 'pages' => array('bizz_locations'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array(array('name' => __('Country', 'bizzthemes'), 'id' => $prefix . 'location_country', 'type' => 'select', 'options' => bizz_country_list()), array('name' => __('State/Province/Region', 'bizzthemes'), 'id' => $prefix . 'location_state', 'type' => 'text_medium'), array('name' => __('City', 'bizzthemes'), 'id' => $prefix . 'location_city', 'type' => 'text_medium'), array('name' => __('Postcode/ZIP', 'bizzthemes'), 'id' => $prefix . 'location_zip', 'type' => 'text_medium'), array('name' => __('Address', 'bizzthemes'), 'id' => $prefix . 'location_address', 'type' => 'text_medium'), array('name' => __('Email', 'bizzthemes'), 'id' => $prefix . 'location_email', 'type' => 'text_medium'), array('name' => __('Phone', 'bizzthemes'), 'id' => $prefix . 'location_phone', 'type' => 'text_medium'), array('name' => __('Car dealer', 'bizzthemes'), 'id' => $prefix . 'location_dealer', 'type' => 'text_small', 'std' => get_current_user_id()))); $meta_boxes[] = array('id' => 'bizzthemes_hours_meta', 'title' => __('Business Hours', 'bizzthemes'), 'pages' => array('bizz_locations'), 'context' => 'normal', 'priority' => 'default', 'show_names' => true, 'fields' => array(array('name' => __('Monday', 'bizzthemes'), 'id' => $prefix . 'hours_monday', 'open_default' => '09:00', 'close_default' => '22:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Tuesday', 'bizzthemes'), 'id' => $prefix . 'hours_tuesday', 'open_default' => '09:00', 'close_default' => '22:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Wednesday', 'bizzthemes'), 'id' => $prefix . 'hours_wednesday', 'open_default' => '09:00', 'close_default' => '22:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Thursday', 'bizzthemes'), 'id' => $prefix . 'hours_thursday', 'open_default' => '09:00', 'close_default' => '22:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Friday', 'bizzthemes'), 'id' => $prefix . 'hours_friday', 'open_default' => '09:00', 'close_default' => '22:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Saturday', 'bizzthemes'), 'id' => $prefix . 'hours_saturday', 'open_default' => '09:00', 'close_default' => '17:00', 'closed_default' => false, 'type' => 'hours'), array('name' => __('Sunday', 'bizzthemes'), 'id' => $prefix . 'hours_sunday', 'open_default' => '09:00', 'close_default' => '13:00', 'closed_default' => true, 'type' => 'hours'))); $meta_boxes[] = array('id' => 'bizzthemes_offdates_meta', 'title' => __('Business Closed Dates', 'bizzthemes'), 'pages' => array('bizz_locations'), 'context' => 'normal', 'priority' => 'default', 'show_names' => true, 'fields' => array(array('name' => __('Closed Dates', 'bizzthemes'), 'id' => $prefix . 'offdates', 'type' => 'offdates'))); return $meta_boxes; }