Changeset 3131355
- Timestamp:
- 08/06/2024 06:28:15 AM (18 months ago)
- Location:
- saksh-text-to-voice-system/trunk
- Files:
-
- 6 edited
-
js/saksh_scriptsV1.js (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
saksh_admin/saksh_reports.php (modified) (5 diffs)
-
saksh_ajax.php (modified) (4 diffs)
-
saksh_appointment.php (modified) (7 diffs)
-
saksh_wchook.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
saksh-text-to-voice-system/trunk/js/saksh_scriptsV1.js
r3129836 r3131355 252 252 // vue js code for simple booking . our plan is to convert whole project to vue js 253 253 let AjaxUrl = saksh_object.ajax_url; 254 255 256 257 254 258 255 259 new Vue({ … … 363 367 selectTime(selectedTimeSlot) { 364 368 365 console.log(selectedTimeSlot);369 366 370 this.selectedTime = selectedTimeSlot; 367 371 }, … … 379 383 async submitForm() { 380 384 381 385 382 386 this.isLoading = true; 383 387 this.successMessage = ''; 384 388 385 const formData = new FormData(); 386 formData.append('name', this.name); 387 formData.append('email', this.email); 388 formData.append('message', this.message); 389 formData.append('date', this.selectedDate); 390 formData.append('time', this.selectedTime); 391 formData.append('services', JSON.stringify(this.services)); // Add selected services 392 formData.append('action', 'saksh_post_simple_appointment'); 393 394 try { 395 let response = await axios.post(AjaxUrl, formData); 389 const data = { 390 name: this.name, 391 email: this.email, 392 message: this.message, 393 date: this.selectedDate, 394 start_time: this.selectedTime.start_time, 395 end_time: this.selectedTime.end_time, 396 ampm: this.selectedTime.ampm, 397 services: this.services, 398 action: 'saksh_post_simple_appointment' 399 }; 400 401 402 403 try { 404 let response = await axios.post(AjaxUrl+"?action=saksh_post_simple_appointment", data, { 405 headers: { 406 'Content-Type': 'application/json' 407 } 408 }); 409 410 411 396 412 this.isLoading = false; 397 413 this.successMessage = 'Your message has been sent successfully!'; … … 409 425 this.selectedTime = null; 410 426 this.services = []; // Reset services 427 428 429 411 430 } catch (error) { 412 431 this.isLoading = false; -
saksh-text-to-voice-system/trunk/readme.txt
r3122019 r3131355 7 7 Stable tag: 4.8.0 8 8 Requires PHP: 7.0 9 Version : 2.0. 79 Version : 2.0.8 10 10 Tags: booking system , appointments booking , salon booking system 11 11 -
saksh-text-to-voice-system/trunk/saksh_admin/saksh_reports.php
r3122016 r3131355 295 295 296 296 echo "<td> Booking ID </td>"; 297 298 echo "<td> Order ID </td>"; 297 299 298 300 299 … … 313 312 314 313 315 316 317 echo "<td> Total Charge</td>";318 319 314 320 315 316 321 317 322 318 echo "<td>Created at </td>"; … … 350 346 351 347 352 echo "<td>"; 353 354 355 echo esc_attr( $res->order_id ); 356 echo "</td>"; 348 357 349 358 350 … … 362 354 363 355 echo "<td>"; 364 echo esc_attr($res->timeslot ); 356 echo esc_attr($res->start ); 357 358 echo "-"; 359 echo esc_attr($res->end ); 360 361 362 echo " "; 363 echo esc_attr($res->ampm ); 365 364 echo "</td>"; 366 365 … … 383 382 384 383 385 386 387 echo "<td>"; 388 echo $res->order_amount ;// wc_price( $res->order_amount ) ; 389 echo "</td>"; 390 391 392 384 393 385 394 386 echo "<td>"; -
saksh-text-to-voice-system/trunk/saksh_ajax.php
r3129836 r3131355 294 294 295 295 296 // saksh_capture_data_to_log(__LINE__,['POST']); 297 296 298 function saksh_post_simple_appointment(){ 297 299 298 if ($_SERVER["REQUEST_METHOD"] == "POST") { 299 $name = htmlspecialchars($_POST['name']); 300 $email = htmlspecialchars($_POST['email']); 301 $phone = htmlspecialchars($_POST['phone']); 302 $message = htmlspecialchars($_POST['message']); 303 $date = htmlspecialchars($_POST['date']); 304 $time = htmlspecialchars($_POST['time']); 305 $services = htmlspecialchars($_POST['services']); 306 300 301 302 303 304 $json = file_get_contents('php://input'); 305 306 307 $data = json_decode($json, true); 308 309 310 saksh_capture_data_to_log(__LINE__,$data); 311 312 313 314 $name = htmlspecialchars($data['name']); 315 $email = htmlspecialchars($data['email']); 316 $phone = htmlspecialchars($data['phone']); 317 $message = htmlspecialchars($data['message']); 318 $date = htmlspecialchars($data['date']); 319 $start_time = htmlspecialchars($data['start_time']); 320 $end_time = htmlspecialchars($data['end_time']); 321 $ampm = htmlspecialchars($data['ampm']); 322 $services = implode(',',$data['services']) ; 307 323 308 324 … … 311 327 312 328 313 $date = date_create( $date); 314 329 330 331 332 333 $date = date_create( $date); 334 335 315 336 $saksh_booking_data['appointment_date']=date_format($date, 'Y-m-d'); 316 337 317 318 $saksh_booking_data['start']=$time; 319 320 $endTime = strtotime("+30 minutes",strtotime($time)); 321 322 323 $saksh_booking_data['end']=date("h:i a",$endTime);; 324 325 326 $saksh_booking_data['ampm']= ""; 327 $saksh_booking_data['services']= $services; 338 339 340 341 $saksh_booking_data['start']= $start_time ; 342 343 344 345 346 $saksh_booking_data['end']= $end_time ; 347 348 349 350 $saksh_booking_data['ampm']= $ampm; 351 $saksh_booking_data['services']= json_encode($services); 328 352 329 353 … … 333 357 $saksh_booking_data['products_title']=$message; 334 358 335 336 337 // $saksh_booking_data['products']= ""; 359 360 338 361 339 362 … … 363 386 364 387 365 $saksh_booking_data['status']= "wc-completed"; 366 367 saksh_booking_capture_data($saksh_booking_data); 388 //$saksh_booking_data['status']= "wc-completed"; 389 390 391 392 saksh_capture_data_to_log(__LINE__,$saksh_booking_data); 393 394 395 396 saksh_booking_capture_data($saksh_booking_data); 368 397 369 398 370 399 echo 'Your message has been sent successfully!'; 371 400 372 } 401 373 402 wp_die(); 374 403 -
saksh-text-to-voice-system/trunk/saksh_appointment.php
r3130304 r3131355 6 6 7 7 Author: susheelhbti 8 Version: 2.0. 78 Version: 2.0.8 9 9 Stable tag: 4.8.0 10 10 Author URI: https://profiles.wordpress.org/susheelhbti/ … … 215 215 216 216 217 218 219 220 function saksh_booking_complete_booking($query_data) 221 { 222 223 224 saksh_capture_data_to_log( __LINE__,$query_data) ; 225 226 227 228 global $wpdb; 229 230 231 $table_name= $wpdb->prefix ."saksh_bookings"; 232 233 234 $wpdb->insert( $table_name, $query_data ); 235 236 237 238 saksh_capture_data_to_log( __LINE__,[$wpdb->last_error]) ; 239 240 241 } 242 243 244 217 245 function saksh_enqueue_vue_in_admin($hook) { 218 246 … … 324 352 `id` int(11) NOT NULL AUTO_INCREMENT, 325 353 `appointment_date` date DEFAULT NULL, 326 327 328 354 329 355 … … 333 359 `timezone` varchar(200) DEFAULT NULL, 334 360 `timeslot` varchar(200) DEFAULT NULL, 335 336 361 337 362 `user_id` int(20) DEFAULT NULL, 338 363 `order_id` int(11) DEFAULT NULL, … … 344 369 `status` varchar(20) DEFAULT 'Pending', 345 370 `products_title` text DEFAULT NULL, 371 `services` varchar(200) DEFAULT NULL, 346 372 `products` json DEFAULT NULL, 347 373 … … 594 620 595 621 622 //saksh_capture_data_to_log(__LINE__,["sdfsdf"]); 623 596 624 597 625 function saksh_capture_data_to_log($line,$data) … … 599 627 600 628 601 602 return ""; 603 629 $file = 'people.txt'; 630 604 631 605 632 $my_post = array( 606 633 'post_title' => $line, 607 'post_content' =>"Saksh log---<hr />". print_r($data,true), 608 'post_status' => 'publish' 634 'post_content' =>"Saksh log---<hr />". print_r([$data],true) 609 635 ); 610 636 637 638 639 640 //file_put_contents($file, print_r($my_post,true), FILE_APPEND | LOCK_EX); 641 642 611 643 // Insert the post into the database 612 wp_insert_post( $my_post );644 wp_insert_post( $my_post ); 613 645 614 646 -
saksh-text-to-voice-system/trunk/saksh_wchook.php
r3122016 r3131355 337 337 $wpdb->insert( $table_name, $query_data ); 338 338 339 //echo $wpdb->last_error ; 340 341 342 339 340 341 $my_post = array( 342 'post_title' => __LINE__, 343 'post_content' => $wpdb->last_error 344 ); 345 346 // Insert the post into the database 347 wp_insert_post( $my_post ); 343 348 344 349 }
Note: See TracChangeset
for help on using the changeset viewer.