Plugin Directory

Changeset 3097265


Ignore:
Timestamp:
06/04/2024 09:44:25 AM (20 months ago)
Author:
susheelhbti
Message:

FEW THINGS WAS SETUP

Location:
saksh-wp-hotel-booking-lite/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • saksh-wp-hotel-booking-lite/trunk/Saksh-WP-Hotel-Booking-Lite.php

    r3091847 r3097265  
    1313Stable tag: 2.0
    1414Requires PHP: 5.4.0
    15 License: GPLv2 or later
     15License: GPLv2 or later$cart_item
    1616License URI: https://www.gnu.org/licenses/gpl-2.0.html
    17 
     17public_html/hb3/wp-content/plugins/saksh-wp-hotel-booking-lite/saksh_admin/saksh_options
    1818*/
    1919
     
    4646
    4747 
    48 include "saksh_admin/saksh_option_panel.php";
     48include "saksh_admin/saksh_options/saksh_option_panel.php";
    4949 
    5050
     
    116116   
    117117   
    118  
    119  
    120118  $startdate = strtotime($date_start);
    121119$enddate = strtotime($date_end);
     
    146144       
    147145       
    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 
    149150 
    150151     
     
    168169 $cart_page = wc_get_cart_url();
    169170
    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 ).'" />';
    172173     
    173174       
     
    294295
    295296
     297       
     298function 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  }
    296321function saksh_check_availability($query_data,$purchase_plan_id)
    297322{
  • saksh-wp-hotel-booking-lite/trunk/saksh_admin/saksh_booking_report.php

    r3091863 r3097265  
    171171   
    172172   
    173    
    174  //saksh_hb_plugin_table_install();
     173 saksh_create_dummy_data() ;
    175174
    176175 
  • saksh-wp-hotel-booking-lite/trunk/saksh_custom_meta_form.php

    r3090240 r3097265  
    151151         
    152152         
    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           
    154177         
    155178     $object= array(
     
    159182      'name_token' => '{total_rooms}',
    160183    'type' => 'text',
    161     'title' => 'total_rooms_',
    162     'desc' => 'total_rooms',
    163    
    164       'layout' => 'Column_1',
     184    'title' => 'Total rooms',
     185    'desc' => 'Total rooms',
     186     
    165187     
    166188    'value' => ""
     
    171193   
    172194    $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    
    197195  $object= array(
    198196    'id' => 'rate_per_night',
     
    205203   
    206204    'func' =>'wc_price' ,
    207    
    208       'layout' => 'Column_5',
     205     
    209206    'value' => ""
    210207    ) ;
     
    245242    'title' =>'Booking details' ,
    246243    'desc' =>'saksh_booking_options'  ,
    247    
    248       'layout' => 'Column_3',
     244     
    249245    'value' => ""
    250246    ) ;
     
    265261    'type' => 'text',
    266262    'title' => 'Total capacity [ 1/2 adults ]',
    267    
    268       'layout' => 'Column_4',
     263     
    269264    'desc' =>  'sleeps'  ,
    270265    'value' => ""
     
    287282         
    288283         
    289    
    290       'layout' => 'Column_4',
     284     
    291285    'title' => 'Payment Conditions',
    292286    'desc' =>  'saksh_payment_conditions'  ,
     
    325319   
    326320          'name_token' => '{saksh_included}',
    327       'layout' => 'Column_2',
     321     
    328322      'name' => 'saksh_included',
    329323        'title'=> "What is included",
  • saksh-wp-hotel-booking-lite/trunk/saksh_installation.php

    r3091863 r3097265  
    4444    dbDelta($saksh_hb_table_system);
    4545 
    46  var_dump( get_option( 'saksh_booking_theme_v1' ));
     46// var_dump( get_option( 'saksh_booking_theme_v1' ));
    4747    if (  !get_option( 'saksh_booking_theme_v1' )  =="1" ) {
    4848       
    4949       
    50         var_dump( get_option( 'saksh_booking_theme_v1' ));
     50    //    var_dump( get_option( 'saksh_booking_theme_v1' ));
     51       
     52        saksh_create_dummy_data();
    5153       
    5254       
     
    135137}
    136138 
     139 
     140 
     141 
     142 
     143 
     144 // create dummy contents now
     145 
     146
     147
     148
     149
     150
    137151 
    138152}
    139153
    140154 
     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 }
    141379     
    142380     
  • saksh-wp-hotel-booking-lite/trunk/saksh_room_search_v2.php

    r3090240 r3097265  
    22if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    33?>
    4    
     4       <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    55 
    66 
     
    1616 
    1717 
    18  
     18  sfsfdsfdsf
    1919 
    2020<h2 class='date'>Date</h2>
     
    7070     if (!empty($_POST))
    7171  {
    72      
     72     /*
    7373     
    7474        if ( ! isset( $_POST['saksh_nonce'] )
     
    8080}
    8181   
    82    
     82    */
    8383 
    8484 
     
    8686 
    8787 $table_name= $wpdb->prefix ."bookings";
     88 
     89 //echo $table_name;
    8890 
    8991 
     
    107109
    108110
    109        
     111    //   var_dump($query_data);
    110112     
    111113      $room_data=saksh_get_rooms_which_r_available( $query_data);
    112114     
    113115       
     116     //  var_dump($room_data);
    114117       
    115118 
     
    121124$the_query = new WP_Query( $args );
    122125
     126     //  var_dump($the_query);
     127       
    123128if ( $the_query->have_posts() )
    124129
  • saksh-wp-hotel-booking-lite/trunk/saksh_theme_functions.php

    r3090240 r3097265  
    3636
    3737
     38function 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
     108function 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               
    38137function saksh_print_room_info_dynamic($post_id,$query_data=array())
    39138
     
    44143
    45144$saksh_wp_options=get_option("saksh_wp_options");
    46 
     145 
    47146
    48147
     
    93192 
    94193        <?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" );
    105199               
    106200                echo strtr($content  , $saksh_theme);
     
    108202               
    109203                ?>
    110  
     204 block 3
    111205            </div>
    112206        <div class="col-md-9   border">
    113          
     207           block 9
    114208      <?php     
    115209             for($id=1;$id <= 5; $id++)
     
    219313             
    220314           
    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'] ;
    222324           
    223325           
     
    228330           
    229331                $content = $content_post->post_content;
    230            
     332            */
    231333               
    232334                echo strtr($content  , $saksh_theme);
Note: See TracChangeset for help on using the changeset viewer.