Plugin Directory

Changeset 3131355


Ignore:
Timestamp:
08/06/2024 06:28:15 AM (18 months ago)
Author:
susheelhbti
Message:

bug fixed

Location:
saksh-text-to-voice-system/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • saksh-text-to-voice-system/trunk/js/saksh_scriptsV1.js

    r3129836 r3131355  
    252252// vue js code for simple booking . our plan is to convert whole project to vue js
    253253 let AjaxUrl = saksh_object.ajax_url;
     254
     255
     256 
     257
    254258
    255259new Vue({
     
    363367selectTime(selectedTimeSlot) {
    364368   
    365     console.log(selectedTimeSlot);
     369   
    366370this.selectedTime = selectedTimeSlot;
    367371},
     
    379383async submitForm() {
    380384   
    381   
     385 
    382386this.isLoading = true;
    383387this.successMessage = '';
    384388
    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);
     389const data = {
     390name: this.name,
     391email: this.email,
     392message: this.message,
     393date: this.selectedDate,
     394start_time: this.selectedTime.start_time,
     395end_time: this.selectedTime.end_time,
     396ampm: this.selectedTime.ampm,
     397services: this.services,
     398action: 'saksh_post_simple_appointment'
     399};
     400
     401 
     402 
     403try {
     404let response = await axios.post(AjaxUrl+"?action=saksh_post_simple_appointment", data, {
     405headers: {
     406'Content-Type': 'application/json'
     407}
     408});
     409
     410 
     411
    396412this.isLoading = false;
    397413this.successMessage = 'Your message has been sent successfully!';
     
    409425this.selectedTime = null;
    410426this.services = []; // Reset services
     427
     428
     429 
    411430} catch (error) {
    412431this.isLoading = false;
  • saksh-text-to-voice-system/trunk/readme.txt

    r3122019 r3131355  
    77Stable tag: 4.8.0
    88Requires PHP: 7.0
    9 Version : 2.0.7
     9Version : 2.0.8
    1010Tags:   booking system , appointments booking ,     salon booking system
    1111 
  • saksh-text-to-voice-system/trunk/saksh_admin/saksh_reports.php

    r3122016 r3131355  
    295295     
    296296       echo "<td> Booking ID </td>";
    297      
    298        echo "<td> Order ID </td>";
     297       
    299298       
    300299   
     
    313312   
    314313       
    315          
    316        
    317         echo "<td> Total Charge</td>";
    318        
    319314         
    320315         
     316         
    321317       
    322318       echo "<td>Created at </td>";
     
    350346       
    351347       
    352        echo "<td>";
    353        
    354    
    355       echo  esc_attr( $res->order_id );
    356        echo "</td>";
     348   
    357349     
    358350       
     
    362354       
    363355       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 );
    365364       echo "</td>";
    366365       
     
    383382   
    384383       
    385    
    386      
    387        echo "<td>";
    388       echo  $res->order_amount ;//    wc_price(  $res->order_amount  ) ;
    389        echo "</td>";
    390        
    391 
    392      
     384   
    393385   
    394386       echo "<td>";
  • saksh-text-to-voice-system/trunk/saksh_ajax.php

    r3129836 r3131355  
    294294 
    295295 
     296 // saksh_capture_data_to_log(__LINE__,['POST']);
     297 
    296298 function saksh_post_simple_appointment(){
    297299     
    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'])   ;
    307323
    308324
     
    311327   
    312328   
    313    $date = date_create( $date);
    314    
     329   
     330   
     331   
     332     
     333  $date = date_create( $date);
     334
     335     
    315336     $saksh_booking_data['appointment_date']=date_format($date, 'Y-m-d');
    316337   
    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);
    328352   
    329353   
     
    333357   $saksh_booking_data['products_title']=$message;
    334358   
    335    
    336    
    337  // $saksh_booking_data['products']= "";
     359   
     360 
    338361   
    339362   
     
    363386 
    364387 
    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);
    368397   
    369398   
    370399echo 'Your message has been sent successfully!';
    371400
    372 }
     401 
    373402         wp_die(); 
    374403     
  • saksh-text-to-voice-system/trunk/saksh_appointment.php

    r3130304 r3131355  
    66
    77Author: susheelhbti
    8 Version: 2.0.7
     8Version: 2.0.8
    99Stable tag: 4.8.0
    1010Author URI: https://profiles.wordpress.org/susheelhbti/
     
    215215
    216216
     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 
    217245function saksh_enqueue_vue_in_admin($hook) {
    218246
     
    324352  `id` int(11) NOT NULL AUTO_INCREMENT,
    325353   `appointment_date` date DEFAULT NULL,
    326  
    327  
    328354 
    329355 
     
    333359   `timezone` varchar(200)   DEFAULT NULL,
    334360     `timeslot` varchar(200)  DEFAULT NULL,
    335  
    336  
     361   
    337362  `user_id` int(20) DEFAULT NULL,
    338363  `order_id` int(11) DEFAULT NULL,
     
    344369  `status` varchar(20) DEFAULT 'Pending',
    345370  `products_title` text   DEFAULT NULL,
     371  `services`  varchar(200)   DEFAULT NULL,
    346372   `products` json DEFAULT NULL,
    347373   
     
    594620 
    595621 
     622  //saksh_capture_data_to_log(__LINE__,["sdfsdf"]);
     623 
    596624 
    597625  function saksh_capture_data_to_log($line,$data)
     
    599627     
    600628     
    601      
    602     return "";
    603      
     629      $file = 'people.txt';
     630
    604631 
    605632$my_post = array(
    606633'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)
    609635);
    610636
     637 
     638 
     639
     640//file_put_contents($file, print_r($my_post,true), FILE_APPEND | LOCK_EX);
     641
     642
    611643// Insert the post into the database
    612   wp_insert_post( $my_post );
     644   wp_insert_post( $my_post );
    613645
    614646 
  • saksh-text-to-voice-system/trunk/saksh_wchook.php

    r3122016 r3131355  
    337337  $wpdb->insert( $table_name, $query_data );
    338338 
    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
     347wp_insert_post( $my_post );
    343348     
    344349  }
Note: See TracChangeset for help on using the changeset viewer.