{"id":17,"date":"2018-02-12T19:57:51","date_gmt":"2018-02-12T19:57:51","guid":{"rendered":"http:\/\/bossakov.eu\/wpdemo\/?page_id=17"},"modified":"2023-03-30T09:04:44","modified_gmt":"2023-03-30T09:04:44","slug":"hotel-booking-calculator","status":"publish","type":"page","link":"https:\/\/bossakov.eu\/wpdemo\/pvb-cf7-calculator-pro\/hotel-booking-calculator\/","title":{"rendered":"Hotel booking calculator"},"content":{"rendered":"<p>This is an example of a calculator that demonstrates the date-related functions of the plugin, along with hidden intermediate calculation steps.<\/p>\n<h2>Price list<\/h2>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<th>Weekdays<\/th>\n<th>Weekends<\/th>\n<\/tr>\n<tr>\n<th>Regular room<\/th>\n<td>$20 per night<\/td>\n<td>$25 per night<\/td>\n<\/tr>\n<tr>\n<th>Deluxe room<\/th>\n<td>$30 per night<\/td>\n<td>$40 per night<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n<div class=\"wpcf7 no-js\" id=\"wpcf7-f46-o1\" lang=\"en-US\" dir=\"ltr\" data-wpcf7-id=\"46\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/wpdemo\/wp-json\/wp\/v2\/pages\/17#wpcf7-f46-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<fieldset class=\"hidden-fields-container\"><input type=\"hidden\" name=\"_wpcf7\" value=\"46\" \/><input type=\"hidden\" name=\"_wpcf7_version\" value=\"6.1.7\" \/><input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/><input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f46-o1\" \/><input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/><input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_group_fields\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_visible_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_repeaters\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_steps\" value=\"{}\" \/><input type=\"hidden\" name=\"_wpcf7cf_options\" value=\"{&quot;form_id&quot;:46,&quot;conditions&quot;:[],&quot;settings&quot;:{&quot;animation&quot;:&quot;yes&quot;,&quot;animation_intime&quot;:200,&quot;animation_outtime&quot;:200,&quot;conditions_ui&quot;:&quot;normal&quot;,&quot;notice_dismissed&quot;:true,&quot;repeater_remove_button&quot;:&quot;bottom&quot;,&quot;wpcf7cf_settings_saved&quot;:1}}\" \/>\n<\/fieldset>\n<p><label>Room type<br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"deluxe\"><span class=\"wpcf7-form-control wpcf7-radio\"><span class=\"wpcf7-list-item first\"><input type=\"radio\" name=\"deluxe\" value=\"Regular\" \/><span class=\"wpcf7-list-item-label\">Regular<\/span><\/span><span class=\"wpcf7-list-item last\"><input type=\"radio\" name=\"deluxe\" value=\"Deluxe\" \/><span class=\"wpcf7-list-item-label\">Deluxe<\/span><\/span><\/span><\/span> [variable deluxe_flag cf7-hide \"deluxe:\" \"Regular 0\" \"Deluxe 1\" \"default 0\"]<\/label><br \/>\n<label>Check in<br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"checkin\"><input class=\"wpcf7-form-control wpcf7-date wpcf7-validates-as-date\" aria-invalid=\"false\" value=\"\" type=\"date\" name=\"checkin\" \/><\/span><br \/>\n<\/label><br \/>\n<label>Check out<br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"checkout\"><input class=\"wpcf7-form-control wpcf7-date wpcf7-validates-as-date\" aria-invalid=\"false\" value=\"\" type=\"date\" name=\"checkout\" \/><\/span><br \/>\n<\/label>\n<\/p>\n<p><input class=\"wpcf7-form-control wpcf7-calculate_button cf7-calculate_button\" type=\"button\" value=\"Calculate\" \/><span class=\"wpcf7-form-control-wrap total_nights\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-calculation pvb-display-none cf7-calculation\" readonly=\"readonly\" aria-invalid=\"false\" value=\"0\" type=\"text\" name=\"total_nights\" \/><\/span>\n<\/p>\n<p>Price estimate: <span id=\"booking_total\">$ <\/span><br \/>\n[paypal paypal-button email:test@example.com field:price currency:USD \"Hotel Booking Demo\"]\n<\/p><input type=\"hidden\" name=\"_pvb_ajax_calc_nonce\" value=\"5a80c6b9a0\"><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n\n<h2>Source code for this form:<\/h2>\n<pre>&lt;label&gt;Room type\n[radio deluxe \"Regular\" \"Deluxe\"] [variable deluxe_flag cf7-hide \"deluxe:\" \"Regular 0\" \"Deluxe 1\" \"default 0\"]&lt;\/label&gt;\n&lt;label&gt;Check in\n[date checkin]\n&lt;\/label&gt;\n&lt;label&gt;Check out\n[date checkout]\n&lt;\/label&gt;\n\n[calculate_button calculate_button-1 \"Calculate\"] [calculation total_nights min:0 cf7-hide \"checkout-checkin\"] [calculation weekday_nights min:0 cf7-hide \"fn_business_days(checkin+1, checkout)\"] [calculation weekend_nights min:0 cf7-hide \"total_nights-weekday_nights\"] [calculation weekday_subtotal min:0 cf7-hide \"weekday_nights*(20+deluxe_flag*10)\"] [calculation weekend_subtotal cf7-hide \"weekend_nights*(25+deluxe_flag*15)\"]\n\nPrice estimate: &lt;span id=\"booking_total\"&gt;$ [calculation price min:0 \"weekday_subtotal + weekend_subtotal\"]&lt;\/span&gt;\n[paypal paypal-button email:test@example.com field:price currency:USD \"Hotel Booking Demo\"]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is an example of a calculator that demonstrates the date-related functions of the plugin, along with hidden intermediate calculation steps. Price list Weekdays Weekends Regular room $20 per night $25 per night Deluxe room $30 per night $40 per night Source code for this form: &lt;label&gt;Room type [radio deluxe &#8220;Regular&#8221; &#8220;Deluxe&#8221;] [variable deluxe_flag cf7-hide [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-17","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":16,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/17\/revisions"}],"predecessor-version":[{"id":522,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/17\/revisions\/522"}],"up":[{"embeddable":true,"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/bossakov.eu\/wpdemo\/wp-json\/wp\/v2\/media?parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}