| 1 | <?php |
|---|
| 2 | // check condition for calender view |
|---|
| 3 | if ( isset($atts['form_style']) ) { |
|---|
| 4 | switch ( $atts['form_style'] ) { |
|---|
| 5 | case "1": |
|---|
| 6 | $view = "yes"; |
|---|
| 7 | break; |
|---|
| 8 | case "2": |
|---|
| 9 | $view = "no"; |
|---|
| 10 | |
|---|
| 11 | break; |
|---|
| 12 | default: |
|---|
| 13 | $view = "yes"; |
|---|
| 14 | break; |
|---|
| 15 | } |
|---|
| 16 | } |
|---|
| 17 | $multi_schedule = !empty($settings['reser_multi_schedule']) ? $settings['reser_multi_schedule'] : "off"; |
|---|
| 18 | $multi_sch_class = $multi_schedule == "on" ? "wpc-multi-reservation-msg" : ""; |
|---|
| 19 | |
|---|
| 20 | ?> |
|---|
| 21 | |
|---|
| 22 | <div class='wpc-reservation-form <?php echo esc_attr($cancellation_option) ?>' data-reservation_status='<?php echo json_encode( $booking_status ) ?>'> |
|---|
| 23 | <div class='late_booking' data-late_booking="<?php echo esc_html($late_one.$late_two.$late_three.$late_four.$late_five);?>"></div> |
|---|
| 24 | <div class='wpc_cancell_log_message'></div> |
|---|
| 25 | <div class='wpc_error_message' data-time_compare="<?php echo esc_html__('Booking end time must be after start time','wpcafe')?>"></div> |
|---|
| 26 | <div class='wpc_success_message <?php echo esc_attr($multi_sch_class)?>' data-start="<?php echo esc_html__("Start time","wpcafe");?>" data-end="<?php echo esc_html__("End time","wpcafe");?>" data-schedule="<?php echo esc_html__("Schedule","wpcafe");?>" data-late_booking = "<?php echo ( $wpc_late_bookings !=="" ) |
|---|
| 27 | ? sprintf( esc_html__("You can book up until %s minutes before closing time","wpcafe") , esc_html( $wpc_late_bookings ) ) : "" ?>"></div> |
|---|
| 28 | <div class='wpc_calender_view' data-view="<?php echo esc_html($view);?>"></div> |
|---|
| 29 | <div class='date_missing' data-date_missing="<?php echo esc_html__("Please select a date first","wpcafe");?>"></div> |
|---|
| 30 | <div class="form_style" data-form_style="free-<?php echo esc_attr( $style )?>" data-form_type="free"></div> |
|---|
| 31 | <div class='wpc_reservation_form_two' style='display:none;'> |
|---|
| 32 | <div class='wpc_reservation_form_two'> |
|---|
| 33 | <form method='post' class=' wpc_reservation_table'> |
|---|
| 34 | <div class='wpc-reservation-form'> |
|---|
| 35 | <div class='wpc-row'> |
|---|
| 36 | <?php if ($view === "yes") { ?> |
|---|
| 37 | <div class='wpc-col-lg-6 wpc_bg_image' style="background-image: url(<?php echo esc_url($wpc_image_url) ?>);"></div> |
|---|
| 38 | <?php } ?> |
|---|
| 39 | <div class='<?php echo esc_attr($column_lg); ?>'> |
|---|
| 40 | <div class='wpc_reservation_form wpc_reservation_user_info'> |
|---|
| 41 | <!-- Reservation booking detials --> |
|---|
| 42 | <?php |
|---|
| 43 | if ( file_exists( \Wpcafe::plugin_dir() . "core/shortcodes/views/reservation/reservation-detials.php" ) ) { |
|---|
| 44 | include_once \Wpcafe::plugin_dir() . "core/shortcodes/views/reservation/reservation-detials.php"; |
|---|
| 45 | } |
|---|
| 46 | ?> |
|---|
| 47 | <button class='confirm_booking_btn wpc-btn' data-id='reservation_form_second_step'><?php echo esc_html( $booking_button_text ); ?></button> |
|---|
| 48 | <button class='edit_booking_btn wpc-btn' data-id='edit_booking_btn'><?php echo esc_html__('Edit Booking', 'wpcafe'); ?></button> |
|---|
| 49 | <button class="wpc-another-reservation-free action-button wpc-btn" name="another_reservation_free"><i class="dashicons dashicons-image-rotate"></i><?php echo esc_html__('Book Again', 'wpcafe'); ?></button> |
|---|
| 50 | </div> |
|---|
| 51 | </div> |
|---|
| 52 | </div> |
|---|
| 53 | </div> |
|---|
| 54 | </form> |
|---|
| 55 | </div> |
|---|
| 56 | </div> |
|---|
| 57 | |
|---|
| 58 | <form method='post' class='wpc_reservation_table'> |
|---|
| 59 | <input type='hidden' name='wpc_action' value='wpc_reservation' /> |
|---|
| 60 | <div class='wpc_reservation_form_one'> |
|---|
| 61 | <div class="wpc-row"> |
|---|
| 62 | <?php if ("yes" === $view ) { ?> |
|---|
| 63 | <div class='wpc-col-lg-6 wpc-align-self-center'> |
|---|
| 64 | <div class='wpc-reservation-field date wpc-reservation-calender-field'> |
|---|
| 65 | <h3 class="wpc-choose-date"><?php echo esc_html__('Choose a Date', 'wpcafe'); ?></h3> |
|---|
| 66 | <input type='text' name='wpc_booking_date' class='wpc-form-control' id='wpc_booking_date' value='' required aria-required='true' /> |
|---|
| 67 | </div> |
|---|
| 68 | </div> |
|---|
| 69 | <?php } ?> |
|---|
| 70 | <div class='<?php echo esc_attr($column_lg); ?>'> |
|---|
| 71 | <div class="wpc_reservation_form"> |
|---|
| 72 | <?php |
|---|
| 73 | if ( isset($show_branches) && "yes" == $show_branches ) { |
|---|
| 74 | ?> |
|---|
| 75 | <div class="wpc-row"> |
|---|
| 76 | <div class="wpc-col-lg-12 wpc-align-self-center"> |
|---|
| 77 | <div class='wpc-reservation-field branch'> |
|---|
| 78 | <label for='wpc-branch'><?php echo esc_html__('Which branch of our restaurant', 'wpcafe'); echo ( $require_branch == "required" ) ? "<small class='wpc_required'>*</small>" : "" ?></label> |
|---|
| 79 | <select name='wpc_branch' id='wpc-branch' class='wpc-form-control' <?php echo esc_attr($require_branch == "required" ? "required" : ""); ?>> |
|---|
| 80 | <?php foreach( $wpc_location_arr as $key=>$branch ) {?> |
|---|
| 81 | <option value="<?php echo esc_attr( $key ); ?>" <?php echo count($wpc_location_arr) <= 2? "selected='selected'" : "" ?> ><?php echo esc_html( $branch ); ?></option> |
|---|
| 82 | <?php } ?> |
|---|
| 83 | </select> |
|---|
| 84 | </div> |
|---|
| 85 | </div> |
|---|
| 86 | </div> |
|---|
| 87 | <?php } ?> |
|---|
| 88 | <div class="wpc-row"> |
|---|
| 89 | <div class='wpc-col-md-6'> |
|---|
| 90 | <div class='wpc-reservation-field name'> |
|---|
| 91 | <label for='wpc-name'><?php echo esc_html__('Your Name', 'wpcafe'); ?><small class='wpc_required'>*</small></label> |
|---|
| 92 | <input type='text' name='wpc_name' placeholder='<?php echo esc_html__('Name here', 'wpcafe'); ?>' id='wpc-name' class='wpc-form-control' value='' required aria-required='true'> |
|---|
| 93 | <div class="wpc-name wpc_danger_text"></div> |
|---|
| 94 | </div> |
|---|
| 95 | </div> |
|---|
| 96 | <div class='wpc-col-md-6'> |
|---|
| 97 | <div class='wpc-reservation-field email'> |
|---|
| 98 | <label for='wpc-email'><?php echo esc_html__('Your Email', 'wpcafe'); ?><small class='wpc_required'>*</small></label> |
|---|
| 99 | <input type='email' name='wpc_email' placeholder='<?php echo esc_html__('Email here', 'wpcafe'); ?>' class='wpc-form-control' id='wpc-email' value='' required aria-required='true'> |
|---|
| 100 | <div class="wpc-email wpc_danger_text"></div> |
|---|
| 101 | </div> |
|---|
| 102 | </div> |
|---|
| 103 | </div> |
|---|
| 104 | <div class='wpc-row'> |
|---|
| 105 | <div class='<?php echo esc_attr($column_md) ?>'> |
|---|
| 106 | <div class='wpc-reservation-field phone'> |
|---|
| 107 | <label for='wpc-phone'><?php echo esc_html__('How can we contact you?', 'wpcafe'); |
|---|
| 108 | echo ( isset($phone_required) && $phone_required == "required" ) ? "<small class='wpc_required'>*</small>" : "" ?> |
|---|
| 109 | </label> |
|---|
| 110 | <input type='tel' placeholder='<?php echo esc_html__('Phone Number here', 'wpcafe'); ?>' <?php echo ( isset($phone_required) && $phone_required == "required" ) ? esc_attr("required") : ""; ?> name='wpc_phone' class='wpc-form-control' id='wpc-phone' value=''> |
|---|
| 111 | <div class="wpc-phone wpc_danger_text"></div> |
|---|
| 112 | </div> |
|---|
| 113 | </div> |
|---|
| 114 | <?php if ($view === "no") { ?> |
|---|
| 115 | <div class='wpc-col-lg-6'> |
|---|
| 116 | <div class='wpc-reservation-field'> |
|---|
| 117 | <label for='wpc_booking_date'><?php echo esc_html__('Date', 'wpcafe'); ?><small class='wpc_required'>*</small></label> |
|---|
| 118 | <input type='text' placeholder='<?php echo esc_html__('Booking date here', 'wpcafe'); ?>' name='wpc_booking_date' class='wpc-form-control' id='wpc_booking_date' value='' required aria-required='true' /> |
|---|
| 119 | </div> |
|---|
| 120 | </div> |
|---|
| 121 | <?php } ?> |
|---|
| 122 | </div> |
|---|
| 123 | <div class='wpc-row'> |
|---|
| 124 | <div class='<?php echo esc_attr( $from_to_column ); ?>'> |
|---|
| 125 | <?php if( $show_form_field == 'on'): ?> |
|---|
| 126 | <div class='wpc-reservation-field time'> |
|---|
| 127 | <label for='wpc_from_time'><?php echo esc_html( $from_field_label); ?> |
|---|
| 128 | <?php if ( $required_from_field == 'on') : ?> |
|---|
| 129 | <small class='wpc_required'>*</small> |
|---|
| 130 | <?php endif; ?> |
|---|
| 131 | </label> |
|---|
| 132 | <input type='text' name='wpc_from_time' placeholder='<?php echo esc_html__('Start time here', 'wpcafe'); ?>' class='wpc-form-control' id='wpc_from_time' value='' <?php echo ( $required_from_field == 'on' ) ? 'required aria-required="true"' : '' ?> > |
|---|
| 133 | <span class="dashicons dashicons-clock"></span> |
|---|
| 134 | |
|---|
| 135 | </div> |
|---|
| 136 | <?php endif;?> |
|---|
| 137 | </div> |
|---|
| 138 | <div class='<?php echo esc_attr( $from_to_column ); ?>'> |
|---|
| 139 | <?php if( $show_to_field == 'on' ): ?> |
|---|
| 140 | <div class='wpc-reservation-field time'> |
|---|
| 141 | <label for='wpc_to_time'><?php echo esc_html( $to_field_label); ?> |
|---|
| 142 | <?php if ( $required_to_field == 'on') : ?> |
|---|
| 143 | <small class='wpc_required'>*</small> |
|---|
| 144 | <?php endif; ?> |
|---|
| 145 | </label> |
|---|
| 146 | <input type='text' name='wpc_to_time' placeholder='<?php echo esc_html__('End time here', 'wpcafe'); ?>' class='wpc-form-control' id='wpc_to_time' value='' <?php echo ( $required_to_field == 'on' ) ? 'required aria-required="true"' : '' ?> > |
|---|
| 147 | <span class="dashicons dashicons-clock"></span> |
|---|
| 148 | </div> |
|---|
| 149 | <?php endif;?> |
|---|
| 150 | </div> |
|---|
| 151 | </div> |
|---|
| 152 | <?php |
|---|
| 153 | $gest_limit = WpCafe\Utils\Wpc_Utilities::get_seat_count_limit(); |
|---|
| 154 | ?> |
|---|
| 155 | <div class='wpc-select party wpc-reservation-field'> |
|---|
| 156 | <label for='wpc-party'><?php echo esc_html__('Total Guests ', 'wpcafe'); ?><small class='wpc_required'>*</small></label> |
|---|
| 157 | <select name='wpc_guest_count' id='wpc-party' class='wpc-form-control' required aria-required='true'> |
|---|
| 158 | <option value=""><?php echo esc_html__("Select number of guests","wpcafe")?></option> |
|---|
| 159 | <?php foreach ($gest_limit as $i) { |
|---|
| 160 | $selected = ($wpc_default_gest_no == $i) ? "selected" : ""; ?> |
|---|
| 161 | <option value='<?php echo esc_attr( $i ); ?>' <?php echo esc_attr( $selected ); ?>><?php echo esc_html( $i ); ?></option> |
|---|
| 162 | <?php } ?> |
|---|
| 163 | </select> |
|---|
| 164 | </div> |
|---|
| 165 | |
|---|
| 166 | <div class='wpc-reservation-fieldarea message wpc-reservation-field'> |
|---|
| 167 | <label for='wpc-message'><?php echo esc_html__('Additional Information', 'wpcafe'); ?></label> |
|---|
| 168 | <textarea name='wpc_message' placeholder='<?php echo esc_html__('Enter Your Message here', 'wpcafe'); ?>' id='wpc-message' class='wpc-form-control'></textarea> |
|---|
| 169 | </div> |
|---|
| 170 | <?php if(class_exists('Wpcafe_Pro')): ?> |
|---|
| 171 | <div class='wpc-reservation-field wpc-webhook'> |
|---|
| 172 | <input type='hidden' placeholder='<?php echo esc_html__('Webhook Url', 'wpcafe'); ?>' name='wpc_webhook' class='wpc-form-control wpc_webhook' id='wpc-webhook' value='<?php echo esc_html($fluent_crm_webhook); ?>'> |
|---|
| 173 | </div> |
|---|
| 174 | <?php endif; ?> |
|---|
| 175 | <?php |
|---|
| 176 | // render extra field |
|---|
| 177 | do_action('reservation_extra_fields_markup'); |
|---|
| 178 | ?> |
|---|
| 179 | |
|---|
| 180 | <input type='hidden' value='reservation_form_first_step' class='reservation_form_first_step' /> |
|---|
| 181 | <button type='submit' class='reservation_form_submit wpc-btn'><?php echo esc_html( $first_booking_button ); ?></button> |
|---|
| 182 | <span id='wpc_cancel_request'><?php echo esc_html($cancel_button_text); ?></span> |
|---|
| 183 | </div> |
|---|
| 184 | </div> |
|---|
| 185 | </div> |
|---|
| 186 | </div> |
|---|
| 187 | </form> |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | </div> |
|---|
| 191 | |
|---|