Changeset 3097265
- Timestamp:
- 06/04/2024 09:44:25 AM (20 months ago)
- Location:
- saksh-wp-hotel-booking-lite/trunk
- Files:
-
- 6 edited
-
Saksh-WP-Hotel-Booking-Lite.php (modified) (6 diffs)
-
saksh_admin/saksh_booking_report.php (modified) (1 diff)
-
saksh_custom_meta_form.php (modified) (8 diffs)
-
saksh_installation.php (modified) (2 diffs)
-
saksh_room_search_v2.php (modified) (7 diffs)
-
saksh_theme_functions.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
saksh-wp-hotel-booking-lite/trunk/Saksh-WP-Hotel-Booking-Lite.php
r3091847 r3097265 13 13 Stable tag: 2.0 14 14 Requires PHP: 5.4.0 15 License: GPLv2 or later 15 License: GPLv2 or later$cart_item 16 16 License URI: https://www.gnu.org/licenses/gpl-2.0.html 17 17 public_html/hb3/wp-content/plugins/saksh-wp-hotel-booking-lite/saksh_admin/saksh_options 18 18 */ 19 19 … … 46 46 47 47 48 include "saksh_admin/saksh_option _panel.php";48 include "saksh_admin/saksh_options/saksh_option_panel.php"; 49 49 50 50 … … 116 116 117 117 118 119 120 118 $startdate = strtotime($date_start); 121 119 $enddate = strtotime($date_end); … … 146 144 147 145 148 146 $saksh_get_taxes=saksh_get_taxes($saksh_payment_option ,$cart_item_data ); 147 148 $cart_item_data['total_taxes']= $saksh_get_taxes; 149 149 150 150 151 … … 168 169 $cart_page = wc_get_cart_url(); 169 170 170 //var_dump($cart_page);171 echo '<meta http-equiv="refresh" content="0; URL= '.esc_url($cart_page ).'" />';171 var_dump($cart_item_data); 172 //echo '<meta http-equiv="refresh" content="0; URL= '.esc_url($cart_page ).'" />'; 172 173 173 174 … … 294 295 295 296 297 298 function saksh_get_taxes($saksh_payment_option ,$cart_item_data ) 299 300 301 302 { 303 304 return 0; 305 306 // title_field_service 307 308 $saksh_get_taxes= array_sum( $saksh_payment_option['amount_3_service'] ); 309 310 311 312 313 // amount_3_service 314 // $saksh_get_taxes=0; 315 316 317 return $saksh_get_taxes; 318 319 320 } 296 321 function saksh_check_availability($query_data,$purchase_plan_id) 297 322 { -
saksh-wp-hotel-booking-lite/trunk/saksh_admin/saksh_booking_report.php
r3091863 r3097265 171 171 172 172 173 174 //saksh_hb_plugin_table_install(); 173 saksh_create_dummy_data() ; 175 174 176 175 -
saksh-wp-hotel-booking-lite/trunk/saksh_custom_meta_form.php
r3090240 r3097265 151 151 152 152 153 153 154 155 156 157 $object= array( 158 'id' => 'plan_name', 159 'class' => 'plan_name', 160 'name' => 'plan_name', 161 'name_token' => '{plan_name}', 162 'type' => 'text', 163 'title' => 'Plan name', 164 'desc' => 'Plan name', 165 166 167 'value' => "" 168 ) ; 169 170 171 172 173 174 $fields[]=$object; 175 176 154 177 155 178 $object= array( … … 159 182 'name_token' => '{total_rooms}', 160 183 'type' => 'text', 161 'title' => 'total_rooms_', 162 'desc' => 'total_rooms', 163 164 'layout' => 'Column_1', 184 'title' => 'Total rooms', 185 'desc' => 'Total rooms', 186 165 187 166 188 'value' => "" … … 171 193 172 194 $fields[]=$object; 173 174 175 176 $object= array(177 'id' => 'plan_name',178 'class' => 'plan_name',179 'name' => 'plan_name',180 'name_token' => '{plan_name}',181 'type' => 'text',182 'title' => 'Plan name',183 'desc' => 'Plan name',184 185 'layout' => 'Column_1',186 187 'value' => ""188 ) ;189 190 191 192 193 194 $fields[]=$object;195 196 197 195 $object= array( 198 196 'id' => 'rate_per_night', … … 205 203 206 204 'func' =>'wc_price' , 207 208 'layout' => 'Column_5', 205 209 206 'value' => "" 210 207 ) ; … … 245 242 'title' =>'Booking details' , 246 243 'desc' =>'saksh_booking_options' , 247 248 'layout' => 'Column_3', 244 249 245 'value' => "" 250 246 ) ; … … 265 261 'type' => 'text', 266 262 'title' => 'Total capacity [ 1/2 adults ]', 267 268 'layout' => 'Column_4', 263 269 264 'desc' => 'sleeps' , 270 265 'value' => "" … … 287 282 288 283 289 290 'layout' => 'Column_4', 284 291 285 'title' => 'Payment Conditions', 292 286 'desc' => 'saksh_payment_conditions' , … … 325 319 326 320 'name_token' => '{saksh_included}', 327 'layout' => 'Column_2',321 328 322 'name' => 'saksh_included', 329 323 'title'=> "What is included", -
saksh-wp-hotel-booking-lite/trunk/saksh_installation.php
r3091863 r3097265 44 44 dbDelta($saksh_hb_table_system); 45 45 46 var_dump( get_option( 'saksh_booking_theme_v1' ));46 // var_dump( get_option( 'saksh_booking_theme_v1' )); 47 47 if ( !get_option( 'saksh_booking_theme_v1' ) =="1" ) { 48 48 49 49 50 var_dump( get_option( 'saksh_booking_theme_v1' )); 50 // var_dump( get_option( 'saksh_booking_theme_v1' )); 51 52 saksh_create_dummy_data(); 51 53 52 54 … … 135 137 } 136 138 139 140 141 142 143 144 // create dummy contents now 145 146 147 148 149 150 137 151 138 152 } 139 153 140 154 155 function saksh_create_dummy_data() 156 { 157 158 159 160 161 $fields=array( ); 162 163 $fields = apply_filters( 'saksh_room_payment_options_metabox', $fields ); 164 165 166 167 168 // Data 1 169 170 for($i=1;$i<6;$i++) 171 { 172 foreach($fields as $f) 173 { 174 175 $name= $f['name']; 176 177 178 179 $saksh_payment_option[$i][$name] =$i; 180 181 182 183 184 185 } 186 187 188 189 $saksh_payment_option[$i]['total_rooms_'] =12 * $i; 190 $saksh_payment_option[$i]['plan_name'] = "Room Only | Non-Refundable____".$i; 191 $saksh_payment_option[$i]['rate_per_night'] =12000 * $i; 192 $saksh_payment_option[$i]['saksh_booking_options'] =" This booking is non-refundable and the tariff cannot be cancelled with zero fee."; 193 $saksh_payment_option[$i]['sleeps'] = "Total capacity [ 1/2 adults ]"; 194 195 196 $saksh_payment_option[$i]['saksh_payment_conditions'] = "No need to Pay right now. Only Credit Card details required."; 197 198 199 } 200 201 202 $my_post = array( 203 'post_title' => "Studio King Apartment", 204 'post_type' => 'rooms', 205 'post_content' => "", 206 'post_status' => 'publish' 207 ); 208 209 210 211 $post_id=wp_insert_post( $my_post ); 212 213 214 update_post_meta($post_id, 'saksh_payment_option', $saksh_payment_option); 215 216 217 // data 2 218 219 220 221 for($i=1;$i<6;$i++) 222 { 223 foreach($fields as $f) 224 { 225 226 $name= $f['name']; 227 228 229 230 $saksh_payment_option[$i][$name] =$i; 231 232 233 234 235 236 } 237 238 239 240 $saksh_payment_option[$i]['total_rooms_'] =20 * $i; 241 $saksh_payment_option[$i]['plan_name'] = "Room Only | Non-Refundable____".$i; 242 $saksh_payment_option[$i]['rate_per_night'] =15000 * $i; 243 $saksh_payment_option[$i]['saksh_booking_options'] =" This booking is non-refundable and the tariff cannot be cancelled with zero fee."; 244 $saksh_payment_option[$i]['sleeps'] = "Total capacity [ 1/2 adults ]"; 245 246 247 $saksh_payment_option[$i]['saksh_payment_conditions'] = "No need to Pay right now. Only Credit Card details required."; 248 249 250 } 251 252 253 254 $my_post = array( 255 'post_title' => " Economy Room.", 256 'post_type' => 'rooms', 257 'post_content' => "", 258 'post_status' => 'publish' 259 ); 260 261 262 263 $post_id=wp_insert_post( $my_post ); 264 265 266 update_post_meta($post_id, 'saksh_payment_option', $saksh_payment_option); 267 268 269 // data 3 270 271 272 for($i=1;$i<6;$i++) 273 { 274 foreach($fields as $f) 275 { 276 277 $name= $f['name']; 278 279 280 281 $saksh_payment_option[$i][$name] =$i; 282 283 284 285 286 287 } 288 289 290 291 $saksh_payment_option[$i]['total_rooms_'] =25 * $i; 292 $saksh_payment_option[$i]['plan_name'] = "Room Only | Non-Refundable____".$i; 293 $saksh_payment_option[$i]['rate_per_night'] =20000 * $i; 294 $saksh_payment_option[$i]['saksh_booking_options'] =" This booking is non-refundable and the tariff cannot be cancelled with zero fee."; 295 $saksh_payment_option[$i]['sleeps'] = "Total capacity [ 1/2 adults ]"; 296 297 298 $saksh_payment_option[$i]['saksh_payment_conditions'] = "No need to Pay right now. Only Credit Card details required."; 299 300 301 } 302 303 304 305 $my_post = array( 306 'post_title' => " Junior Suite.", 307 'post_type' => 'rooms', 308 'post_content' => "", 309 'post_status' => 'publish' 310 ); 311 312 313 314 $post_id=wp_insert_post( $my_post ); 315 316 317 update_post_meta($post_id, 'saksh_payment_option', $saksh_payment_option); 318 319 320 321 // data 4 322 323 324 for($i=1;$i<6;$i++) 325 { 326 foreach($fields as $f) 327 { 328 329 $name= $f['name']; 330 331 332 333 $saksh_payment_option[$i][$name] =$i; 334 335 336 337 338 339 } 340 341 342 343 $saksh_payment_option[$i]['total_rooms_'] =27 * $i; 344 $saksh_payment_option[$i]['plan_name'] = "Room Only | Non-Refundable____".$i; 345 $saksh_payment_option[$i]['rate_per_night'] =22000 * $i; 346 $saksh_payment_option[$i]['saksh_booking_options'] =" This booking is non-refundable and the tariff cannot be cancelled with zero fee."; 347 $saksh_payment_option[$i]['sleeps'] = "Total capacity [ 1/2 adults ]"; 348 349 350 $saksh_payment_option[$i]['saksh_payment_conditions'] = "No need to Pay right now. Only Credit Card details required."; 351 352 353 } 354 355 356 357 $my_post = array( 358 'post_title' => "Family Suite", 359 'post_type' => 'rooms', 360 'post_content' => "", 361 'post_status' => 'publish' 362 ); 363 364 365 366 $post_id=wp_insert_post( $my_post ); 367 368 369 update_post_meta($post_id, 'saksh_payment_option', $saksh_payment_option); 370 371 372 373 374 exit(); 375 376 377 378 } 141 379 142 380 -
saksh-wp-hotel-booking-lite/trunk/saksh_room_search_v2.php
r3090240 r3097265 2 2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 3 3 ?> 4 4 <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> 5 5 6 6 … … 16 16 17 17 18 18 sfsfdsfdsf 19 19 20 20 <h2 class='date'>Date</h2> … … 70 70 if (!empty($_POST)) 71 71 { 72 72 /* 73 73 74 74 if ( ! isset( $_POST['saksh_nonce'] ) … … 80 80 } 81 81 82 82 */ 83 83 84 84 … … 86 86 87 87 $table_name= $wpdb->prefix ."bookings"; 88 89 //echo $table_name; 88 90 89 91 … … 107 109 108 110 109 111 // var_dump($query_data); 110 112 111 113 $room_data=saksh_get_rooms_which_r_available( $query_data); 112 114 113 115 116 // var_dump($room_data); 114 117 115 118 … … 121 124 $the_query = new WP_Query( $args ); 122 125 126 // var_dump($the_query); 127 123 128 if ( $the_query->have_posts() ) 124 129 -
saksh-wp-hotel-booking-lite/trunk/saksh_theme_functions.php
r3090240 r3097265 36 36 37 37 38 function saksh_get_default_template($type) 39 { 40 41 42 43 if($type=="saksh_room_info_theme") 44 { 45 46 $content =' 47 <!-- wp:table --> 48 <figure class="wp-block-table"><table><tbody><tr><td>{thumbnail}</td></tr><tr><td>{title}</td></tr><tr><td>{amenities}</td></tr></tbody></table></figure> 49 <!-- /wp:table --> 50 51 <!-- wp:paragraph --> 52 <p>{thumbnail}</p> 53 <!-- /wp:paragraph --> 54 55 <!-- wp:paragraph --> 56 <p>{title}</p> 57 <!-- /wp:paragraph --> 58 59 <!-- wp:paragraph --> 60 <p>{amenities}</p> 61 <!-- /wp:paragraph --> 62 '; 63 64 65 } 66 67 68 else if($type=="saksh_room_info_pricing"){ 69 70 71 72 73 $content =' 74 <div class="wp-block-group"><!-- wp:columns {"verticalAlignment":"center"} --> 75 <div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> 76 <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> 77 <p>{plan_name}<br>{saksh_booking_options}</p> 78 <!-- /wp:paragraph --></div> 79 <!-- /wp:column --> 80 81 <!-- wp:column {"verticalAlignment":"center"} --> 82 <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> 83 <p>{saksh_payment_conditions}</p> 84 <!-- /wp:paragraph --></div> 85 <!-- /wp:column --> 86 87 <!-- wp:column {"verticalAlignment":"center"} --> 88 <div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph --> 89 <p>{rate_per_night}<br>{saksh_booking_button}</p> 90 <!-- /wp:paragraph --></div> 91 <!-- /wp:column --></div> 92 <!-- /wp:columns --></div> 93 <!-- /wp:group --> 94 95 <!-- wp:separator --> 96 <hr class="wp-block-separator has-alpha-channel-opacity"/> 97 <!-- /wp:separator --> 98 '; 99 100 } 101 102 103 return $content; 104 105 106 } 107 108 function saksh_get_template($saksh_wp_options,$type) 109 { 110 111 112 113 $pageid= $saksh_wp_options[$type] ; 114 115 116 117 118 $content_post = get_post($pageid); 119 if($content_post) 120 { 121 122 $content = $content_post->post_content; 123 124 } 125 else 126 127 $content = saksh_get_default_template($type); 128 129 130 131 return $content; 132 133 } 134 135 136 38 137 function saksh_print_room_info_dynamic($post_id,$query_data=array()) 39 138 … … 44 143 45 144 $saksh_wp_options=get_option("saksh_wp_options"); 46 145 47 146 48 147 … … 93 192 94 193 <?php 95 $pageid= $saksh_wp_options['saksh_room_info_theme'] ; 96 97 98 99 100 $content_post = get_post($pageid); 101 102 103 $content = $content_post->post_content; 104 194 195 196 //echo $content; 197 198 $content=saksh_get_template($saksh_wp_options,"saksh_room_info_theme" ); 105 199 106 200 echo strtr($content , $saksh_theme); … … 108 202 109 203 ?> 110 204 block 3 111 205 </div> 112 206 <div class="col-md-9 border"> 113 207 block 9 114 208 <?php 115 209 for($id=1;$id <= 5; $id++) … … 219 313 220 314 221 <?php $pageid= $saksh_wp_options['saksh_room_info_pricing'] ; 315 <?php 316 317 318 319 $content=saksh_get_template($saksh_wp_options,"saksh_room_info_pricing" ); 320 321 /* 322 323 $pageid= $saksh_wp_options['saksh_room_info_pricing'] ; 222 324 223 325 … … 228 330 229 331 $content = $content_post->post_content; 230 332 */ 231 333 232 334 echo strtr($content , $saksh_theme);
Note: See TracChangeset
for help on using the changeset viewer.