Example #1
0
 function createExamples4Demo($my_bk_types = array())
 {
     global $wpdb;
     $version = get_bk_version();
     if (class_exists('wpdev_bk_multiuser')) {
         if (empty($my_bk_types)) {
             $my_bk_types = array(13, 14, 15, 16, 17);
         } else {
             shuffle($my_bk_types);
         }
         // Get NUMBER of Bookings
         $bookings_count = $wpdb->get_results("SELECT COUNT(*) as count FROM {$wpdb->prefix}booking as bk");
         if (count($bookings_count) > 0) {
             $bookings_count = $bookings_count[0]->count;
         }
         if ($bookings_count >= 20) {
             return;
         }
         $max_num_bookings = 4;
         // How many bookings exist  per resource
         foreach ($my_bk_types as $resource_id) {
             // Loop all resources
             $bk_type = $resource_id;
             // Booking Resource
             $min_days = 2;
             $max_days = 7;
             $evry_one = $max_days + 3;
             // Multiplier of interval between 2 dates of different bookings
             $days_start_shift = rand($max_days, 3 * $max_days);
             //(ceil($max_num_bookings/2)) * $max_days;           // How long far ago we are start bookings
             for ($i = 0; $i < $max_num_bookings; $i++) {
                 $is_appr = rand(0, 1);
                 // Pending | Approved
                 $num_days = rand($min_days, $max_days);
                 // Max Number of Dates for specific booking
                 $second_name = $this->getInitialValues4Demo('second_name');
                 $city = $this->getInitialValues4Demo('city');
                 $start_time = '14:00';
                 $end_time = '12:00';
                 $form = '';
                 $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                 $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                 $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                 $form .= 'text^address' . $bk_type . '^' . $this->getInitialValues4Demo('adress') . '~';
                 $form .= 'text^city' . $bk_type . '^' . $city[0] . '~';
                 $form .= 'text^postcode' . $bk_type . '^' . $this->getInitialValues4Demo('postcode') . '~';
                 $form .= 'text^country' . $bk_type . '^' . $city[1] . '~';
                 $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                 $form .= 'select-one^visitors' . $bk_type . '^1~';
                 //$form .= 'checkbox^children'.$bk_type.'[]^0~';
                 $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info') . '~';
                 $form .= 'coupon^coupon' . $bk_type . '^ ';
                 $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES\n                                                       ( '" . $form . "', " . $bk_type . ", " . rand(0, 1000) . ", MD5('" . time() . '_' . rand(1000, 1000000) . "'), NOW() ) ;";
                 $wpdb->query($wp_bk_querie);
                 $temp_id = $wpdb->insert_id;
                 $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                 for ($d_num = 0; $d_num < $num_days; $d_num++) {
                     $my_interval = $i * $evry_one + $d_num;
                     $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL  -" . $days_start_shift . " day) + INTERVAL " . $my_interval . " day  ," . $is_appr . " ),";
                 }
                 $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                 $wpdb->query($wp_queries_sub);
             }
         }
     } else {
         if ($version == 'free') {
             if (empty($my_bk_types)) {
                 $my_bk_types = array(1, 1);
             } else {
                 shuffle($my_bk_types);
             }
             for ($i = 0; $i < count($my_bk_types); $i++) {
                 $bk_type = 1;
                 //rand(1,4);
                 $is_appr = rand(0, 1);
                 $evry_one = 2;
                 //rand(1,7);
                 if ($_SERVER['HTTP_HOST'] === 'dev') {
                     $evry_one = rand(1, 14);
                     //2;//rand(1,7);
                     $num_days = rand(1, 7);
                     //2;//rand(1,7);
                     $days_start_shift = rand(-28, 0);
                 }
                 $second_name = $this->getInitialValues4Demo('second_name');
                 $form = '';
                 $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                 $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                 $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                 $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                 $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info');
                 $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, modification_date ) VALUES ( '" . $form . "', NOW()  ) ;";
                 $wpdb->query($wp_bk_querie);
                 $temp_id = $wpdb->insert_id;
                 $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                 if ($_SERVER['HTTP_HOST'] === 'dev') {
                     for ($d_num = 0; $d_num < $num_days; $d_num++) {
                         $wp_queries_sub .= "( " . $temp_id . ", CURDATE()+ INTERVAL " . ($days_start_shift + 2 * ($i + 1) * $evry_one + $d_num) . " day  ," . $is_appr . " ),";
                     }
                     $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                 } else {
                     $wp_queries_sub .= "( " . $temp_id . ", CURDATE()+ INTERVAL " . (2 * ($i + 1) * $evry_one + 2) . " day ," . $is_appr . " ),\n                                        ( " . $temp_id . ", CURDATE()+ INTERVAL " . (2 * ($i + 1) * $evry_one + 3) . " day  ," . $is_appr . " ),\n                                        ( " . $temp_id . ", CURDATE()+ INTERVAL " . (2 * ($i + 1) * $evry_one + 4) . " day ," . $is_appr . " );";
                 }
                 $wpdb->query($wp_queries_sub);
             }
         } else {
             if ($version == 'personal') {
                 $max_num_bookings = 8;
                 // How many bookings exist
                 for ($i = 0; $i < $max_num_bookings; $i++) {
                     $bk_type = rand(1, 4);
                     // Booking Resource
                     $min_days = 1;
                     $max_days = 7;
                     $is_appr = rand(0, 1);
                     // Pending | Approved
                     $evry_one = $max_days;
                     // Multiplier of interval between 2 dates of different bookings
                     $num_days = rand($min_days, $max_days);
                     // Max Number of Dates for specific booking
                     $days_start_shift = -1 * ceil($max_num_bookings / 2) * $max_days;
                     // How long far ago we are start bookings
                     $second_name = $this->getInitialValues4Demo('second_name');
                     $form = '';
                     $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                     $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                     $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                     $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                     $form .= 'select-one^visitors' . $bk_type . '^' . rand(1, 4) . '~';
                     $form .= 'select-one^children' . $bk_type . '^' . rand(0, 3) . '~';
                     $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info');
                     $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, hash,  modification_date ) VALUES\n                                                       ( '" . $form . "', " . $bk_type . ", MD5('" . time() . '_' . rand(1000, 1000000) . "'), NOW() ) ;";
                     $wpdb->query($wp_bk_querie);
                     $temp_id = $wpdb->insert_id;
                     $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                     for ($d_num = 0; $d_num < $num_days; $d_num++) {
                         $wp_queries_sub .= "( " . $temp_id . ", CURDATE()+ INTERVAL " . ($days_start_shift + $i * $evry_one + $d_num) . " day  ," . $is_appr . " ),";
                     }
                     $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                     $wpdb->query($wp_queries_sub);
                 }
             } else {
                 if ($version == 'biz_s') {
                     $max_num_bookings = 8;
                     // How many bookings exist
                     for ($i = 0; $i < $max_num_bookings; $i++) {
                         $bk_type = rand(1, 4);
                         // Booking Resource
                         $min_days = 1;
                         $max_days = 1;
                         $is_appr = rand(0, 1);
                         // Pending | Approved
                         $evry_one = $max_days;
                         // Multiplier of interval between 2 dates of different bookings
                         $num_days = rand($min_days, $max_days);
                         // Max Number of Dates for specific booking
                         $days_start_shift = ceil($max_num_bookings / 4) * $max_days;
                         // How long far ago we are start bookings
                         $second_name = $this->getInitialValues4Demo('second_name');
                         $city = $this->getInitialValues4Demo('city');
                         $range_time = $this->getInitialValues4Demo('rangetime');
                         $start_time = $range_time[0];
                         $end_time = $range_time[1];
                         $form = '';
                         $form .= 'select-one^rangetime' . $bk_type . '^' . $start_time . ' - ' . $end_time . '~';
                         $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                         $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                         $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                         $form .= 'text^address' . $bk_type . '^' . $this->getInitialValues4Demo('adress') . '~';
                         $form .= 'text^city' . $bk_type . '^' . $city[0] . '~';
                         $form .= 'text^postcode' . $bk_type . '^' . $this->getInitialValues4Demo('postcode') . '~';
                         $form .= 'text^country' . $bk_type . '^' . $city[1] . '~';
                         $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                         $form .= 'select-one^visitors' . $bk_type . '^' . rand(1, 4) . '~';
                         $form .= 'checkbox^children' . $bk_type . '[]^' . rand(0, 3) . '~';
                         $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info');
                         $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES\n                                                       ( '" . $form . "', " . $bk_type . ", " . rand(0, 1000) . ", MD5('" . time() . '_' . rand(1000, 1000000) . "'), NOW() ) ;";
                         $wpdb->query($wp_bk_querie);
                         $temp_id = $wpdb->insert_id;
                         $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                         for ($d_num = 0; $d_num < $num_days; $d_num++) {
                             $my_interval = $i * $evry_one + $d_num;
                             //                        $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL \"".($days_start_shift + $i*$evry_one + $d_num)." ".$start_time.":01\" DAY_SECOND  ,". $is_appr." ),";
                             //                        $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL \"".($days_start_shift + $i*$evry_one + $d_num)." ".$end_time  .":02\" DAY_SECOND  ,". $is_appr." ),";
                             $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " DAY) + INTERVAL \"" . $my_interval . " " . $start_time . ":01\" DAY_SECOND  ," . $is_appr . " ),";
                             $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " DAY) + INTERVAL \"" . $my_interval . " " . $end_time . ":02\" DAY_SECOND  ," . $is_appr . " ),";
                         }
                         $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                         $wpdb->query($wp_queries_sub);
                     }
                 } else {
                     if ($version == 'biz_m') {
                         $max_num_bookings = 8;
                         // How many bookings exist
                         for ($i = 0; $i < $max_num_bookings; $i++) {
                             $bk_type = rand(1, 4);
                             // Booking Resource
                             $min_days = 3;
                             $max_days = 7;
                             $is_appr = rand(0, 1);
                             // Pending | Approved
                             $evry_one = $max_days;
                             // Multiplier of interval between 2 dates of different bookings
                             $num_days = rand($min_days, $max_days);
                             // Max Number of Dates for specific booking
                             $days_start_shift = ceil($max_num_bookings / 2) * $max_days;
                             // How long far ago we are start bookings
                             $second_name = $this->getInitialValues4Demo('second_name');
                             $city = $this->getInitialValues4Demo('city');
                             $start_time = '14:00';
                             $end_time = '12:00';
                             $form = '';
                             $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                             $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                             $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                             $form .= 'text^address' . $bk_type . '^' . $this->getInitialValues4Demo('adress') . '~';
                             $form .= 'text^city' . $bk_type . '^' . $city[0] . '~';
                             $form .= 'text^postcode' . $bk_type . '^' . $this->getInitialValues4Demo('postcode') . '~';
                             $form .= 'text^country' . $bk_type . '^' . $city[1] . '~';
                             $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                             $form .= 'select-one^visitors' . $bk_type . '^' . rand(1, 4) . '~';
                             $form .= 'checkbox^children' . $bk_type . '[]^' . rand(0, 3) . '~';
                             $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info') . '~';
                             $form .= 'text^starttime' . $bk_type . '^' . $start_time . '~';
                             $form .= 'text^endtime' . $bk_type . '^' . $end_time;
                             $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES\n                                                       ( '" . $form . "', " . $bk_type . ", " . rand(0, 1000) . ", MD5('" . time() . '_' . rand(1000, 1000000) . "'), NOW() ) ;";
                             $wpdb->query($wp_bk_querie);
                             $temp_id = $wpdb->insert_id;
                             $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                             for ($d_num = 0; $d_num < $num_days; $d_num++) {
                                 $my_interval = $i * $evry_one + $d_num;
                                 if ($d_num == 0) {
                                     // Check In
                                     $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL  -" . $days_start_shift . " day) + INTERVAL \"" . $my_interval . " " . $start_time . ":01\" DAY_SECOND  ," . $is_appr . " ),";
                                 } elseif ($d_num == $num_days - 1) {
                                     // Check Out
                                     $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " day) + INTERVAL \"" . $my_interval . " " . $end_time . ":02\" DAY_SECOND  ," . $is_appr . " ),";
                                 } else {
                                     $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL  -" . $days_start_shift . " day) + INTERVAL " . $my_interval . " day  ," . $is_appr . " ),";
                                 }
                             }
                             $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                             $wpdb->query($wp_queries_sub);
                         }
                     } else {
                         if ($version == 'biz_l') {
                             $max_num_bookings = 12;
                             // How many bookings exist
                             for ($res_groups = 0; $res_groups < 2; $res_groups++) {
                                 for ($i = 0; $i < $max_num_bookings; $i++) {
                                     if ($res_groups) {
                                         $bk_type = rand(1, 6);
                                     } else {
                                         $bk_type = rand(7, 12);
                                     }
                                     // Booking Resource
                                     $min_days = 2;
                                     $max_days = 7;
                                     $is_appr = rand(0, 1);
                                     // Pending | Approved
                                     $evry_one = $max_days;
                                     // Multiplier of interval between 2 dates of different bookings
                                     $num_days = rand($min_days, $max_days);
                                     // Max Number of Dates for specific booking
                                     $days_start_shift = ceil($max_num_bookings / 2) * $max_days;
                                     // How long far ago we are start bookings
                                     $second_name = $this->getInitialValues4Demo('second_name');
                                     $city = $this->getInitialValues4Demo('city');
                                     $start_time = '14:00';
                                     $end_time = '12:00';
                                     $form = '';
                                     $form .= 'text^name' . $bk_type . '^' . $this->getInitialValues4Demo('name') . '~';
                                     $form .= 'text^secondname' . $bk_type . '^' . $second_name . '~';
                                     $form .= 'text^email' . $bk_type . '^' . $second_name . '.example@wpbookingcalendar.com~';
                                     $form .= 'text^address' . $bk_type . '^' . $this->getInitialValues4Demo('adress') . '~';
                                     $form .= 'text^city' . $bk_type . '^' . $city[0] . '~';
                                     $form .= 'text^postcode' . $bk_type . '^' . $this->getInitialValues4Demo('postcode') . '~';
                                     $form .= 'text^country' . $bk_type . '^' . $city[1] . '~';
                                     $form .= 'text^phone' . $bk_type . '^' . $this->getInitialValues4Demo('phone') . '~';
                                     $form .= 'select-one^visitors' . $bk_type . '^1~';
                                     //$form .= 'checkbox^children'.$bk_type.'[]^0~';
                                     $form .= 'textarea^details' . $bk_type . '^' . $this->getInitialValues4Demo('info') . '~';
                                     $form .= 'coupon^coupon' . $bk_type . '^ ';
                                     $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES\n                                                       ( '" . $form . "', " . $bk_type . ", " . rand(0, 1000) . ", MD5('" . time() . '_' . rand(1000, 1000000) . "'), NOW() ) ;";
                                     $wpdb->query($wp_bk_querie);
                                     $temp_id = $wpdb->insert_id;
                                     $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates (\n                                         booking_id,\n                                         booking_date,\n                                         approved\n                                        ) VALUES ";
                                     for ($d_num = 0; $d_num < $num_days; $d_num++) {
                                         $my_interval = $i * $evry_one + $d_num;
                                         $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL  -" . $days_start_shift . " day) + INTERVAL " . $my_interval . " day  ," . $is_appr . " ),";
                                     }
                                     $wp_queries_sub = substr($wp_queries_sub, 0, -1) . ";";
                                     $wpdb->query($wp_queries_sub);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
function booking_listing_table($bookings, $booking_types)
{
    //debuge($_REQUEST);
    $user = wp_get_current_user();
    $user_bk_id = $user->ID;
    $bk_url_listing = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking';
    $bk_url_add = $bk_url_listing . '-reservation';
    $bk_url_resources = $bk_url_listing . '-resources';
    $bk_url_settings = $bk_url_listing . '-option';
    $bk_admin_url = get_params_in_url(array('page_num', 'wh_booking_type'));
    $booking_date_view_type = get_bk_option('booking_date_view_type');
    if ($booking_date_view_type == 'short') {
        $wide_days_class = ' hidden_items ';
        $short_days_class = '';
    } else {
        $wide_days_class = '';
        $short_days_class = ' hidden_items ';
    }
    $version = get_bk_version();
    if ($version == 'free') {
        $is_free = true;
    } else {
        $is_free = false;
    }
    ?>
         <div id="listing_visible_bookings">
          <?php 
    if (count($bookings) > 0) {
        ?>
          <div class="row-fluid booking-listing-header">
              <div class="booking-listing-collumn span1 wpbc_column_1" style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" onclick="javascript:setCheckBoxInTable(this.checked, 'booking_list_item_checkbox');">&nbsp;&nbsp;&nbsp;<?php 
        echo 'ID';
        ?>
</div>
              <div class="booking-listing-collumn span<?php 
        echo $is_free ? '1' : '2';
        ?>
 wpbc_column_2"><?php 
        _e('Labels', 'wpdev-booking');
        if (!$is_free) {
            echo ' / ';
            _e('Actions', 'wpdev-booking');
        }
        ?>
</div>
              <div class="booking-listing-collumn span<?php 
        echo $is_free ? '5' : '6';
        ?>
 wpbc_column_4"><?php 
        _e('Booking Data', 'wpdev-booking');
        ?>
</div>
              <div class="booking-listing-collumn span3 wpbc_column_5"><?php 
        _e('Booking Dates', 'wpdev-booking');
        ?>
&nbsp;&nbsp;&nbsp;
                  <a href="javascript:void(0)" id="booking_dates_full" onclick="javascript:
                            jQuery('#booking_dates_full').hide();
                            jQuery('#booking_dates_small').show();
                            jQuery('.booking_dates_small').hide();
                            jQuery('.booking_dates_full').show();" data-original-title="<?php 
        _e('Show ALL dates of booking', 'wpdev-booking');
        ?>
"  rel="tooltip" class="tooltip_top <?php 
        echo $short_days_class;
        ?>
 "><i class="icon-resize-full" style=" margin-top: 2px;"></i></a>
                  <a href="javascript:void(0)" id="booking_dates_small" onclick="javascript:
                            jQuery('#booking_dates_small').hide();
                            jQuery('#booking_dates_full').show();
                            jQuery('.booking_dates_small').show();
                            jQuery('.booking_dates_full').hide();" data-original-title="<?php 
        _e('Show only check in/out dates', 'wpdev-booking');
        ?>
"  rel="tooltip" class="tooltip_top <?php 
        echo $wide_days_class;
        ?>
 " ><i class="icon-resize-small" style=" margin-top: 2px;"></i></a>
              </div>
              <?php 
        if ($is_free) {
            ?>
              <div class="booking-listing-collumn span2 wpbc_column_5"><?php 
            _e('Actions', 'wpdev-booking');
            ?>
</div>
              <?php 
        }
        ?>
          </div>
          <?php 
    } else {
        echo '<center><h3>' . __('Nothing found!', 'wpdev-booking') . '</h3></center>';
    }
    ?>
        <?php 
    // P
    $print_data = apply_bk_filter('get_bklist_print_header', array(array()));
    $is_alternative_color = true;
    $id_of_new_bookings = array();
    foreach ($bookings as $bk) {
        $is_selected_color = 0;
        //rand(0,1);
        $is_alternative_color = !$is_alternative_color;
        $booking_id = $bk->booking_id;
        // 100
        $is_new = isset($bk->is_new) ? $bk->is_new : '0';
        // 1
        $bk_modification_date = isset($bk->modification_date) ? $bk->modification_date : '';
        // 2012-02-29 16:01:58
        $bk_form = $bk->form;
        // select-one^rangetime5^10:00 - 12:00~text^name5^Jonny~text^secondname5^Smith~email^ ....
        $bk_form_show = $bk->form_show;
        // First Name:Jonny   Last Name:Smith   Email:email@server.com  Country:GB  ....
        $bk_form_data = $bk->form_data;
        // Array ([name] => Jonny... [_all_] => Array ( [rangetime5] => 10:00 - 12:00 [name5] => Jonny ... ) .... )
        $bk_dates = $bk->dates;
        // Array ( [0] => stdClass Object ( [booking_id] => 8 [booking_date] => 2012-04-16 10:00:01 [approved] => 0 [type_id] => )
        $bk_dates_short = $bk->dates_short;
        // Array ( [0] => 2012-04-16 10:00:01 [1] => - [2] => 2012-04-20 12:00:02 [3] => , [4] => 2012-04-16 10:00:01 ....
        //P
        $bk_booking_type = isset($bk->booking_type) ? $bk->booking_type : '1';
        // 3
        if (!class_exists('wpdev_bk_personal')) {
            $bk_booking_type_name = '<span class="label_resource_not_exist">' . __('Default', 'wpdev-booking') . '</span>';
        } else {
            if (isset($booking_types[$bk_booking_type])) {
                $bk_booking_type_name = $booking_types[$bk_booking_type]->title;
                // Default
                if (strlen($bk_booking_type_name) > 19) {
                    //$bk_booking_type_name = substr($bk_booking_type_name, 0,  13) . ' ... ' . substr($bk_booking_type_name, -3 );
                    $bk_booking_type_name = '<span style="cursor:pointer;" rel="tooltip" class="tooltip_top"  data-original-title="' . $bk_booking_type_name . '">' . substr($bk_booking_type_name, 0, 13) . ' ... ' . substr($bk_booking_type_name, -3) . '</span>';
                }
            } else {
                $bk_booking_type_name = '<span class="label_resource_not_exist">' . __('Resource not exist', 'wpdev-booking') . '</span>';
            }
        }
        $bk_hash = isset($bk->hash) ? $bk->hash : '';
        // 99c9c2bd4fd0207e4376bdbf5ee473bc
        $bk_remark = isset($bk->remark) ? $bk->remark : '';
        //
        //BS
        $bk_cost = isset($bk->cost) ? $bk->cost : '';
        // 150.00
        $bk_pay_status = isset($bk->pay_status) ? $bk->pay_status : '';
        // 30800
        $bk_pay_request = isset($bk->pay_request) ? $bk->pay_request : '';
        // 0
        $bk_status = isset($bk->status) ? $bk->status : '';
        //BL
        $bk_dates_short_id = array();
        if (count($bk->dates) > 0) {
            $bk_dates_short_id = isset($bk->dates_short_id) ? $bk->dates_short_id : array();
        }
        // Array ([0] => [1] => .... [4] => 6... [11] => [12] => 8 )
        $is_approved = 0;
        if (count($bk->dates) > 0) {
            $is_approved = $bk->dates[0]->approved;
        }
        //BS
        $is_paid = 0;
        $payment_status_titles_current = '';
        if (class_exists('wpdev_bk_biz_s')) {
            if (is_payment_status_ok(trim($bk_pay_status))) {
                $is_paid = 1;
            }
            $payment_status_titles = get_payment_status_titles();
            $payment_status_titles_current = array_search($bk_pay_status, $payment_status_titles);
            if ($payment_status_titles_current === FALSE) {
                $payment_status_titles_current = $bk_pay_status;
            }
        }
        if ($is_new == 1) {
            $id_of_new_bookings[] = $booking_id;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Get SHORT Dates showing data ////////////////////////////////////////////////////////////////////////////////////////////////////
        //$short_dates_content = wpdevbk_get_str_from_dates_short($bk_dates_short, $is_approved , $bk_dates_short_id , $booking_types );
        $short_dates_content = '';
        $dcnt = 0;
        foreach ($bk_dates_short as $dt) {
            if ($dt == '-') {
                $short_dates_content .= '<span class="date_tire"> - </span>';
            } elseif ($dt == ',') {
                $short_dates_content .= '<span class="date_tire">, </span>';
            } else {
                $short_dates_content .= '<a href="javascript:void(0)" class="field-booking-date ';
                if ($is_approved) {
                    $short_dates_content .= ' approved';
                }
                $short_dates_content .= '">';
                $bk_date = wpdevbk_get_date_in_correct_format($dt);
                $short_dates_content .= $bk_date[0];
                $short_dates_content .= '<sup class="field-booking-time">' . $bk_date[1] . '</sup>';
                // BL
                if (class_exists('wpdev_bk_biz_l')) {
                    if (!empty($bk_dates_short_id[$dcnt])) {
                        $bk_booking_type_name_date = $booking_types[$bk_dates_short_id[$dcnt]]->title;
                        // Default
                        if (strlen($bk_booking_type_name_date) > 19) {
                            $bk_booking_type_name_date = substr($bk_booking_type_name_date, 0, 13) . '...' . substr($bk_booking_type_name_date, -3);
                        }
                        $short_dates_content .= '<sup class="field-booking-time date_from_dif_type"> ' . $bk_booking_type_name_date . '</sup>';
                    }
                }
                $short_dates_content .= '</a>';
            }
            $dcnt++;
        }
        // Get WIDE Dates showing data /////////////////////////////////////////////////////////////////////////////////////////////////////
        $wide_dates_content = '';
        $dates_count = count($bk_dates);
        $dcnt = 0;
        foreach ($bk_dates as $dt) {
            $dcnt++;
            $wide_dates_content .= '<a href="javascript:void(0)" class="field-booking-date ';
            if ($is_approved) {
                $wide_dates_content .= ' approved';
            }
            $wide_dates_content .= ' ">';
            $bk_date = wpdevbk_get_date_in_correct_format($dt->booking_date);
            $wide_dates_content .= $bk_date[0];
            $wide_dates_content .= '<sup class="field-booking-time">' . $bk_date[1] . '</sup>';
            // BL
            if (class_exists('wpdev_bk_biz_l')) {
                if ($dt->type_id != '' && isset($booking_types[$dt->type_id])) {
                    $bk_booking_type_name_date = $booking_types[$dt->type_id]->title;
                    // Default
                    if (strlen($bk_booking_type_name_date) > 19) {
                        $bk_booking_type_name_date = substr($bk_booking_type_name_date, 0, 13) . '...' . substr($bk_booking_type_name_date, -3);
                    }
                    $wide_dates_content .= '<sup class="field-booking-time date_from_dif_type"> ' . $bk_booking_type_name_date . '</sup>';
                }
            }
            $wide_dates_content .= '</a>';
            if ($dcnt < $dates_count) {
                $wide_dates_content .= '<span class="date_tire">, </span>';
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // BS
        $pay_print_status = '';
        if (class_exists('wpdev_bk_biz_s')) {
            if ($is_paid) {
                $pay_print_status = __('Paid OK', 'wpdev-booking');
                if ($payment_status_titles_current == 'Completed') {
                    $pay_print_status = $payment_status_titles_current;
                }
            } else {
                if (is_numeric($bk_pay_status) || $bk_pay_status == '') {
                    $pay_print_status = __('Unknown', 'wpdev-booking');
                } else {
                    $pay_print_status = $payment_status_titles_current;
                }
            }
        }
        ///// Print data  //////////////////////////////////////////////////////////////////////////////
        $print_data[] = apply_bk_filter('get_bklist_print_row', array(), $booking_id, $is_approved, $bk_form_show, $bk_booking_type_name, $is_paid, $pay_print_status, $booking_date_view_type == 'short' ? '<div class="booking_dates_small">' . $short_dates_content . '</div>' : '<div class="booking_dates_full">' . $wide_dates_content . '</div>', $bk_cost);
        //////////////////////////////////////////////////////////////////////////////////////////////
        ?>
          <div id="booking_mark_<?php 
        echo $booking_id;
        ?>
"  class="<?php 
        if ($is_new != '1') {
            echo ' hidden_items ';
        }
        ?>
 new-label clearfix-height">
              <a href="javascript:void(0)"  class="tooltip_bottom approve_bk_link  <?php 
        //if ($is_approved) echo ' hidden_items ';
        ?>
 "
                       onclick="javascript:mark_read_booking( '<?php 
        echo $booking_id;
        ?>
' ,
                                                      0, <?php 
        echo $user_bk_id;
        ?>
, '<?php 
        echo getBookingLocale();
        ?>
' );"
                       data-original-title="<?php 
        _e('Mark', 'wpdev-booking');
        echo ' ';
        _e('Unread', 'wpdev-booking');
        ?>
"  rel="tooltip" >
                        <img src="<?php 
        echo WPDEV_BK_PLUGIN_URL;
        ?>
/img/label_new_blue.png" style="width:24px; height:24px;"></a>
          </div>
          <div id="booking_row_<?php 
        echo $booking_id;
        ?>
"  class="row-fluid booking-listing-row clearfix-height<?php 
        if ($is_alternative_color) {
            echo ' row_alternative_color ';
        }
        if ($is_selected_color) {
            echo ' row_selected_color ';
        }
        //if ($is_new) echo ' row_unread_color ';
        $date_format = get_bk_option('booking_date_format');
        $time_format = get_bk_option('booking_time_format');
        if (empty($date_format)) {
            $date_format = "m / d / Y, D";
        }
        if (empty($time_format)) {
            $time_format = 'h:i a';
        }
        $cr_date = date_i18n($date_format, mysql2date('U', $bk_modification_date));
        $cr_time = date_i18n($time_format, mysql2date('U', $bk_modification_date));
        ?>
" >

              <div class="wpbc_column_1 booking-listing-collumn bktextcenter span1">
                    <input type="checkbox" class="booking_list_item_checkbox" 
                           onclick="javascript: if (jQuery(this).attr('checked') !== undefined ) { jQuery(this).parent().parent().addClass('row_selected_color'); } else {jQuery(this).parent().parent().removeClass('row_selected_color');}"
                           <?php 
        if ($is_selected_color) {
            echo ' checked="CHECKED" ';
        }
        ?>
                           id="booking_id_selected_<?php 
        echo $booking_id;
        ?>
"  name="booking_appr_<?php 
        $booking_id;
        ?>
"
                           /><span class="wpbc_mobile_legend clear" style="margin:0 -5px 0 25px"><?php 
        _e('ID', 'wpdev-booking');
        ?>
: </span><span class="field-id"><?php 
        echo $booking_id;
        ?>
</span>                  
              </div>

              <div class="wpbc_column_2 booking-listing-collumn bktextleft booking-labels span<?php 
        echo $is_free ? '1' : '2';
        ?>
 ">
                  <?php 
        make_bk_action('wpdev_bk_listing_show_resource_label', $bk_booking_type_name, $bk_admin_url . '&wh_booking_type=' . $bk_booking_type);
        ?>
                  <?php 
        make_bk_action('wpdev_bk_listing_show_payment_label', $is_paid, $pay_print_status, $payment_status_titles_current);
        ?>
                  <span class="label label-pending <?php 
        if ($is_approved) {
            echo ' hidden_items ';
        }
        ?>
 "><?php 
        _e('Pending', 'wpdev-booking');
        ?>
</span>
                  <span class="label label-approved <?php 
        if (!$is_approved) {
            echo ' hidden_items ';
        }
        ?>
"><?php 
        _e('Approved', 'wpdev-booking');
        ?>
</span>
              </div>

              <div class="wpbc_column_3 booking-listing-collumn bktextjustify span<?php 
        echo $is_free ? '5' : '6';
        ?>
 ">
                    <div style="text-align:left"><?php 
        echo $bk_form_show;
        ?>
</div>
              </div>

              <div class="wpbc_column_4 booking-listing-collumn bktextleft booking-dates span3">

                <div class="booking_dates_small <?php 
        echo $short_days_class;
        ?>
"><?php 
        echo $short_dates_content;
        ?>
</div>
                <div class="booking_dates_full  <?php 
        echo $wide_days_class;
        ?>
" ><?php 
        echo $wide_dates_content;
        ?>
</div>

              </div>

              <?php 
        $edit_booking_url = $bk_url_add . '&booking_type=' . $bk_booking_type . '&booking_hash=' . $bk_hash . '&parent_res=1';
        ?>

              <div class="wpbc_column_5 booking-listing-collumn booking-actions<?php 
        echo $is_free ? '0 span2 bktextcenter' : ' bktextleft ';
        ?>
 ">

                <?php 
        $is_can = true;
        //current_user_can( 'edit_posts' );
        if ($is_can) {
            ?>
                  
                  
                  <?php 
            make_bk_action('wpdev_bk_listing_show_cost_btn', $booking_id, $bk_cost);
            ?>
                  
                  <div class="actions-fields-group">
                    <?php 
            make_bk_action('wpdev_bk_listing_show_edit_btn', $booking_id, $edit_booking_url, $bk_remark, $bk_booking_type);
            ?>
<a    href="javascript:void(0)"  class="tooltip_top approve_bk_link button-secondary button  <?php 
            if ($is_approved) {
                echo ' hidden_items ';
            }
            ?>
 "
                            onclick="javascript:approve_unapprove_booking(<?php 
            echo $booking_id;
            ?>
,1, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1  );"
                            data-original-title="<?php 
            _e('Approve', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                       ><i class="icon-ok-circle"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/accept-24x24.gif" style="width:14px; height:14px;"><?php /**/
            ?>
</a><a                     
                            href="javascript:void(0)"  class="tooltip_top pending_bk_link button-secondary button  <?php 
            if (!$is_approved) {
                echo ' hidden_items ';
            }
            ?>
 "
                            onclick="javascript:if ( bk_are_you_sure('<?php 
            echo esc_js(__('Do you really want to set booking as pending ?', 'wpdev-booking'));
            ?>
') ) approve_unapprove_booking(<?php 
            echo $booking_id;
            ?>
,0, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1  );"
                            data-original-title="<?php 
            _e('Reject', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                        ><i class="icon-ban-circle"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/remove-16x16.png" style="width:15px; height:15px;"><?php /**/
            ?>
</a><a                     
                            href="javascript:void(0)" 
                            onclick="javascript:if ( bk_are_you_sure('<?php 
            echo esc_js(__('Do you really want to delete this booking ?', 'wpdev-booking'));
            ?>
') ) delete_booking(<?php 
            echo $booking_id;
            ?>
, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1   );"
                            data-original-title="<?php 
            _e('Delete', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                            class="tooltip_top button-secondary button"
                        ><i class="icon-trash"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/delete_type.png" style="width:13px; height:13px;"><?php /**/
            ?>
</a><?php 
            make_bk_action('wpdev_bk_listing_show_print_btn', $booking_id);
            make_bk_action('wpdev_bk_listing_show_payment_status_btn', $booking_id);
            ?>
                      
                    <div class="field-date" style="<?php 
            echo $is_free ? 'margin-top:5px;float: none;white-space: normal;' : '';
            ?>
"><span ><?php 
            _e('Created', 'wpdev-booking');
            ?>
:</span> <span><?php 
            echo $cr_date, ' ', $cr_time;
            ?>
</span></div>
                  </div>
              <?php 
        }
        ?>
              </div>
       
              <?php 
        make_bk_action('wpdev_bk_listing_show_edit_fields', $booking_id, $bk_remark);
        ?>

              <?php 
        make_bk_action('wpdev_bk_listing_show_payment_status_cost_fields', $booking_id, $bk_pay_status);
        ?>
              
          </div>
        <?php 
    }
    ?>
        </div>

        <?php 
    //if  ( wpbc_is_field_in_table_exists('booking','is_new') != 0 )  renew_NumOfNewBookings($id_of_new_bookings); // Update num status if supported
    ?>

        <?php 
    make_bk_action('wpdev_bk_listing_show_change_booking_resources', $booking_types);
    ?>

        <?php 
    if (function_exists('wpdevbk_generate_print_loyout')) {
        wpdevbk_generate_print_loyout($print_data);
    }
}
function wpdevbk_booking_listings_tabs_in_top_menu_line()
{
    $is_only_icons = !true;
    if ($is_only_icons) {
        echo '<style type="text/css"> #menu-wpdevplugin .nav-tab { padding:4px 2px 6px 32px !important; } </style>';
    }
    $selected_icon = 'Season-64x64.png';
    if (!isset($_REQUEST['tab'])) {
        $_REQUEST['tab'] = 'filter';
    }
    $selected_title = $_REQUEST['tab'];
    ?>
         <div style="height:1px;clear:both;margin-top:30px;"></div>
         <div id="menu-wpdevplugin">
            <div class="nav-tabs-wrapper">
                <div class="nav-tabs">

                    <?php 
    $title = __('Filter', 'wpdev-booking');
    $my_icon = 'Season-64x64.png';
    $my_tab = 'filter';
    $my_additinal_class = '';
    ?>
                    <?php 
    if ($_REQUEST['tab'] == 'filter') {
        $slct_a = 'selected';
        $selected_title = $title;
        $selected_icon = $my_icon;
    } else {
        $slct_a = '';
    }
    ?>
<a class="nav-tab <?php 
    if ($slct_a == 'selected') {
        echo ' nav-tab-active ';
    }
    echo $my_additinal_class;
    ?>
" title="<?php 
    //echo __('Customization of booking form fields','wpdev-booking');
    ?>
"  href="#" onclick="javascript:jQuery('.visibility_container').hide(); jQuery('#<?php 
    echo $my_tab;
    ?>
').show();jQuery('.nav-tab').removeClass('nav-tab-active');jQuery(this).addClass('nav-tab-active');"><img class="menuicons" src="<?php 
    echo WPDEV_BK_PLUGIN_URL;
    ?>
/img/<?php 
    echo $my_icon;
    ?>
"><?php 
    if ($is_only_icons) {
        echo '&nbsp;';
    } else {
        echo $title;
    }
    ?>
</a>

                    <?php 
    $title = __('Actions', 'wpdev-booking');
    $my_icon = 'actionservices24x24.png';
    $my_tab = 'actions';
    $my_additinal_class = '';
    ?>
                    <?php 
    if ($_REQUEST['tab'] == 'actions') {
        $slct_a = 'selected';
        $selected_title = $title;
        $selected_icon = $my_icon;
    } else {
        $slct_a = '';
    }
    ?>
<a class="nav-tab <?php 
    if ($slct_a == 'selected') {
        echo ' nav-tab-active ';
    }
    echo $my_additinal_class;
    ?>
" title="<?php 
    //echo __('Customization of booking form fields','wpdev-booking');
    ?>
"  href="#" onclick="javascript:jQuery('.visibility_container').hide(); jQuery('#<?php 
    echo $my_tab;
    ?>
').show();jQuery('.nav-tab').removeClass('nav-tab-active');jQuery(this).addClass('nav-tab-active');"><img class="menuicons" src="<?php 
    echo WPDEV_BK_PLUGIN_URL;
    ?>
/img/<?php 
    echo $my_icon;
    ?>
"><?php 
    if ($is_only_icons) {
        echo '&nbsp;';
    } else {
        echo $title;
    }
    ?>
</a>


                    <?php 
    $title = __('Help', 'wpdev-booking');
    $my_icon = 'system-help22x22.png';
    $my_tab = 'help';
    $my_additinal_class = ' nav-tab-right ';
    ?>


                    <?php 
    $version = 'free';
    $version = get_bk_version();
    if (wpdev_bk_is_this_demo()) {
        $version = 'free';
    }
    if (strpos(strtolower(WPDEV_BK_VERSION), 'multisite') !== false || $version == 'free') {
        $multiv = '-multi';
    } else {
        $multiv = '';
    }
    //$version = 'free';
    $upgrade_lnk = '';
    if ($version == 'personal') {
        $upgrade_lnk = "http://wpbookingcalendar.com/upgrade-p" . $multiv;
    }
    if ($version == 'biz_s') {
        $upgrade_lnk = "http://wpbookingcalendar.com/upgrade-s" . $multiv;
    }
    if ($version == 'biz_m') {
        $upgrade_lnk = "http://wpbookingcalendar.com/upgrade-m" . $multiv;
    }
    ?>
                    <span class="dropdown pull-right">
                        <a href="#" data-toggle="dropdown" class="dropdown-toggle nav-tab ">
                            <img class="menuicons" src="<?php 
    echo WPDEV_BK_PLUGIN_URL;
    ?>
/img/<?php 
    echo $my_icon;
    ?>
">
                            <?php 
    echo $title;
    ?>
 <b class="caret" style="border-top-color: #333333 !important;"></b></a>
                      <ul class="dropdown-menu" id="menu1" style="right:0px; left:auto;">
                        <li><a href="http://wpbookingcalendar.com/help/" target="_blank"><?php 
    _e('Help', 'wpdev-booking');
    ?>
</a></li>
                        <li><a href="http://wpbookingcalendar.com/faq/" target="_blank"><?php 
    _e('FAQ', 'wpdev-booking');
    ?>
</a></li>
                        <li><a href="http://wpbookingcalendar.com/support/" target="_blank"><?php 
    _e('Technical Support', 'wpdev-booking');
    ?>
</a></li>
                        <?php 
    if ($version == 'free') {
        ?>
                        <li class="divider"></li>
                        <li><a href="http://wpbookingcalendar.com/buy/" target="_blank"><?php 
        _e('Purchase', 'wpdev-booking');
        ?>
</a></li>
                        <?php 
    } else {
        if ($version != 'biz_l') {
            ?>
                        <li class="divider"></li>
                        <li><a href="<?php 
            echo $upgrade_lnk;
            ?>
" target="_blank"><?php 
            _e('Upgrade', 'wpdev-booking');
            ?>
</a></li>
                        <?php 
        }
    }
    ?>
                      </ul>
                    </span>
                    

                </div>
            </div>
        </div>
        <?php 
}
function wpdev_bk_settings_general()
{
    $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, 'only_super_admin');
    if ($is_can === false) {
        return;
    }
    if (isset($_POST['start_day_weeek'])) {
        $booking_skin = $_POST['booking_skin'];
        $email_reservation_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_reservation_adress']));
        $email_reservation_adress = str_replace("\\'", "'", $email_reservation_adress);
        $bookings_num_per_page = $_POST['bookings_num_per_page'];
        $booking_sort_order = $_POST['booking_sort_order'];
        $booking_default_toolbar_tab = $_POST['booking_default_toolbar_tab'];
        $bookings_listing_default_view_mode = $_POST['bookings_listing_default_view_mode'];
        $booking_view_days_num = $_POST['booking_view_days_num'];
        //$booking_sort_order_direction = $_POST['booking_sort_order_direction'];
        $max_monthes_in_calendar = $_POST['max_monthes_in_calendar'];
        if (isset($_POST['admin_cal_count'])) {
            $admin_cal_count = $_POST['admin_cal_count'];
        }
        if (isset($_POST['client_cal_count'])) {
            $client_cal_count = $_POST['client_cal_count'];
        }
        $start_day_weeek = $_POST['start_day_weeek'];
        $new_booking_title = $_POST['new_booking_title'];
        $new_booking_title_time = $_POST['new_booking_title_time'];
        $type_of_thank_you_message = $_POST['type_of_thank_you_message'];
        //get_bk_option( 'booking_type_of_thank_you_message' ); //= 'message'; = 'page';
        $thank_you_page_URL = wpbc_make_link_relative($_POST['thank_you_page_URL']);
        //get_bk_option( 'booking_thank_you_page_URL' ); //= 'message'; = 'page';
        $booking_date_format = $_POST['booking_date_format'];
        $booking_date_view_type = $_POST['booking_date_view_type'];
        //$is_dif_colors_approval_pending = $_POST['is_dif_colors_approval_pending'];
        if (isset($_POST['is_use_hints_at_admin_panel'])) {
            $is_use_hints_at_admin_panel = $_POST['is_use_hints_at_admin_panel'];
        }
        $type_of_day_selections = $_POST['type_of_day_selections'];
        if (isset($_POST['is_delete_if_deactive'])) {
            $is_delete_if_deactive = $_POST['is_delete_if_deactive'];
        }
        // check
        if (isset($_POST['wpdev_copyright_adminpanel'])) {
            $wpdev_copyright_adminpanel = $_POST['wpdev_copyright_adminpanel'];
        }
        // check
        if (isset($_POST['booking_is_show_powered_by_notice'])) {
            $booking_is_show_powered_by_notice = $_POST['booking_is_show_powered_by_notice'];
        }
        // check
        if (isset($_POST['is_use_captcha'])) {
            $is_use_captcha = $_POST['is_use_captcha'];
        }
        // check
        if (isset($_POST['is_use_autofill_4_logged_user'])) {
            $is_use_autofill_4_logged_user = $_POST['is_use_autofill_4_logged_user'];
        }
        // check
        if (isset($_POST['unavailable_day0'])) {
            $unavailable_day0 = $_POST['unavailable_day0'];
        }
        if (isset($_POST['unavailable_day1'])) {
            $unavailable_day1 = $_POST['unavailable_day1'];
        }
        if (isset($_POST['unavailable_day2'])) {
            $unavailable_day2 = $_POST['unavailable_day2'];
        }
        if (isset($_POST['unavailable_day3'])) {
            $unavailable_day3 = $_POST['unavailable_day3'];
        }
        if (isset($_POST['unavailable_day4'])) {
            $unavailable_day4 = $_POST['unavailable_day4'];
        }
        if (isset($_POST['unavailable_day5'])) {
            $unavailable_day5 = $_POST['unavailable_day5'];
        }
        if (isset($_POST['unavailable_day6'])) {
            $unavailable_day6 = $_POST['unavailable_day6'];
        }
        $user_role_booking = $_POST['user_role_booking'];
        $user_role_addbooking = $_POST['user_role_addbooking'];
        $booking_user_role_settings = $_POST['user_role_settings'];
        if (isset($_POST['user_role_resources'])) {
            $user_role_resources = $_POST['user_role_resources'];
        }
        if (wpdev_bk_is_this_demo()) {
            $user_role_booking = 'subscriber';
            $user_role_addbooking = 'subscriber';
            $booking_user_role_settings = 'subscriber';
            $user_role_resources = 'subscriber';
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        update_bk_option('booking_user_role_booking', $user_role_booking);
        update_bk_option('booking_user_role_addbooking', $user_role_addbooking);
        if (isset($user_role_resources)) {
            update_bk_option('booking_user_role_resources', $user_role_resources);
        }
        update_bk_option('booking_user_role_settings', $booking_user_role_settings);
        update_bk_option('bookings_num_per_page', $bookings_num_per_page);
        update_bk_option('booking_sort_order', $booking_sort_order);
        update_bk_option('booking_default_toolbar_tab', $booking_default_toolbar_tab);
        update_bk_option('bookings_listing_default_view_mode', $bookings_listing_default_view_mode);
        update_bk_option('booking_view_days_num', $booking_view_days_num);
        //update_bk_option( 'booking_sort_order_direction',$booking_sort_order_direction);
        update_bk_option('booking_skin', $booking_skin);
        update_bk_option('booking_email_reservation_adress', $email_reservation_adress);
        if (get_bk_version() == 'free') {
            // Update admin from adresses at free version
            //update_bk_option( 'booking_email_reservation_from_adress', $email_reservation_adress );
            update_bk_option('booking_email_approval_adress', $email_reservation_adress);
            update_bk_option('booking_email_deny_adress', $email_reservation_adress);
        }
        update_bk_option('booking_max_monthes_in_calendar', $max_monthes_in_calendar);
        if (!isset($admin_cal_count)) {
            $admin_cal_count = 2;
        }
        if (!isset($client_cal_count)) {
            $client_cal_count = 1;
        }
        if (1 * $admin_cal_count > 12) {
            $admin_cal_count = 12;
        }
        if (1 * $admin_cal_count < 1) {
            $admin_cal_count = 1;
        }
        update_bk_option('booking_admin_cal_count', $admin_cal_count);
        if (1 * $client_cal_count > 12) {
            $client_cal_count = 12;
        }
        if (1 * $client_cal_count < 1) {
            $client_cal_count = 1;
        }
        update_bk_option('booking_client_cal_count', $client_cal_count);
        update_bk_option('booking_start_day_weeek', $start_day_weeek);
        update_bk_option('booking_title_after_reservation', $new_booking_title);
        update_bk_option('booking_title_after_reservation_time', $new_booking_title_time);
        update_bk_option('booking_type_of_thank_you_message', $type_of_thank_you_message);
        update_bk_option('booking_thank_you_page_URL', $thank_you_page_URL);
        update_bk_option('booking_date_format', $booking_date_format);
        update_bk_option('booking_date_view_type', $booking_date_view_type);
        // if (isset( $is_dif_colors_approval_pending ))   $is_dif_colors_approval_pending = 'On';
        // else                                            $is_dif_colors_approval_pending = 'Off';
        // update_bk_option( 'booking_dif_colors_approval_pending' , $is_dif_colors_approval_pending );
        if (isset($is_use_hints_at_admin_panel)) {
            $is_use_hints_at_admin_panel = 'On';
        } else {
            $is_use_hints_at_admin_panel = 'Off';
        }
        update_bk_option('booking_is_use_hints_at_admin_panel', $is_use_hints_at_admin_panel);
        if (!wpdev_bk_is_this_demo()) {
            // Do not allow to chnage it in  the demo
            if (isset($_POST['is_not_load_bs_script_in_client'])) {
                $is_not_load_bs_script_in_client = 'On';
            } else {
                $is_not_load_bs_script_in_client = 'Off';
            }
            update_bk_option('booking_is_not_load_bs_script_in_client', $is_not_load_bs_script_in_client);
            if (isset($_POST['is_not_load_bs_script_in_admin'])) {
                $is_not_load_bs_script_in_admin = 'On';
            } else {
                $is_not_load_bs_script_in_admin = 'Off';
            }
            update_bk_option('booking_is_not_load_bs_script_in_admin', $is_not_load_bs_script_in_admin);
        }
        update_bk_option('booking_type_of_day_selections', $type_of_day_selections);
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        $unavailable_days_num_from_today = $_POST['unavailable_days_num_from_today'];
        update_bk_option('booking_unavailable_days_num_from_today', $unavailable_days_num_from_today);
        if (isset($unavailable_day0)) {
            $unavailable_day0 = 'On';
        } else {
            $unavailable_day0 = 'Off';
        }
        update_bk_option('booking_unavailable_day0', $unavailable_day0);
        if (isset($unavailable_day1)) {
            $unavailable_day1 = 'On';
        } else {
            $unavailable_day1 = 'Off';
        }
        update_bk_option('booking_unavailable_day1', $unavailable_day1);
        if (isset($unavailable_day2)) {
            $unavailable_day2 = 'On';
        } else {
            $unavailable_day2 = 'Off';
        }
        update_bk_option('booking_unavailable_day2', $unavailable_day2);
        if (isset($unavailable_day3)) {
            $unavailable_day3 = 'On';
        } else {
            $unavailable_day3 = 'Off';
        }
        update_bk_option('booking_unavailable_day3', $unavailable_day3);
        if (isset($unavailable_day4)) {
            $unavailable_day4 = 'On';
        } else {
            $unavailable_day4 = 'Off';
        }
        update_bk_option('booking_unavailable_day4', $unavailable_day4);
        if (isset($unavailable_day5)) {
            $unavailable_day5 = 'On';
        } else {
            $unavailable_day5 = 'Off';
        }
        update_bk_option('booking_unavailable_day5', $unavailable_day5);
        if (isset($unavailable_day6)) {
            $unavailable_day6 = 'On';
        } else {
            $unavailable_day6 = 'Off';
        }
        update_bk_option('booking_unavailable_day6', $unavailable_day6);
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if (isset($is_delete_if_deactive)) {
            $is_delete_if_deactive = 'On';
        } else {
            $is_delete_if_deactive = 'Off';
        }
        update_bk_option('booking_is_delete_if_deactive', $is_delete_if_deactive);
        if (isset($booking_is_show_powered_by_notice)) {
            $booking_is_show_powered_by_notice = 'On';
        } else {
            $booking_is_show_powered_by_notice = 'Off';
        }
        update_bk_option('booking_is_show_powered_by_notice', $booking_is_show_powered_by_notice);
        if (isset($wpdev_copyright_adminpanel)) {
            $wpdev_copyright_adminpanel = 'On';
        } else {
            $wpdev_copyright_adminpanel = 'Off';
        }
        update_bk_option('booking_wpdev_copyright_adminpanel', $wpdev_copyright_adminpanel);
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        if (isset($is_use_captcha)) {
            $is_use_captcha = 'On';
        } else {
            $is_use_captcha = 'Off';
        }
        update_bk_option('booking_is_use_captcha', $is_use_captcha);
        if (isset($is_use_autofill_4_logged_user)) {
            $is_use_autofill_4_logged_user = '******';
        } else {
            $is_use_autofill_4_logged_user = '******';
        }
        update_bk_option('booking_is_use_autofill_4_logged_user', $is_use_autofill_4_logged_user);
        //if (isset( $is_show_legend ))                  $is_show_legend = 'On';
        //else                                           $is_show_legend = 'Off';
        //update_bk_option( 'booking_is_show_legend' , $is_show_legend );
    } else {
        $booking_skin = get_bk_option('booking_skin');
        $email_reservation_adress = get_bk_option('booking_email_reservation_adress');
        $max_monthes_in_calendar = get_bk_option('booking_max_monthes_in_calendar');
        $bookings_num_per_page = get_bk_option('bookings_num_per_page');
        $booking_sort_order = get_bk_option('booking_sort_order');
        $booking_default_toolbar_tab = get_bk_option('booking_default_toolbar_tab');
        $bookings_listing_default_view_mode = get_bk_option('bookings_listing_default_view_mode');
        $booking_view_days_num = get_bk_option('booking_view_days_num');
        //$booking_sort_order_direction = get_bk_option( 'booking_sort_order_direction');
        $admin_cal_count = get_bk_option('booking_admin_cal_count');
        $new_booking_title = get_bk_option('booking_title_after_reservation');
        $new_booking_title_time = get_bk_option('booking_title_after_reservation_time');
        $type_of_thank_you_message = get_bk_option('booking_type_of_thank_you_message');
        //= 'message'; = 'page';
        $thank_you_page_URL = get_bk_option('booking_thank_you_page_URL');
        //= 'message'; = 'page';
        $booking_date_format = get_bk_option('booking_date_format');
        $booking_date_view_type = get_bk_option('booking_date_view_type');
        $client_cal_count = get_bk_option('booking_client_cal_count');
        $start_day_weeek = get_bk_option('booking_start_day_weeek');
        $is_use_hints_at_admin_panel = get_bk_option('booking_is_use_hints_at_admin_panel');
        $is_not_load_bs_script_in_client = get_bk_option('booking_is_not_load_bs_script_in_client');
        $is_not_load_bs_script_in_admin = get_bk_option('booking_is_not_load_bs_script_in_admin');
        $type_of_day_selections = get_bk_option('booking_type_of_day_selections');
        $is_delete_if_deactive = get_bk_option('booking_is_delete_if_deactive');
        // check
        $wpdev_copyright_adminpanel = get_bk_option('booking_wpdev_copyright_adminpanel');
        // check
        $booking_is_show_powered_by_notice = get_bk_option('booking_is_show_powered_by_notice');
        // check
        $is_use_captcha = get_bk_option('booking_is_use_captcha');
        // check
        $is_use_autofill_4_logged_user = get_bk_option('booking_is_use_autofill_4_logged_user');
        // check
        $unavailable_days_num_from_today = get_bk_option('booking_unavailable_days_num_from_today');
        $unavailable_day0 = get_bk_option('booking_unavailable_day0');
        $unavailable_day1 = get_bk_option('booking_unavailable_day1');
        $unavailable_day2 = get_bk_option('booking_unavailable_day2');
        $unavailable_day3 = get_bk_option('booking_unavailable_day3');
        $unavailable_day4 = get_bk_option('booking_unavailable_day4');
        $unavailable_day5 = get_bk_option('booking_unavailable_day5');
        $unavailable_day6 = get_bk_option('booking_unavailable_day6');
        $user_role_booking = get_bk_option('booking_user_role_booking');
        $user_role_addbooking = get_bk_option('booking_user_role_addbooking');
        $user_role_resources = get_bk_option('booking_user_role_resources');
        $booking_user_role_settings = get_bk_option('booking_user_role_settings');
    }
    if (empty($type_of_thank_you_message)) {
        $type_of_thank_you_message = 'message';
    }
    ?>
        <div  class="clear" style="height:10px;"></div>
        <div class="wpdevbk-not-now">
        <form  name="post_option" action="" method="post" id="post_option" class="form-horizontal">

            <div class="booking_settings_row"  style="width:64%; float:left;margin-right:1%;">

                <div class='meta-box'>
                    <div <?php 
    $my_close_open_win_id = 'bk_general_settings_main';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('Main', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                            <table class="form-table"><tbody>

                            <?php 
    // make_bk_action('wpdev_bk_general_settings_a');
    ?>


                            <tr valign="top">
                                <th scope="row"><label for="email_reservation_adress" ><?php 
    _e('Admin email', 'wpdev-booking');
    ?>
:</label></th>
                                <td><input id="email_reservation_adress"  name="email_reservation_adress" class="large-text" type="text" value="<?php 
    echo $email_reservation_adress;
    ?>
" />
                                    <p class="description"><?php 
    printf(__('Type default %sadmin email%s for booking confirmation', 'wpdev-booking'), '<b>', '</b>');
    ?>
</p>
                                </td>
                            </tr>

                            <?php 
    make_bk_action('wpdev_bk_general_settings_edit_booking_url');
    ?>

                            <?php 
    do_action('settings_advanced_set_update_hash_after_approve');
    ?>

                            <tr valign="top">
                                <th scope="row">
                                    <?php 
    _e('Show / hide hints', 'wpdev-booking');
    ?>
:
                                </th>
                                <td>
                                    <fieldset>
                                        <label for="is_use_hints_at_admin_panel" >
                                            <input id="is_use_hints_at_admin_panel" type="checkbox" <?php 
    if ($is_use_hints_at_admin_panel == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_use_hints_at_admin_panel;
    ?>
" name="is_use_hints_at_admin_panel"/>
                                            <?php 
    _e('Check this box if you want to show help hints on the admin panel.', 'wpdev-booking');
    ?>
                                        </label>
                                    </fieldset>
                                </td>
                            </tr>

                            <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr>

                            <tr valign="top"> <td colspan="2">
                                <div style="width:100%;">
                                    <span style="color:#21759B;cursor: pointer;font-weight: bold;"
                                       onclick="javascript: jQuery('#togle_settings_javascriptloading').slideToggle('normal');jQuery('.bk_show_advanced_settings_js').toggle('normal');"
                                       style="text-decoration: none;font-weight: bold;font-size: 11px;">
                                         <span class="bk_show_advanced_settings_js">+ <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Show advanced settings of JavaScript loading', 'wpdev-booking');
    ?>
</span></span>
                                         <span class="bk_show_advanced_settings_js" style="display:none;">- <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Hide advanced settings of JavaScript loading', 'wpdev-booking');
    ?>
</span></span>

                                    </span>
                                </div>


                                <table id="togle_settings_javascriptloading" style="display:none;" class="hided_settings_table">

                                <tr valign="top">
                                    <th scope="row">
                                        <?php 
    _e('Disable Bootstrap loading on Front-End', 'wpdev-booking');
    ?>
:
                                    </th>
                                    <td>
                                        <fieldset>
                                            <label for="is_not_load_bs_script_in_client" >
                                                <input id="is_not_load_bs_script_in_client" type="checkbox" <?php 
    if ($is_not_load_bs_script_in_client == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_not_load_bs_script_in_client;
    ?>
" name="is_not_load_bs_script_in_client"
                                                                                                    onclick="javascript: if (this.checked) { var answer = confirm('<?php 
    _e('Warning', 'wpdev-booking');
    echo '! ';
    _e("You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?", 'wpdev-booking');
    ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"
                                                       />
                                                <?php 
    _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can disable  loading of this script by this plugin.', 'wpdev-booking');
    ?>
                                                                                                                
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <th scope="row">
                                        <?php 
    _e('Disable Bootstrap loading on Back-End', 'wpdev-booking');
    ?>
:
                                    </th>
                                    <td>
                                        <fieldset>
                                            <label for="is_not_load_bs_script_in_admin" >
                                                <input id="is_not_load_bs_script_in_admin" type="checkbox" <?php 
    if ($is_not_load_bs_script_in_admin == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_not_load_bs_script_in_admin;
    ?>
" name="is_not_load_bs_script_in_admin"
                                                onclick="javascript: if (this.checked) { var answer = confirm('<?php 
    _e('Warning', 'wpdev-booking');
    echo '! ';
    _e("You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?", 'wpdev-booking');
    ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"
                                                   />
                                                <?php 
    _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can disable  loading of this script by this plugin.', 'wpdev-booking');
    ?>
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>

                                </table>
                                </td>
                            </tr>




                            <tr valign="top"> <td colspan="2">
                                <div style="width:100%;">
                                    <span style="color:#21759B;cursor: pointer;font-weight: bold;"
                                       onclick="javascript: jQuery('.bk_show_advanced_settings_powered').toggle('normal'); jQuery('#togle_settings_powered').slideToggle('normal');"
                                       style="text-decoration: none;font-weight: bold;font-size: 11px;">
                                         <span class="bk_show_advanced_settings_powered">+ <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Show settings of powered by notice', 'wpdev-booking');
    ?>
</span></span>
                                         <span class="bk_show_advanced_settings_powered" style="display:none;">- <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Hide settings of powered by notice', 'wpdev-booking');
    ?>
</span></span>
                                    </span>
                                </div>

                                <table id="togle_settings_powered" style="display:none;" class="hided_settings_table">

                                        <tr valign="top">
                                            <th scope="row">
                                                <?php 
    _e('Powered by notice', 'wpdev-booking');
    ?>
:</th>
                                            <td>
                                                <fieldset>
                                                    <label for="booking_is_show_powered_by_notice" >
                                                        <input id="booking_is_show_powered_by_notice" type="checkbox" <?php 
    if ($booking_is_show_powered_by_notice == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $booking_is_show_powered_by_notice;
    ?>
" name="booking_is_show_powered_by_notice"/>
                                                        <?php 
    printf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.', 'wpdev-booking'), 'wpbookingcalendar.com');
    ?>
                                                    </label>
                                                </fieldset>

                                            </td>
                                        </tr>


                                        <tr valign="top">
                                            <th scope="row">
                                                <?php 
    _e('Copyright notice', 'wpdev-booking');
    ?>
:
                                            </th>
                                            <td>
                                                <fieldset>
                                                    <label for="wpdev_copyright_adminpanel" >
                                                        <input id="wpdev_copyright_adminpanel" type="checkbox" <?php 
    if ($wpdev_copyright_adminpanel == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $wpdev_copyright_adminpanel;
    ?>
" name="wpdev_copyright_adminpanel"/>
                                                        <?php 
    printf(__(' Turn On/Off version notice at footer of booking admin panel.', 'wpdev-booking'), 'wpbookingcalendar.com');
    ?>
                                                    </label>
                                                </fieldset>

                                            </td>
                                        </tr>

                                </table>
                            </td></tr>



                    </tbody></table>
        </div></div></div>

        <div class='meta-box'>
            <div <?php 
    $my_close_open_win_id = 'bk_general_settings_calendar';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                <h3 class='hndle'><span><?php 
    _e('Calendar', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                    <table class="form-table"><tbody>

                            <tr valign="top">
                                <th scope="row"><label for="booking_skin" ><?php 
    _e('Calendar Skin', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                        <?php 
    $dir_list = wpdev_bk_dir_list(array('/css/skins/', '/inc/skins/'));
    ?>
                                    <select id="booking_skin" name="booking_skin" style="text-transform:capitalize;">
                                        <?php 
    foreach ($dir_list as $value) {
        if ($booking_skin == $value[1]) {
            $selected_item = 'selected="SELECTED"';
        } else {
            $selected_item = '';
        }
        if (strpos(str_replace(WPDEV_BK_PLUGIN_URL, '', $booking_skin), $value[0]) !== false) {
            $selected_item = 'selected="SELECTED"';
        }
        echo '<option ' . $selected_item . ' value="' . $value[1] . '" >' . $value[2] . '</option>';
    }
    ?>
                                    </select>
                                    <span class="description"><?php 
    _e('Select the skin of the booking calendar', 'wpdev-booking');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row"><label for="max_monthes_in_calendar" ><?php 
    _e('Number of months', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="max_monthes_in_calendar" name="max_monthes_in_calendar">
                                        <?php 
    for ($mm = 1; $mm < 12; $mm++) {
        ?>
                                            <option <?php 
        if ($max_monthes_in_calendar == $mm . 'm') {
            echo "selected";
        }
        ?>
 value="<?php 
        echo $mm;
        ?>
m"><?php 
        echo $mm, ' ';
        _e('month(s)', 'wpdev-booking');
        ?>
</option>
                                        <?php 
    }
    ?>

                                        <?php 
    for ($mm = 1; $mm < 11; $mm++) {
        ?>
                                            <option <?php 
        if ($max_monthes_in_calendar == $mm . 'y') {
            echo "selected";
        }
        ?>
 value="<?php 
        echo $mm;
        ?>
y"><?php 
        echo $mm, ' ';
        _e('year(s)', 'wpdev-booking');
        ?>
</option>
                                        <?php 
    }
    ?>
                                    </select>
                                    <span class="description"><?php 
    _e('Select the maximum number of months to show (scroll)', 'wpdev-booking');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row"><label for="start_day_weeek" ><?php 
    _e('Start Day of the week', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="start_day_weeek" name="start_day_weeek">
                                        <option <?php 
    if ($start_day_weeek == '0') {
        echo "selected";
    }
    ?>
 value="0"><?php 
    _e('Sunday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '1') {
        echo "selected";
    }
    ?>
 value="1"><?php 
    _e('Monday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '2') {
        echo "selected";
    }
    ?>
 value="2"><?php 
    _e('Tuesday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '3') {
        echo "selected";
    }
    ?>
 value="3"><?php 
    _e('Wednesday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '4') {
        echo "selected";
    }
    ?>
 value="4"><?php 
    _e('Thursday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '5') {
        echo "selected";
    }
    ?>
 value="5"><?php 
    _e('Friday', 'wpdev-booking');
    ?>
</option>
                                        <option <?php 
    if ($start_day_weeek == '6') {
        echo "selected";
    }
    ?>
 value="6"><?php 
    _e('Saturday', 'wpdev-booking');
    ?>
</option>
                                    </select>
                                    <span class="description"><?php 
    _e('Select your start day of the week', 'wpdev-booking');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top"><td colspan="2" style="padding:10px 0px; "><div style="border-bottom:1px solid #cccccc;"></div></td></tr>

                            <tr valign="top">
                                <th scope="row"><label for="unavailable_days_num_from_today" ><?php 
    _e('Unavailable days from today', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="unavailable_days_num_from_today" name="unavailable_days_num_from_today">
                                        <?php 
    for ($i = 0; $i < 32; $i++) {
        ?>
                                        <option <?php 
        if ($unavailable_days_num_from_today == $i) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo $i;
        ?>
"><?php 
        echo $i;
        ?>
</option>
                                        <?php 
    }
    ?>
                                    </select>
                                    <span class="description"><?php 
    _e('Select number of unavailable days in calendar start from today.', 'wpdev-booking');
    ?>
</span>
                                </td>
                            </tr>


                            <tr valign="top">
                                <th scope="row"><?php 
    _e('Unavailable week days', 'wpdev-booking');
    ?>
:</th>
                                <td>    
                                    <label for="unavailable_day0" class="wpbc-single-checkbox">
                                        <input id="unavailable_day0" name="unavailable_day0" <?php 
    if ($unavailable_day0 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day0;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Sunday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day1" class="wpbc-single-checkbox">
                                        <input id="unavailable_day1" name="unavailable_day1" <?php 
    if ($unavailable_day1 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day1;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Monday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day2" class="wpbc-single-checkbox">
                                        <input id="unavailable_day2" name="unavailable_day2" <?php 
    if ($unavailable_day2 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day2;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Tuesday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day3" class="wpbc-single-checkbox">
                                        <input id="unavailable_day3" name="unavailable_day3" <?php 
    if ($unavailable_day3 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day3;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Wednesday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day4" class="wpbc-single-checkbox">
                                        <input id="unavailable_day4" name="unavailable_day4" <?php 
    if ($unavailable_day4 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day4;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Thursday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day5" class="wpbc-single-checkbox">
                                        <input id="unavailable_day5" name="unavailable_day5" <?php 
    if ($unavailable_day5 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day5;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Friday', 'wpdev-booking');
    ?>
                                    </label>
                                    <label for="unavailable_day6" class="wpbc-single-checkbox">
                                        <input id="unavailable_day6" name="unavailable_day6" <?php 
    if ($unavailable_day6 == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $unavailable_day6;
    ?>
"  type="checkbox" />
                                        <?php 
    _e('Saturday', 'wpdev-booking');
    ?>
                                    </label>
                                    <p class="description"><?php 
    _e('Check unavailable days in calendars. This option will overwrite all other settings.', 'wpdev-booking');
    ?>
</p>
                                </td>
                            </tr>

                            <tr valign="top"><td colspan="2" style="padding:10px 0px; "><div style="border-bottom:1px solid #cccccc;"></div></td></tr>

                            <tr valign="top">
                                <th scope="row"><?php 
    _e('Type of days selection in calendar', 'wpdev-booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <legend class="screen-reader-text"><span><?php 
    _e('Type of days selection', 'wpdev-booking');
    ?>
</span></legend>
                                        <label for="type_of_day_selections_single">
                                            <input  value="single" <?php 
    if ($type_of_day_selections == 'single' || empty($type_of_day_selections)) {
        echo 'checked="CHECKED"';
    }
    ?>
                                                onclick="javascript: jQuery('#togle_settings_range_type_selection').slideUp('normal');
                                                    jQuery('.booking_time_advanced_config').slideUp('normal');
                                                    if ( jQuery('#range_selection_time_is_active').length > 0 ) { jQuery('#range_selection_time_is_active').attr('checked', false); }
                                                    if ( jQuery('#booking_recurrent_time').length > 0 )         { jQuery('#booking_recurrent_time').attr('checked', false); }
                                                    if ( jQuery('#togle_settings_range_times').length > 0 )     { jQuery('#togle_settings_range_times').slideUp('normal'); }
                                                    if ( jQuery('#togle_settings_availble_for_cehck_in_out').length > 0 )     { jQuery('#togle_settings_availble_for_cehck_in_out').slideUp('normal'); }

                                                        "
                                                name="type_of_day_selections" id="type_of_day_selections_single" type="radio" 
                                                 />
                                            <span><?php 
    _e('Single day', 'wpdev-booking');
    ?>
</span>
                                        </label><br />

                                        <label for="type_of_day_selections_multiple">
                                            <input  value="multiple" <?php 
    if ($type_of_day_selections == 'multiple') {
        echo 'checked="CHECKED"';
    }
    ?>
 
                                                onclick="javascript: jQuery('#togle_settings_range_type_selection').slideUp('normal');
                                                    jQuery('.booking_time_advanced_config').slideDown('normal');
                                                    "
                                                name="type_of_day_selections" id="type_of_day_selections_multiple"  type="radio" 
                                                 />
                                            <span><?php 
    _e('Multiple days', 'wpdev-booking');
    ?>
</span>
                                        </label><br />

                                        <?php 
    if (class_exists('wpdev_bk_biz_s')) {
        ?>
                                        <label for="type_of_day_selections_range">
                                            <input  value="range" <?php 
        if ($type_of_day_selections == 'range') {
            echo 'checked="CHECKED"';
        }
        ?>
                                                onclick="javascript: jQuery('#togle_settings_range_type_selection').slideDown('normal');
                                                    jQuery('.booking_time_advanced_config').slideDown('normal'); 
                                                    "
                                                name="type_of_day_selections" id="type_of_day_selections_range"  type="radio" 
                                                 />
                                            <span><?php 
        _e('Range days', 'wpdev-booking');
        ?>
</span>
                                        </label>
                                        <?php 
    }
    ?>

                                    </fieldset>
                                </td>
                            </tr>

                            <?php 
    do_action('settings_advanced_set_range_selections');
    ?>
                            <?php 
    do_action('settings_advanced_set_fixed_time');
    ?>

                            <tr valign="top" class="booking_time_advanced_config"  style="<?php 
    if (get_bk_option('booking_type_of_day_selections') == 'single') {
        echo 'display:none;';
    }
    ?>
"> 
                                <td colspan="2" style="padding:0px 0px 10px; "><div style="border-bottom:1px solid #cccccc;"></div>
                                </td>
                            </tr>                                        
                            <?php 
    do_action('settings_set_show_cost_in_tooltips');
    ?>
                            <?php 
    do_action('settings_set_show_availability_in_tooltips');
    ?>
                            <?php 
    do_action('settings_set_show_time_in_tooltips');
    ?>


                        </tbody></table>
                </div></div></div>

                <div class='meta-box'>
                    <div <?php 
    $my_close_open_win_id = 'bk_general_settings_form';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('Form', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                            
                            <table class="form-table"><tbody>
                                <?php 
    // Is using the BootStrap CSS //////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        if (isset($_POST['booking_form_is_using_bs_css'])) {
            $booking_form_is_using_bs_css = 'On';
        } else {
            $booking_form_is_using_bs_css = 'Off';
        }
        update_bk_option('booking_form_is_using_bs_css', $booking_form_is_using_bs_css);
    }
    $booking_form_is_using_bs_css = get_bk_option('booking_form_is_using_bs_css');
    ?>
 
                                <tr valign="top">
                                    <th scope="row"><?php 
    _e('CAPTCHA', 'wpdev-booking');
    ?>
:</th>
                                    <td><fieldset><label for="is_use_captcha">                                            
                                            <input id="is_use_captcha" type="checkbox" <?php 
    if ($is_use_captcha == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_use_captcha;
    ?>
" name="is_use_captcha"/>
                                            <?php 
    _e('Check the box to activate CAPTCHA inside the booking form.', 'wpdev-booking');
    ?>
                                        </label>
                                        </fieldset>
                                    </td>
                                </tr>

                                <tr valign="top">
                                    <th scope="row"><?php 
    _e('Auto-fill fields', 'wpdev-booking');
    ?>
:</th>
                                    <td><fieldset><label for="is_use_autofill_4_logged_user" >
                                            <input id="is_use_autofill_4_logged_user" type="checkbox" <?php 
    if ($is_use_autofill_4_logged_user == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_use_autofill_4_logged_user;
    ?>
" name="is_use_autofill_4_logged_user"/>
                                            <?php 
    _e('Check the box to activate auto-fill form fields for logged in users.', 'wpdev-booking');
    ?>
                                        </label>
                                        </fieldset>    
                                    </td>
                                </tr>

                                <tr valign="top">
                                    <th scope="row"><?php 
    _e('Use CSS BootStrap', 'wpdev-booking');
    ?>
:</th>
                                    <td><fieldset><label for="booking_form_is_using_bs_css">
                                            <input type="checkbox" name="booking_form_is_using_bs_css" id="booking_form_is_using_bs_css"
                                                <?php 
    if ($booking_form_is_using_bs_css == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                                value="<?php 
    echo $booking_form_is_using_bs_css;
    ?>
" >
                                            <?php 
    _e('Using BootStrap CSS for the form fields', 'wpdev-booking');
    ?>
                                         </label>
                                         </fieldset>   
                                         <p class="description"><strong><?php 
    _e('Note', 'wpdev-booking');
    ?>
:</strong> <?php 
    _e('You must not deactivate loading BootStrap files at main section of these settings!', 'wpdev-booking');
    ?>
</p>
                                    </td>
                                </tr>                                    


                                        <?php 
    wpdev_bk_settings_legend_section();
    /** ?>
    
                                            <tr valign="top">
                                                <th scope="row"><label for="is_show_legend" ><?php _e('Show legend', 'wpdev-booking'); ?>:</label><br><?php _e('at booking calendar', 'wpdev-booking'); ?></th>
                                                <td><input id="is_show_legend" type="checkbox" <?php if ($is_show_legend == 'On') echo "checked"; ?>  value="<?php echo $is_show_legend; ?>" name="is_show_legend"/>
                                                    <span class="description"> <?php _e('Check this box to display a legend of dates below the booking calendar.', 'wpdev-booking');?></span>
                                                </td>
                                            </tr><?php /**/
    ?>

                                <tr valign="top" style="padding: 0px;">
                                    <th scope="row"><?php 
    _e('Action after booking is done', 'wpdev-booking');
    ?>
:</th>
                                    <td>
                                        <fieldset>
                                        <label for="type_of_thank_you_message_message">
                                            <input  <?php 
    if ($type_of_thank_you_message == 'message') {
        echo 'checked="checked"';
    }
    /**/
    ?>
 
                                                value="message" type="radio" 
                                                id="type_of_thank_you_message_message"  name="type_of_thank_you_message"  
                                                onclick="javascript: jQuery('#togle_settings_thank-you_page').slideUp('normal');jQuery('#togle_settings_thank-you_message').slideDown('normal');"  />
                                            <span><?php 
    _e('Show "Thank You" message', 'wpdev-booking');
    ?>
</span>
                                        </label><br />
                                        <label for="type_of_thank_you_message_page">
                                            <input  <?php 
    if ($type_of_thank_you_message == 'page') {
        echo 'checked="checked"';
    }
    /**/
    ?>
 
                                                value="page" type="radio" 
                                                id="type_of_thank_you_message_page"  name="type_of_thank_you_message"  
                                                onclick="javascript: jQuery('#togle_settings_thank-you_page').slideDown('normal');jQuery('#togle_settings_thank-you_message').slideUp('normal');"  />
                                            <span><?php 
    _e('Redirect visitor to a new "Thank You" page', 'wpdev-booking');
    ?>
</span>
                                        </label>
                                        </fieldset>
                                        <?php 
    if (class_exists('wpdev_bk_biz_s')) {
        ?>
                                        <p class="description"><strong><?php 
        _e('Note', 'wpdev-booking');
        ?>
:</strong> <?php 
        _e('This action will have no effect, if the payment form(s) is active!', 'wpdev-booking');
        ?>
</p>
                                        <?php 
    }
    ?>
                                    </td>
                                </tr>
                                <tr valign="top" style="padding: 0px;"><td colspan="2"  style="padding:0px;">
                                    <div style="margin: -10px 0 10px 50px;">
                                        
                                    <table id="togle_settings_thank-you_message" style="width:100%;<?php 
    if ($type_of_thank_you_message != 'message') {
        echo 'display:none;';
    }
    /**/
    ?>
" class="hided_settings_table">
                                        <tr valign="top">
                                            <th><label for="new_booking_title"><?php 
    _e('Message title', 'wpdev-booking');
    ?>
:</label></th>
                                            <td>
                                                <input id="new_booking_title" class="large-text" type="text" value="<?php 
    echo $new_booking_title;
    ?>
" name="new_booking_title" />
                                                <p class="description"><?php 
    printf(__('Type title of message %safter booking has done by user%s', 'wpdev-booking'), '<b>', '</b>');
    ?>
</p>                                                
                                            </td>
                                        </tr>
                                        <tr><td colspan="2" style="padding:0px;"><div style="margin-top:-15px;"><?php 
    make_bk_action('show_additional_translation_shortcode_help');
    ?>
</div></td></tr>
                                        <tr>
                                            <th><label for="new_booking_title_time"><?php 
    _e('Time of message showing', 'wpdev-booking');
    ?>
:</label></th>
                                            <td>
                                                <input id="new_booking_title_time" class="small-text" type="text" size="45" value="<?php 
    echo $new_booking_title_time;
    ?>
" name="new_booking_title_time" />
                                                <p class="description"><?php 
    printf(__('Set duration of time (milliseconds) to show this message', 'wpdev-booking'), '<b>', '</b>');
    ?>
</p>
                                            </td>
                                        </tr>
                                    </table>

                                    <table id="togle_settings_thank-you_page" style="width:100%;<?php 
    if ($type_of_thank_you_message != 'page') {
        echo 'display:none;';
    }
    /**/
    ?>
" class="hided_settings_table">
                                        <tr valign="top">
                                        <th scope="row"><label for="thank_you_page_URL" ><?php 
    _e('URL of "thank you" page', 'wpdev-booking');
    ?>
:</label></th>
                                            <td>
                                                <fieldset>
                                                    <code style="font-size:14px;"><?php 
    echo get_option('siteurl');
    ?>
</code><input value="<?php 
    echo $thank_you_page_URL;
    ?>
" name="thank_you_page_URL" id="thank_you_page_URL" class="large-text" type="text" />
                                                </fieldset>
                                                <p class="description"><?php 
    printf(__('Type URL of %s"Thank You" page%s', 'wpdev-booking'), '<b>', '</b>');
    ?>
</p>
                                            </td>
                                        </tr>
                                    </table>

                                    </div>
                                </td></tr>
                                

                            </tbody></table>

                </div></div></div>

                <div class='meta-box'>
                    <div <?php 
    $my_close_open_win_id = 'bk_general_settings_bktable';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('Listing of bookings', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                            <table class="form-table"><tbody>
                                <tr valign="top">
                                    <th scope="row"><label for="bookings_listing_default_view_mode" ><?php 
    _e('Default booking admin page', 'wpdev-booking');
    ?>
:</label></th>
                                    <td>

                                        <?php 
    $wpdevbk_selectors = array(__('Bookings Listing', 'wpdev-booking') => 'vm_listing', __('Calendar Overview', 'wpdev-booking') => 'vm_calendar');
    ?>
                                        <select id="bookings_listing_default_view_mode" name="bookings_listing_default_view_mode">
                                        <?php 
    foreach ($wpdevbk_selectors as $kk => $mm) {
        ?>
                                            <option <?php 
        if ($bookings_listing_default_view_mode == strtolower($mm)) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo strtolower($mm);
        ?>
"><?php 
        echo $kk;
        ?>
</option>
                                        <?php 
    }
    ?>
                                        </select>
                                        <span class="description"><?php 
    _e('Select your default view mode of bookings at the booking listing page', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>

                                <?php 
    make_bk_action('wpdev_bk_general_settings_set_default_booking_resource');
    ?>
                                        
                                <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr>


                                <tr valign="top">
                                    <th scope="row"><label for="booking_view_days_num" ><?php 
    _e('Default calendar view mode', 'wpdev-booking');
    ?>
:</label></th>
                                    <td><?php 
    if (class_exists('wpdev_bk_personal')) {
        $wpdevbk_selectors = array(__('Day', 'wpdev-booking') => '1', __('Week', 'wpdev-booking') => '7', __('Month', 'wpdev-booking') => '30', __('2 Months', 'wpdev-booking') => '60', __('3 Months', 'wpdev-booking') => '90', __('Year', 'wpdev-booking') => '365');
    } else {
        $wpdevbk_selectors = array(__('Month', 'wpdev-booking') => '30', __('3 Months', 'wpdev-booking') => '90', __('Year', 'wpdev-booking') => '365');
    }
    ?>
                                        <select id="booking_view_days_num" name="booking_view_days_num" onfocus="javascript:wpdev_bk_recheck_disabled_options();">
                                        <?php 
    foreach ($wpdevbk_selectors as $kk => $mm) {
        ?>
                                            <option <?php 
        if ($booking_view_days_num == strtolower($mm)) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo strtolower($mm);
        ?>
"><?php 
        echo $kk;
        ?>
</option>
                                        <?php 
    }
    ?>
                                        </select>
                                        <script type="text/javascript">
                                            // Set the correct  value of this selectbox, depend from the Matrix or Single Calendar Overview 
                                            function wpdev_bk_recheck_disabled_options() {
                                                if ( jQuery('#default_booking_resource').length>0 ) {
                                                    jQuery('#default_booking_resource').bind('change', function() {
                                                        jQuery('#booking_view_days_num option:eq(2)').prop("selected", true);
                                                    });
                                                    if ( jQuery('#default_booking_resource').val() == '' ) { //All resources selected
                                                        jQuery('#booking_view_days_num option:eq(0)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(1)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(2)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(3)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(4)').prop("disabled", true);
                                                        jQuery('#booking_view_days_num option:eq(5)').prop("disabled", true);
                                                    } else {
                                                        jQuery('#booking_view_days_num option:eq(0)').prop("disabled", true);
                                                        jQuery('#booking_view_days_num option:eq(1)').prop("disabled", true);
                                                        jQuery('#booking_view_days_num option:eq(2)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(3)').prop("disabled", true);
                                                        jQuery('#booking_view_days_num option:eq(4)').prop("disabled", false);
                                                        jQuery('#booking_view_days_num option:eq(5)').prop("disabled", false);                                                                
                                                    }
                                                }
                                            }
                                        </script>                                                
                                        <span class="description"><?php 
    _e('Select your default calendar view mode at booking calendar overview page', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>

                                <?php 
    make_bk_action('wpdev_bk_general_settings_set_default_title_in_day');
    ?>

                                <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr>


                                <tr valign="top">
                                    <th scope="row"><label for="booking_default_toolbar_tab" ><?php 
    _e('Default toolbar tab', 'wpdev-booking');
    ?>
:</label></th>
                                    <td>
                                        <?php 
    $wpdevbk_selectors = array(__('Filter tab', 'wpdev-booking') => 'filter', __('Actions tab', 'wpdev-booking') => 'actions');
    ?>
                                        <select id="booking_default_toolbar_tab" name="booking_default_toolbar_tab">
                                        <?php 
    foreach ($wpdevbk_selectors as $kk => $mm) {
        ?>
                                            <option <?php 
        if ($booking_default_toolbar_tab == strtolower($mm)) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo strtolower($mm);
        ?>
"><?php 
        echo $kk;
        ?>
</option>
                                        <?php 
    }
    ?>
                                        </select>
                                        <span class="description"><?php 
    _e('Select your default opened tab in toolbar at booking listing page', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>
                                        
                                <tr valign="top">
                                    <th scope="row"><label for="bookings_num_per_page" ><?php 
    _e('Bookings number per page', 'wpdev-booking');
    ?>
:</label></th>
                                    <td>

                                        <?php 
    $order_array = array(5, 10, 20, 25, 50, 75, 100);
    ?>
                                        <select id="bookings_num_per_page" name="bookings_num_per_page">
                                        <?php 
    foreach ($order_array as $mm) {
        ?>
                                            <option <?php 
        if ($bookings_num_per_page == strtolower($mm)) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo strtolower($mm);
        ?>
"><?php 
        echo $mm;
        ?>
</option>
                                        <?php 
    }
    ?>
                                        </select>
                                        <span class="description"><?php 
    _e('Select number of bookings per page in booking listing', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>


                                <tr valign="top">
                                    <th scope="row"><label for="booking_sort_order" ><?php 
    _e('Bookings default order', 'wpdev-booking');
    ?>
:</label></th>
                                    <td><?php 
    $order_array = array('ID');
    $wpdevbk_selectors = array(__('ID', 'wpdev-booking') . '&nbsp;' . __('ASC', 'wpdev-booking') => '', __('ID', 'wpdev-booking') . '&nbsp;' . __('DESC', 'wpdev-booking') => 'booking_id_asc', __('Dates', 'wpdev-booking') . '&nbsp;' . __('ASC', 'wpdev-booking') => 'sort_date', __('Dates', 'wpdev-booking') . '&nbsp;' . __('DESC', 'wpdev-booking') => 'sort_date_asc');
    if (class_exists('wpdev_bk_personal')) {
        $order_array[] = 'Resource';
        $wpdevbk_selectors[__('Resource', 'wpdev-booking') . '&nbsp;' . __('ASC', 'wpdev-booking')] = 'booking_type';
        $wpdevbk_selectors[__('Resource', 'wpdev-booking') . '&nbsp;' . __('DESC', 'wpdev-booking')] = 'booking_type_asc';
    }
    if (class_exists('wpdev_bk_biz_s')) {
        $order_array[] = 'Cost';
        $wpdevbk_selectors[__('Cost', 'wpdev-booking') . '&nbsp;' . __('ASC', 'wpdev-booking')] = 'cost';
        $wpdevbk_selectors[__('Cost', 'wpdev-booking') . '&nbsp;' . __('DESC', 'wpdev-booking')] = 'cost_asc';
    }
    ?>
                                        <select id="booking_sort_order" name="booking_sort_order">
                                        <?php 
    foreach ($wpdevbk_selectors as $kk => $mm) {
        ?>
                                            <option <?php 
        if ($booking_sort_order == strtolower($mm)) {
            echo "selected";
        }
        ?>
 value="<?php 
        echo strtolower($mm);
        ?>
"><?php 
        echo $kk;
        ?>
</option>
                                        <?php 
    }
    ?>
                                        </select>
                                        <span class="description"><?php 
    _e('Select your default order of bookings in the booking listing', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>

                                <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr>
                                        
                                <tr valign="top">
                                    <th scope="row"><label for="booking_date_format" ><?php 
    _e('Date Format', 'wpdev-booking');
    ?>
:</label></th>
                                    <td>
                                    <fieldset>
                                        <?php 
    $date_formats = array(__('F j, Y'), 'Y/m/d', 'm/d/Y', 'd/m/Y');
    $custom = TRUE;
    foreach ($date_formats as $format) {
        echo "\t<label title='" . esc_attr($format) . "'>";
        echo "<input type='radio' name='booking_date_format' value='" . esc_attr($format) . "'";
        if (get_bk_option('booking_date_format') === $format) {
            echo " checked='checked'";
            $custom = FALSE;
        }
        echo ' /> ' . date_i18n($format) . "</label> &nbsp;&nbsp;&nbsp;\n";
    }
    echo '<div style="height:7px;"></div>';
    echo '<label><input type="radio" name="booking_date_format" id="date_format_custom_radio" value="' . $booking_date_format . '"';
    if ($custom) {
        echo ' checked="checked"';
    }
    echo '/> ' . __('Custom', 'wpdev-booking') . ': </label>';
    ?>
                                                                        <input id="booking_date_format_custom" class="regular-text" type="text" size="45" value="<?php 
    echo $booking_date_format;
    ?>
" name="booking_date_format_custom" style="line-height:35px;"
                                                                               onchange="javascript:document.getElementById('date_format_custom_radio').value = this.value;document.getElementById('date_format_custom_radio').checked=true;"
                                                                               />
                                        <?php 
    echo ' ' . date_i18n($booking_date_format) . "\n";
    echo '&nbsp;&nbsp;';
    ?>
                                        <p class="description"><?php 
    printf(__('Type your date format for emails and the booking table. %sDocumentation on date formatting%s', 'wpdev-booking'), '<a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">', '</a>');
    ?>
</p>
                                    </fieldset>
                                    </td>
                                </tr>

                                <?php 
    do_action('settings_advanced_set_time_format');
    ?>

                                <tr valign="top">
                                    <th scope="row"><label for="booking_date_view_type" ><?php 
    _e('Dates view', 'wpdev-booking');
    ?>
:</label></th>
                                    <td>
                                        <select id="booking_date_view_type" name="booking_date_view_type">
                                            <option <?php 
    if ($booking_date_view_type == 'short') {
        echo "selected";
    }
    ?>
 value="short"><?php 
    _e('Short days view', 'wpdev-booking');
    ?>
</option>
                                            <option <?php 
    if ($booking_date_view_type == 'wide') {
        echo "selected";
    }
    ?>
 value="wide"><?php 
    _e('Wide days view', 'wpdev-booking');
    ?>
</option>
                                        </select>
                                        <span class="description"><?php 
    _e('Select the default view for dates on the booking tables', 'wpdev-booking');
    ?>
</span>
                                    </td>
                                </tr>

                            </tbody></table>

                </div></div></div>

                <?php 
    make_bk_action('wpdev_bk_general_settings_cost_section');
    ?>

                <?php 
    make_bk_action('wpdev_bk_general_settings_pending_auto_cancelation');
    ?>

                <?php 
    do_action('wpdev_bk_general_settings_advanced_section');
    ?>

            </div>
            <div class="booking_settings_row" style="width:35%; float:left;">

                <?php 
    $version = get_bk_version();
    if (wpdev_bk_is_this_demo()) {
        $version = 'free';
    }
    //if ( ($version !== 'free') && ($version!== 'biz_l') ) { wpdev_bk_upgrade_window($version); }
    ?>

                <div class='meta-box'>
                        <div <?php 
    $my_close_open_win_id = 'bk_general_settings_info';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="gdrgrid postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('Information', 'wpdev-booking');
    ?>
</span></h3>
                        <div class="inside">
                            <?php 
    make_bk_action('dashboard_bk_widget_show');
    ?>
                        </div>
                        </div>
                </div>

                <?php 
    if (false && !class_exists('wpdev_crm') && $version != 'free') {
        ?>
                    <div class='meta-box'>
                        <div <?php 
        $my_close_open_win_id = 'bk_general_settings_recomended_plugins';
        ?>
  id="<?php 
        echo $my_close_open_win_id;
        ?>
" class="gdrgrid postbox <?php 
        if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
            echo 'closed';
        }
        ?>
" > <div title="<?php 
        _e('Click to toggle', 'wpdev-booking');
        ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
        echo get_bk_current_user_id();
        ?>
, '<?php 
        echo $my_close_open_win_id;
        ?>
');"><br></div>
                            <h3 class='hndle'><span><?php 
        _e('Recommended WordPress Plugins', 'wpdev-booking');
        ?>
</span></h3>
                            <div class="inside">
                                <h2 style="margin:10px;"><?php 
        _e('Booking Manager - show all old bookings');
        ?>
 </h2>
                                <img src="<?php 
        echo WPDEV_BK_PLUGIN_URL . '/img/users-48x48.png';
        ?>
" style="float:left; padding:0px 10px 10px 0px;">

                                <p style="margin:0px;">
                            <?php 
        printf(__('This wordpress plugin is  %sshow all approved and pending bookings from past%s. Show how many each customer is made bookings. Paid versions support %sexport to CSV, print layout, advanced filter%s. ', 'wpdev-booking'), '<strong>', '</strong>', '<strong>', '</strong>');
        ?>
 <br/>
                                </p>
                                <p style="text-align:center;padding:10px 0px;">
                                    <a href="http://wordpress.org/extend/plugins/booking-manager" class="button-primary" target="_blank">Download from wordpress</a>
                                    <a href="http://wpbookingmanager.com" class="button-primary" target="_blank">Demo site</a>
                                </p>
                            </div>
                        </div>
                    </div>
                <?php 
    }
    ?>


                <div class='meta-box'>
                    <div <?php 
    $my_close_open_win_id = 'bk_general_settings_users_permissions';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('User permissions for plugin menu pages', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                        <table class="form-table"><tbody>

                            <tr valign="top">
                                <th scope="row"><label for="user_role_booking" ><?php 
    _e('Bookings', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="user_role_booking" name="user_role_booking">
                                        <option <?php 
    if ($user_role_booking == 'subscriber') {
        echo "selected";
    }
    ?>
 value="subscriber" ><?php 
    echo translate_user_role('Subscriber');
    ?>
</option>
                                        <option <?php 
    if ($user_role_booking == 'administrator') {
        echo "selected";
    }
    ?>
 value="administrator" ><?php 
    echo translate_user_role('Administrator');
    ?>
</option>
                                        <option <?php 
    if ($user_role_booking == 'editor') {
        echo "selected";
    }
    ?>
 value="editor" ><?php 
    echo translate_user_role('Editor');
    ?>
</option>
                                        <option <?php 
    if ($user_role_booking == 'author') {
        echo "selected";
    }
    ?>
 value="author" ><?php 
    echo translate_user_role('Author');
    ?>
</option>
                                        <option <?php 
    if ($user_role_booking == 'contributor') {
        echo "selected";
    }
    ?>
 value="contributor" ><?php 
    echo translate_user_role('Contributor');
    ?>
</option>
                                    </select>                                                
                                </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row"><label for="user_role_addbooking" ><?php 
    _e('Add booking', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="user_role_addbooking" name="user_role_addbooking">
                                        <option <?php 
    if ($user_role_addbooking == 'subscriber') {
        echo "selected";
    }
    ?>
 value="subscriber" ><?php 
    echo translate_user_role('Subscriber');
    ?>
</option>
                                        <option <?php 
    if ($user_role_addbooking == 'administrator') {
        echo "selected";
    }
    ?>
 value="administrator" ><?php 
    echo translate_user_role('Administrator');
    ?>
</option>
                                        <option <?php 
    if ($user_role_addbooking == 'editor') {
        echo "selected";
    }
    ?>
 value="editor" ><?php 
    echo translate_user_role('Editor');
    ?>
</option>
                                        <option <?php 
    if ($user_role_addbooking == 'author') {
        echo "selected";
    }
    ?>
 value="author" ><?php 
    echo translate_user_role('Author');
    ?>
</option>
                                        <option <?php 
    if ($user_role_addbooking == 'contributor') {
        echo "selected";
    }
    ?>
 value="contributor" ><?php 
    echo translate_user_role('Contributor');
    ?>
</option>
                                    </select>
                                </td>
                            </tr>

                            <?php 
    if ($version !== 'free') {
        ?>
                                <tr valign="top">
                                    <th scope="row"><label for="user_role_resources" ><?php 
        _e('Resources', 'wpdev-booking');
        ?>
:</label></th>
                                    <td>
                                        <select id="user_role_resources" name="user_role_resources">
                                            <option <?php 
        if ($user_role_resources == 'subscriber') {
            echo "selected";
        }
        ?>
 value="subscriber" ><?php 
        echo translate_user_role('Subscriber');
        ?>
</option>
                                            <option <?php 
        if ($user_role_resources == 'administrator') {
            echo "selected";
        }
        ?>
 value="administrator" ><?php 
        echo translate_user_role('Administrator');
        ?>
</option>
                                            <option <?php 
        if ($user_role_resources == 'editor') {
            echo "selected";
        }
        ?>
 value="editor" ><?php 
        echo translate_user_role('Editor');
        ?>
</option>
                                            <option <?php 
        if ($user_role_resources == 'author') {
            echo "selected";
        }
        ?>
 value="author" ><?php 
        echo translate_user_role('Author');
        ?>
</option>
                                            <option <?php 
        if ($user_role_resources == 'contributor') {
            echo "selected";
        }
        ?>
 value="contributor" ><?php 
        echo translate_user_role('Contributor');
        ?>
</option>
                                        </select>
                                    </td>
                                </tr>
                            <?php 
    }
    ?>

                            <tr valign="top">
                                <th scope="row"><label for="user_role_settings" ><?php 
    _e('Settings', 'wpdev-booking');
    ?>
:</label></th>
                                <td>
                                    <select id="user_role_settings" name="user_role_settings">
                                        <option <?php 
    if ($booking_user_role_settings == 'subscriber') {
        echo "selected";
    }
    ?>
 value="subscriber" ><?php 
    echo translate_user_role('Subscriber');
    ?>
</option>
                                        <option <?php 
    if ($booking_user_role_settings == 'administrator') {
        echo "selected";
    }
    ?>
 value="administrator" ><?php 
    echo translate_user_role('Administrator');
    ?>
</option>
                                        <option <?php 
    if ($booking_user_role_settings == 'editor') {
        echo "selected";
    }
    ?>
 value="editor" ><?php 
    echo translate_user_role('Editor');
    ?>
</option>
                                        <option <?php 
    if ($booking_user_role_settings == 'author') {
        echo "selected";
    }
    ?>
 value="author" ><?php 
    echo translate_user_role('Author');
    ?>
</option>
                                        <option <?php 
    if ($booking_user_role_settings == 'contributor') {
        echo "selected";
    }
    ?>
 value="contributor" ><?php 
    echo translate_user_role('Contributor');
    ?>
</option>
                                    </select>                                    
                                </td>
                            </tr>
                            
                            <tr valign="top">
                                <td colspan="2">
                                    <?php 
    if (wpdev_bk_is_this_demo()) {
        ?>
 <div class="wpbc-error-message" style="text-align:left;"> <span class="wpbc-demo-alert-not-allow"><strong>Warning!</strong> Demo test version does not allow changes to these items.</span></div> <?php 
    }
    ?>
                                    <p class="description"><?php 
    _e('Select user access level for the menu pages of plugin', 'wpdev-booking');
    ?>
</p>
                                </td>
                            </tr>
                            
                        </tbody></table>
                </div></div></div>


                <div class='meta-box'>
                    <div <?php 
    $my_close_open_win_id = 'bk_general_settings_uninstall';
    ?>
  id="<?php 
    echo $my_close_open_win_id;
    ?>
" class="postbox <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) {
        echo 'closed';
    }
    ?>
" > <div title="<?php 
    _e('Click to toggle', 'wpdev-booking');
    ?>
" class="handlediv"  onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_win_id;
    ?>
');"><br></div>
                        <h3 class='hndle'><span><?php 
    _e('Uninstall / deactivation', 'wpdev-booking');
    ?>
</span></h3> <div class="inside">
                            <table class="form-table"><tbody>

                                <tr valign="top">
                                    <th scope="row"><?php 
    _e('Delete booking data, when plugin deactivated', 'wpdev-booking');
    ?>
:</th>
                                    <td>
                                        <fieldset>
                                            <label for="is_delete_if_deactive">
                                                <input id="is_delete_if_deactive" type="checkbox" <?php 
    if ($is_delete_if_deactive == 'On') {
        echo "checked";
    }
    ?>
  value="<?php 
    echo $is_delete_if_deactive;
    ?>
" name="is_delete_if_deactive"
                                                    onclick="javascript: if (this.checked) { var answer = confirm('<?php 
    _e('Warning', 'wpdev-booking');
    echo '! ';
    _e("If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?", 'wpdev-booking');
    ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"
                                                       />
                                                <?php 
    _e('Check this box to delete all booking data when you uninstal this plugin.', 'wpdev-booking');
    ?>
                                            </label>
                                        </fieldset>
                                    </td>
                                </tr>

                            </tbody></table>
                </div></div></div>

                <?php 
    make_bk_action('wpdev_booking_technical_booking_section');
    ?>
                
            </div>

            <div class="clear" style="height:10px;"></div>
            <input class="button-primary button" style="float:right;" type="submit" value="<?php 
    _e('Save Changes', 'wpdev-booking');
    ?>
" name="Submit"/>
            <div class="clear" style="height:10px;"></div>
        </form>
        </div>    
        <?php 
}
function wpdev_bk_custom_button_dalog_structure_DIV()
{
    ?>
    <div class="hidden">
        <div id="wpdev_bk-dialog" style="width:90%;height:90%;">
            <div class="wpdev_bk-dialog-content">
                <div class="wpdev_bk-dialog-inputs">
                    <?php 
    $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, 'only_super_admin');
    if ($is_can) {
        make_bk_action('show_tabs_inside_insertion_popup_window');
    }
    ?>
                    <div id="popup_new_reservation" style="display:block;" class="booking_configuration_dialog">

                      <div id="popup_new_reservation_main_content"><?php 
    if (get_bk_version() !== 'free') {
        $types_list = get_bk_types(false, false);
        ?>
<div class="field">
                                  <fieldset>
                                        <label for="calendar_type"><?php 
        _e('Booking resource:', 'booking');
        ?>
</label>
                                        <select id="calendar_type" name="calendar_type">
                                            <?php 
        foreach ($types_list as $tl) {
            ?>
                                            <option value="<?php 
            echo $tl->id;
            ?>
"
                                                        style="<?php 
            if (isset($tl->parent)) {
                if ($tl->parent == 0) {
                    echo 'font-weight:bold;';
                } else {
                    echo 'font-size:11px;padding-left:20px;';
                }
            }
            ?>
"
                                                    ><?php 
            echo $tl->title;
            ?>
</option>
                                            <?php 
        }
        ?>
                                        </select>
                                      <span class="description"><?php 
        _e('Select booking resource', 'booking');
        ?>
</span>
                                  </fieldset>
                              </div>                              
                        <?php 
    }
    ?>

                        <?php 
    if ($is_can || WP_BK_CUSTOM_FORMS_FOR_REGULAR_USERS) {
        make_bk_action('wpdev_show_bk_form_selection');
    }
    ?>

                        <div class="field">
                            <fieldset>
                                <label for="calendar_count"><?php 
    _e('Visible months:', 'booking');
    ?>
</label>
                                <select  id="calendar_count"  name="calendar_count" >
                                    <option value="1" <?php 
    if (get_bk_option('booking_client_cal_count') == '1') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >1</option>
                                    <option value="2" <?php 
    if (get_bk_option('booking_client_cal_count') == '2') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >2</option>
                                    <option value="3" <?php 
    if (get_bk_option('booking_client_cal_count') == '3') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >3</option>
                                    <option value="4" <?php 
    if (get_bk_option('booking_client_cal_count') == '4') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >4</option>
                                    <option value="5" <?php 
    if (get_bk_option('booking_client_cal_count') == '5') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >5</option>
                                    <option value="6" <?php 
    if (get_bk_option('booking_client_cal_count') == '6') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >6</option>
                                    <option value="7" <?php 
    if (get_bk_option('booking_client_cal_count') == '7') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >7</option>
                                    <option value="8" <?php 
    if (get_bk_option('booking_client_cal_count') == '8') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >8</option>
                                    <option value="9" <?php 
    if (get_bk_option('booking_client_cal_count') == '9') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >9</option>
                                    <option value="10" <?php 
    if (get_bk_option('booking_client_cal_count') == '10') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >10</option>
                                    <option value="11" <?php 
    if (get_bk_option('booking_client_cal_count') == '11') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >11</option>
                                    <option value="12" <?php 
    if (get_bk_option('booking_client_cal_count') == '12') {
        echo ' selected="SELECTED" ';
    }
    ?>
 >12</option>
                                </select>
                                <span class="description"><?php 
    _e('Select number of month to show for calendar.', 'booking');
    ?>
</span>
                            </fieldset>
                        </div>

                        <div class="field">
                            <fieldset>
                                <label for="start_month_active"><?php 
    _e('Start month:', 'booking');
    ?>
</label>
                                <input id="start_month_active"  name="start_month_active" type="checkbox" 
                                       onchange="javascript:if(! this.checked){ jQuery('select.start_month').attr('disabled', 'disabled'); } else {jQuery('select.start_month').removeAttr('disabled');}" 
                                        />
                                <?php 
    $start_year = date('Y');
    $start_month = date('m');
    ?>
                                <select class="start_month" id="year_start_month" disabled="DISABLED" name="year_start_month" style="width:65px;" > <?php 
    for ($mi = $start_year; $mi < $start_year + 11; $mi++) {
        echo '<option value="' . $mi . '" >' . $mi . '</option>';
    }
    ?>
 </select> /
                                <select class="start_month"  id="month_start_month" disabled="DISABLED"  name="month_start_month" style="width:50px;" > <?php 
    for ($mi = 1; $mi < 13; $mi++) {
        if ($mi < 10) {
            $mi = '0' . $mi;
        }
        echo '<option value="' . $mi . '" ' . ($start_month == $mi ? ' selected="SELECTED" ' : '') . ' >' . $mi . '</option>';
    }
    ?>
 </select>
                                <span class="description"><?php 
    _e('Select start month of calendar', 'booking');
    ?>
</span>
                            </fieldset>
                        </div>

                        <div class="field">
                            <fieldset>
                                <div style="float:left;">
                                <label for="calendar_or_form"><?php 
    _e('Show in the page:', 'booking');
    ?>
</label>
                                </div>
                                <div style="float:left;">
                                <select id="calendar_or_form"  name="calendar_or_form" onchange="
                                javascript: if(this.value=='onlyform') document.getElementById('dates_for_form').style.display='block'; else  document.getElementById('dates_for_form').style.display='none';
                                ">
                                    <option value="form"><?php 
    _e('Booking form with calendar', 'booking');
    ?>
</option>
                                    <option value="calendar"><?php 
    _e('Only availability calendar', 'booking');
    ?>
</option>
                                    <?php 
    if (class_exists('wpdev_bk_biz_l')) {
        ?>
<option value="onlyform"><?php 
        _e('Only booking form', 'booking');
        ?>
</option><?php 
    }
    ?>
                                </select>
                                </div>
                                <div style="float:left;">
                                <?php 
    if (class_exists('wpdev_bk_biz_l')) {
        ?>
<span style="margin-left:5px;display:none;" id="dates_for_form"> <?php 
        _e('for', 'booking');
        ?>
                                        <select  id="year_popup"  name="year_popup" style="width:65px;" > <?php 
        for ($mi = $start_year; $mi < $start_year + 11; $mi++) {
            echo '<option value="' . $mi . '" >' . $mi . '</option>';
        }
        ?>
 </select> /
                                        <select  id="month_popup"  name="month_popup" style="width:50px;" > <?php 
        for ($mi = 1; $mi < 13; $mi++) {
            if ($mi < 10) {
                $mi = '0' . $mi;
            }
            echo '<option value="' . $mi . '" ' . ($start_month == $mi ? ' selected="SELECTED" ' : '') . '  >' . $mi . '</option>';
        }
        ?>
 </select> /
                                        <select  id="day_popup"  name="day_popup" style="width:50px;" > <?php 
        for ($mi = 1; $mi < 32; $mi++) {
            if ($mi < 10) {
                $mi = '0' . $mi;
            }
            echo '<option value="' . $mi . '" >' . $mi . '</option>';
        }
        ?>
 </select> <?php 
        _e('date', 'booking');
        ?>
.
                                    </span><?php 
    }
    ?>
                                </div>
                                <div class="clear"></div>
                                <p class="description"><?php 
    _e('Select to show the entire booking form or the availability calendar only.', 'booking');
    ?>
</p>
                            </fieldset>
                        </div>                              
                        <?php 
    make_bk_action('show_additional_arguments_for_shortcode');
    ?>
  

                      </div>

                      <div style="height:1px;clear:both;width:100%;"></div>


                        <div style="color:#21759B;cursor: pointer;font-weight: bold;float:left;"
                           onclick="javascript: jQuery('.bk_show_options_parameter').toggle(1);
                                                jQuery('#togle_options_parameter').slideToggle('normal');
                                                jQuery('#popup_new_reservation_main_content').slideToggle('normal');"
                           style="text-decoration: none;font-weight: bold;font-size: 11px;">
                            <span class="bk_show_options_parameter">+ <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Show advanced settings', 'booking');
    ?>
</span></span>
                            <span class="bk_show_options_parameter" style="display:none;">- <span style="border-bottom:1px dashed #21759B;"><?php 
    _e('Hide advanced settings', 'booking');
    ?>
</span></span>
                        </div>

                        <div class="bk_show_options_parameter description" style="color: #777777;float: right;width: 475px;"><?php 
    printf(__('Setting advanced parameters of the calendar. %sLike width, height and structure %s', 'booking'), '<em>', '</em>');
    if (class_exists('wpdev_bk_biz_m')) {
        printf(__('%s or minimum and fixed number of days selection for the specific day of week or season.%s', 'booking'), '<em>', '</em>');
    }
    ?>
</div>

                      <div style="height:1px;clear:both;width:100%;"></div>

                      <div class="field0" id="togle_options_parameter" style="display:none;margin:10px;">
                            <div class="bk_help_message" style="margin:5px 0px;"><?php 
    printf(__('Please read more about the possible customizations of these %soptions%s %shere%s', 'booking'), '<strong>', '</strong>', '<a href="http://wpbookingcalendar.com/help/booking-calendar-shortcodes/" target="_blank">', '</a>');
    ?>
</div>                                     
                            <strong><span for="bookingcalendar_options"><?php 
    _e('Options:', 'booking');
    ?>
</span></strong><br/>
                            <textarea id="bookingcalendar_options"  name="bookingcalendar_options" style="width:100%; height:50px;"></textarea>
                            <span class="description" style="width:99%;">
                                <?php 
    printf(__('Specify the full width of calendar, height of date cell and number of months in one row. ', 'booking'));
    ?>
<br/>
                                <div style="margin-left:35px;">
                                    <strong><?php 
    _e('Description', 'booking');
    ?>
: </strong>
                                        "<?php 
    echo __('Calendar have 2 months in a row, the cell height is 30px and calendar full width 568px (possible to use percentage for width: 100%)', 'booking');
    ?>
"<br/>
                                    <strong><?php 
    _e('Code Example', 'booking');
    ?>
: </strong>
                                        <?php 
    echo '<code>{calendar months_num_in_row=2 width=568px cell_height=30px}</code>';
    ?>
                                </div><br/>
                                <?php 
    if (class_exists('wpdev_bk_biz_m')) {
        ?>
                                    <?php 
        printf(__('Specify that during certain seasons (or days of week), the specific minimum number of days must be booked. ', 'booking'));
        ?>
<br/>
                                    <div style="margin-left:35px;">
                                        <strong><?php 
        _e('Description', 'booking');
        ?>
: </strong>
                                            "<?php 
        printf(__('Visitor can select only 4 days starting at Monday, 3 or 7 days – Friday, 2 days – Saturday, etc…', 'booking'));
        ?>
"<br/>
                                        <strong><?php 
        _e('Code Example', 'booking');
        ?>
: </strong>
                                            <?php 
        echo '<code>{select-day condition="weekday" for="1" value="4"},{select-day condition="weekday" for="5" value="3,7"},{select-day condition="weekday" for="6" value="2"}</code>';
        ?>
                                    </div>
                                <?php 
    }
    ?>
                            </span>                                
                      </div>

                    </div>

                    <?php 
    make_bk_action('show_insertion_popup_shortcode_for_bookingedit');
    ?>

                    <input id="calendar_tag_name"   name="calendar_tag_name"    type="hidden" >
                    <input id="calendar_tag_close"  name="calendar_tag_close"   type="hidden" >
                </div>
            </div>
        </div>
    </div>
    <?php 
}