Ejemplo n.º 1
0
function wpdevbk_show_booking_filters()
{
    ?>
  <div style="clear:both;height:1px;"></div>
                <div class="wpdevbk-filters-section ">

                        <div class="wpbc-search-by-booking-id" >
                        <form  name="booking_filters_formID" action="" method="post" id="booking_filters_formID" class=" form-search">
                            <?php 
    if (isset($_REQUEST['wh_booking_id'])) {
        $wh_booking_id = $_REQUEST['wh_booking_id'];
    } else {
        $wh_booking_id = '';
    }
    ?>
                            <input class="input-small" type="text" placeholder="<?php 
    _e('Booking ID', 'wpdev-booking');
    ?>
" name="wh_booking_id" id="wh_booking_id" value="<?php 
    echo $wh_booking_id;
    ?>
" >
                            <button class="button button-secondary" type="submit"><?php 
    _e('Go', 'wpdev-booking');
    ?>
</button>
                        </form>
                        </div>

                        <form  name="booking_filters_form" action="" method="post" id="booking_filters_form"  class="form-inline">
                            <input type="hidden" name="page_num" id ="page_num" value="1" />
                            <div class="btn-group" style="float: left; margin-right: 15px;">
                            <a class="tooltip_top button button-primary" style="float: left; "
                               data-original-title="<?php 
    _e('Refresh booking listing', 'wpdev-booking');
    ?>
"  rel="tooltip" 
                                href="javascript:void(0)"
                                onclick="javascript:booking_filters_form.submit();"
                                ><?php 
    _e('Apply', 'wpdev-booking');
    ?>
 <i class="icon-refresh icon-white"></i></a><a 
                                data-original-title="<?php 
    _e('Reset filter to default values', 'wpdev-booking');
    ?>
"  rel="tooltip" 
                                class="tooltip_top button button-secondary" 
                                href="<?php 
    echo 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking&view_mode=vm_listing';
    ?>
"
                                style="border: 1px solid #aaa;border-left: none;"
                                ><i class="icon-remove"></i></a>
                            </div>

    <?php 
    /** ?>
                  <?php
    
                  $wpdevbk_id= '';
                  $wpdevbk_selectors='';
                  $wpdevbk_control_label='';
                  $wpdevbk_help_block='Booking Status';
                  $wpdevbk_default_value = '';
                  $wpdevbk_selector_default_value='';
                  ?>
                  <div class="control-group" style="float:left;">
                    <label for="<?php echo $wpdevbk_id; ?>" class="control-label"><?php echo $wpdevbk_control_label; ?></label>
                    <div class="inline controls">
                        <!--div class="btn-group" data-toggle="buttons-radio" id="radiobutton_<?php echo $wpdevbk_id; ?>"-->
                        <div class="btn-group" data-toggle="buttons-checkbox" id="radiobutton_<?php echo $wpdevbk_id; ?>">
                            <a  href="javascript:void(0)" class="btn">Approved</a>
                            <a  href="javascript:void(0)" class="btn">Pending</a>
                        </div>
                        <input type="hidden" value="<?php echo $wpdevbk_selector_default_value; ?>" id="<?php echo $wpdevbk_id; ?>" name="<?php echo $wpdevbk_id; ?>" />
                      <p class="help-block"><?php echo $wpdevbk_help_block; ?></p>
                    </div>
                  </div>
                    <script type="text/javascript">
                        jQuery('#radiobutton_<?php echo $wpdevbk_id; ?> .btn').button();
                        <?php if (1) {  // Press the button ?>
                            jQuery('#radiobutton_<?php echo $wpdevbk_id; ?> .btn:first').button('toggle');
                        <?php } ?>
                    </script>
        <?php /**/
    ?>
                            <?php 
    // Approved / Pending
    $wpdevbk_id = 'wh_approved';
    //  {'', '0', '1' }
    $wpdevbk_selectors = array(__('Pending', 'wpdev-booking') => '0', __('Approved', 'wpdev-booking') => '1', 'divider0' => 'divider', __('Any', 'wpdev-booking') => '');
    $wpdevbk_control_label = '';
    $wpdevbk_help_block = __('Status', 'wpdev-booking');
    // Pending, Active, Suspended, Terminated, Cancelled, Fraud
    wpdevbk_selectbox_filter($wpdevbk_id, $wpdevbk_selectors, $wpdevbk_control_label, $wpdevbk_help_block);
    ?>

                            <?php 
    // Booking Dates
    $wpdevbk_id = 'wh_booking_date';
    $wpdevbk_id2 = 'wh_booking_date2';
    $wpdevbk_control_label = '';
    $wpdevbk_help_block = __('Dates', 'wpdev-booking');
    $wpdevbk_width = 'span2 wpdevbk-filters-section-calendar';
    $wpdevbk_icon = '<i class="icon-calendar"></i>';
    wpdevbk_dates_selection_for_filter($wpdevbk_id, $wpdevbk_id2, $wpdevbk_control_label, $wpdevbk_help_block, $wpdevbk_width, $wpdevbk_icon);
    ?>
                            <span style="display:none;" class="advanced_booking_filter">
                            <?php 
    // Read / Unread
    //                            $wpdevbk_id =              'wh_is_new';                           //  {'',  '1' }
    //                            $wpdevbk_selectors =        array('','1');
    //                            $wpdevbk_control_label =   __('Unread', 'wpdev-booking');
    //                            $wpdevbk_help_block =      __('Only New', 'wpdev-booking');
    //
    //                            wpdevbk_checkboxbutton_filter($wpdevbk_id, $wpdevbk_selectors, $wpdevbk_control_label, $wpdevbk_help_block);
    $wpdevbk_id = 'wh_is_new';
    //  {'', '0', '1' }
    $wpdevbk_selectors = array(__('All bookings', 'wpdev-booking') => '', __('New bookings', 'wpdev-booking') => '1');
    $wpdevbk_control_label = '';
    $wpdevbk_help_block = __('Show', 'wpdev-booking');
    wpdevbk_selectbox_filter($wpdevbk_id, $wpdevbk_selectors, $wpdevbk_control_label, $wpdevbk_help_block);
    ?>


                            <?php 
    // Creation Dates
    $wpdevbk_id = 'wh_modification_date';
    $wpdevbk_id2 = 'wh_modification_date2';
    $wpdevbk_control_label = '';
    $wpdevbk_help_block = __('Creation', 'wpdev-booking');
    $wpdevbk_width = 'span2 wpdevbk-filters-section-calendar';
    $wpdevbk_icon = '<i class="icon-calendar"></i>';
    $exclude_items = array(0, 2, 4, 7, 8);
    $default_item = 3;
    wpdevbk_dates_selection_for_filter($wpdevbk_id, $wpdevbk_id2, $wpdevbk_control_label, $wpdevbk_help_block, $wpdevbk_width, $wpdevbk_icon, $exclude_items, $default_item);
    ?>

                            <?php 
    if (function_exists('wpdebk_filter_field_bk_keyword')) {
        wpdebk_filter_field_bk_keyword();
    }
    ?>

                            <?php 
    if (function_exists('wpdebk_filter_field_bk_paystatus')) {
        wpdebk_filter_field_bk_paystatus();
    }
    ?>

                            <?php 
    if (function_exists('wpdebk_filter_field_bk_costs')) {
        wpdebk_filter_field_bk_costs();
    }
    ?>

                            </span>

                            <?php 
    // Sort
    $wpdevbk_id = 'or_sort';
    //  {'', '0', '1' }
    $wpdevbk_selectors = array(__('ID', 'wpdev-booking') . '&nbsp;<i class="icon-arrow-up "></i>' => '', __('Dates', 'wpdev-booking') . '&nbsp;<i class="icon-arrow-up "></i>' => 'sort_date', 'divider0' => 'divider', __('ID', 'wpdev-booking') . '&nbsp;<i class="icon-arrow-down "></i>' => 'booking_id_asc', __('Dates', 'wpdev-booking') . '&nbsp;<i class="icon-arrow-down "></i>' => 'sort_date_asc');
    $wpdevbk_selectors = apply_bk_filter('bk_filter_sort_options', $wpdevbk_selectors);
    $wpdevbk_control_label = '';
    $wpdevbk_help_block = __('Order by', 'wpdev-booking');
    $wpdevbk_default_value = get_bk_option('booking_sort_order');
    wpdevbk_selectbox_filter($wpdevbk_id, $wpdevbk_selectors, $wpdevbk_control_label, $wpdevbk_help_block, $wpdevbk_default_value);
    ?>
                            
                            <?php 
    if (function_exists('wpdevbk_booking_resource_selection_for_booking_listing')) {
        wpdevbk_booking_resource_selection_for_booking_listing();
    }
    ?>

                            <?php 
    if (class_exists('wpdev_bk_personal')) {
        ?>
                            <div style="float:left;display:none;" class="advanced_booking_filter btn-group">

                                
                                <a data-original-title="<?php 
        _e('Save filter settings as default template (Please, click Apply filter button, before saving!)', 'wpdev-booking');
        ?>
"  rel="tooltip"
                                   class="tooltip_top button button-secondary" 
                                    onclick="javascript:save_bk_listing_filter( '<?php 
        echo get_bk_current_user_id();
        ?>
',  'default' , '<?php 
        echo get_params_in_url(array('page_num', 'wh_booking_type'));
        ?>
' );"
                                    ><?php 
        _e('Save as Default', 'wpdev-booking');
        ?>
 <i class="icon-download"></i></a>
                                <?php 
        $saved_tamplate_option = get_user_option('booking_listing_filter_' . 'default', get_bk_current_user_id());
        if (false != $saved_tamplate_option) {
            ?>
    
                                <a data-original-title="<?php 
            _e('Delete your previously saved default filer template!', 'wpdev-booking');
            ?>
"  rel="tooltip"
                                   class="tooltip_top button button-secondary" 
                                    onclick="javascript:delete_bk_listing_filter( '<?php 
            echo get_bk_current_user_id();
            ?>
',  'default' );"
                                    ><?php 
            _e('Delete template', 'wpdev-booking');
            ?>
 <i class="icon-trash"></i></a>
                            <?php 
        }
        ?>

                            </div>
                            <?php 
    }
    ?>
                          <div class="clear"></div>
                        </form>



                <!--div id="tooltipsinit" class="tooltip-demo well">
                    <p style="margin-bottom: 0;" class="muted">Tight pants next level keffiyeh
                        <a rel="tooltip" href="javascript:void(0)" data-original-title="first tooltip">you probably</a>

                        haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel

                        <a rel="tooltip" href="javascript:void(0)" data-original-title="Another tooltip">have a</a>

                        terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A

                        <a title="Another one here too" rel="tooltip" href="javascript:void(0)">really ironic</a>

                        artisan whatever keytar, scenester farm-to-table banksy Austin

                        <a rel="tooltip" href="javascript:void(0)" data-original-title="The last tip!">twitter handle</a>

                        freegan cred raw denim single-origin coffee viral.
                    </p>
                </div>

                <script type="text/javascript">
                    jQuery('#tooltipsinit a').tooltip( {
                        animation: true
                      , delay: { show: 500, hide: 100 }
                      , selector: false
                      , placement: 'top'
                      , trigger: 'hover'
                      , title: ''
                      , template: '<div class="wpdevbk tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
                    });
                </script>


                <div id="popover" class="well">
                    <a data-content="And here's some amazing content. It's very engaging. right?" rel="popover" class="btn btn-danger" href="javascript:void(0)" data-original-title="A Title">hover for popover</a>
                </div>


                <script type="text/javascript">
                    jQuery('#popover a').popover( {
                        placement: 'bottom'
                      , delay: { show: 100, hide: 100 }
                      , content: ''
                      , template: '<div class="wpdevbk popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
                    });
                </script-->
                </div>
                <div style="clear:both;height:1px;"></div>
            <?php 
}
Ejemplo n.º 2
0
    function wpdev_booking_technical_booking_section()
    {
        $link = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking-option';
        if (isset($_REQUEST['reindex_sort_data']) && $_REQUEST['reindex_sort_data'] == '1') {
            $this->reindex_booking_db();
        }
        ?>
<div class='meta-box technical-booking-section'>
            <div <?php 
        $my_close_open_win_id = 'bk_general_settings_technical_section';
        ?>
  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('Technical support section', 'wpdev-booking');
        ?>
</span></h3> <div class="inside">
                    
                    <table class="form-table"><tbody>
                        <tr valign="top">
                            <th scope="row"><label for="is_reindex_booking_data" ><?php 
        _e('Reindex booking data', 'wpdev-booking');
        ?>
:</label></th>
                            <td>
                                <input class="button" id="is_reindex_booking_data" type="button" value="<?php 
        _e('Reindex', 'wpdev-booking');
        ?>
" name="is_reindex_booking_data"
                                    onclick="javascript: window.location.href='<?php 
        echo $link;
        ?>
&reindex_sort_data=1';"
                                       />                                
                            </td>
                        </tr>
                        <tr><td colspan="2">
                                <p class="description"><?php 
        _e(' Click, if you want to reindex booking data by booking dates sort field (Your installation/update of the plugin must be successful).', 'wpdev-booking');
        ?>
</p>
                        </td></tr>
                    </tbody></table>
                    
            </div></div></div><?php 
    }
Ejemplo n.º 3
0
function wpdev_bk_settings_form_labels()
{
    ?>
            <div class="clear" style="height:0px;"></div>
            <div id="ajax_working"></div>
            <div id="poststuff0" class="metabox-holder">
                <form  name="post_settings_form_fields" action="" method="post" id="post_settings_form_fields" class="form-horizontal">
                
                  <div id="visibility_container_form_fields" class="visibility_container wpdevbk" style="display:block;">
                    <div class='meta-box'>
                        <div <?php 
    $my_close_open_win_id = 'bk_settings_form_fields';
    ?>
  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 fields labels', 'wpdev-booking');
    ?>
</span></h3><div class="inside">

                                
                                <?php 
    // FIELD # 1 //////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        if (isset($_POST['booking_form_field_active1'])) {
            $booking_form_field_active1 = 'On';
        } else {
            $booking_form_field_active1 = 'Off';
        }
        update_bk_option('booking_form_field_active1', $booking_form_field_active1);
        if (isset($_POST['booking_form_field_required1'])) {
            $booking_form_field_required1 = 'On';
        } else {
            $booking_form_field_required1 = 'Off';
        }
        update_bk_option('booking_form_field_required1', $booking_form_field_required1);
        update_bk_option('booking_form_field_label1', $_POST['booking_form_field_label1']);
    }
    $booking_form_field_active1 = get_bk_option('booking_form_field_active1');
    $booking_form_field_required1 = get_bk_option('booking_form_field_required1');
    $booking_form_field_label1 = get_bk_option('booking_form_field_label1');
    ?>
                                <div class="control-group">
                                  <label for="name" class="control-label" style="font-weight:bold;"><?php 
    _e('Field Label', 'wpdev-booking');
    ?>
 #1:</label>
                                  <div class="controls"> 
                                      
                                    <input type="text" class="large-text" 
                                           name="booking_form_field_label1" value="<?php 
    echo $booking_form_field_label1;
    ?>
">&nbsp;&nbsp;&nbsp;
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_active1"
                                            <?php 
    if ($booking_form_field_active1 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_active1;
    ?>
" >
                                        <?php 
    _e('Active', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_required1"
                                            <?php 
    if ($booking_form_field_required1 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_required1;
    ?>
" >
                                        <?php 
    _e('Required', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <p class="help-block"><?php 
    _e('Activate or deactivate field and change the label title', 'wpdev-booking');
    ?>
</p>
                                  </div>
                                </div>

                                <?php 
    // FIELD # 2 //////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        if (isset($_POST['booking_form_field_active2'])) {
            $booking_form_field_active2 = 'On';
        } else {
            $booking_form_field_active2 = 'Off';
        }
        update_bk_option('booking_form_field_active2', $booking_form_field_active2);
        if (isset($_POST['booking_form_field_required2'])) {
            $booking_form_field_required2 = 'On';
        } else {
            $booking_form_field_required2 = 'Off';
        }
        update_bk_option('booking_form_field_required2', $booking_form_field_required2);
        update_bk_option('booking_form_field_label2', $_POST['booking_form_field_label2']);
    }
    $booking_form_field_active2 = get_bk_option('booking_form_field_active2');
    $booking_form_field_required2 = get_bk_option('booking_form_field_required2');
    $booking_form_field_label2 = get_bk_option('booking_form_field_label2');
    ?>
                                <div class="control-group">
                                  <label for="name" class="control-label" style="font-weight:bold;"><?php 
    _e('Field Label', 'wpdev-booking');
    ?>
 #2:</label>
                                  <div class="controls"> 
                                      
                                    <input type="text" class="large-text" 
                                           name="booking_form_field_label2" value="<?php 
    echo $booking_form_field_label2;
    ?>
">&nbsp;&nbsp;&nbsp;
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_active2"
                                            <?php 
    if ($booking_form_field_active2 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_active2;
    ?>
" >
                                        <?php 
    _e('Active', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_required2"
                                            <?php 
    if ($booking_form_field_required2 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_required2;
    ?>
" >
                                        <?php 
    _e('Required', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <p class="help-block"><?php 
    _e('Activate or deactivate field and change the label title', 'wpdev-booking');
    ?>
</p>
                                  </div>
                                </div>

                                <?php 
    // FIELD # 3 //////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        //if (isset( $_POST['booking_form_field_active3'] )) $booking_form_field_active3 = 'On';
        //else                                               $booking_form_field_active3 = 'Off';
        $booking_form_field_active3 = 'On';
        update_bk_option('booking_form_field_active3', $booking_form_field_active3);
        //if (isset( $_POST['booking_form_field_required3'] )) $booking_form_field_required3 = 'On';
        //else                                                 $booking_form_field_required3 = 'Off';
        $booking_form_field_required3 = 'On';
        update_bk_option('booking_form_field_required3', $booking_form_field_required3);
        update_bk_option('booking_form_field_label3', $_POST['booking_form_field_label3']);
    }
    $booking_form_field_active3 = get_bk_option('booking_form_field_active3');
    $booking_form_field_required3 = get_bk_option('booking_form_field_required3');
    $booking_form_field_label3 = get_bk_option('booking_form_field_label3');
    ?>
                                <div class="control-group">
                                  <label for="name" class="control-label" style="font-weight:bold;"><?php 
    _e('Email Label', 'wpdev-booking');
    ?>
:</label>
                                  <div class="controls"> 
                                      
                                    <input type="text" class="large-text" 
                                           name="booking_form_field_label3" value="<?php 
    echo $booking_form_field_label3;
    ?>
">&nbsp;&nbsp;&nbsp;
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_active3" disabled=""
                                            <?php 
    if ($booking_form_field_active3 == 'On' || true) {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_active3;
    ?>
" >
                                        <?php 
    _e('Active', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_required3" disabled=""
                                            <?php 
    if ($booking_form_field_required3 == 'On' || true) {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_required3;
    ?>
" >
                                        <?php 
    _e('Required', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <p class="help-block"><?php 
    _e('Change the label title of this field. Email is obligatory field in booking form.', 'wpdev-booking');
    ?>
</p>
                                  </div>
                                </div>

                                <?php 
    // FIELD # 4 //////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        if (isset($_POST['booking_form_field_active4'])) {
            $booking_form_field_active4 = 'On';
        } else {
            $booking_form_field_active4 = 'Off';
        }
        update_bk_option('booking_form_field_active4', $booking_form_field_active4);
        if (isset($_POST['booking_form_field_required4'])) {
            $booking_form_field_required4 = 'On';
        } else {
            $booking_form_field_required4 = 'Off';
        }
        update_bk_option('booking_form_field_required4', $booking_form_field_required4);
        update_bk_option('booking_form_field_label4', $_POST['booking_form_field_label4']);
    }
    $booking_form_field_active4 = get_bk_option('booking_form_field_active4');
    $booking_form_field_required4 = get_bk_option('booking_form_field_required4');
    $booking_form_field_label4 = get_bk_option('booking_form_field_label4');
    ?>
                                <div class="control-group">
                                  <label for="name" class="control-label" style="font-weight:bold;"><?php 
    _e('Field Label', 'wpdev-booking');
    ?>
 #4:</label>
                                  <div class="controls"> 
                                      
                                    <input type="text" class="large-text" 
                                           name="booking_form_field_label4" value="<?php 
    echo $booking_form_field_label4;
    ?>
">&nbsp;&nbsp;&nbsp;
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_active4"
                                            <?php 
    if ($booking_form_field_active4 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_active4;
    ?>
" >
                                        <?php 
    _e('Active', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_required4"
                                            <?php 
    if ($booking_form_field_required4 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_required4;
    ?>
" >
                                        <?php 
    _e('Required', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <p class="help-block"><?php 
    _e('Activate or deactivate field and change the label title', 'wpdev-booking');
    ?>
</p>
                                  </div>
                                </div>

                                <?php 
    // FIELD # 5 //////////////////////////////////////////////////////////////////////////////////////////////////////////
    if (isset($_POST['Submit'])) {
        if (isset($_POST['booking_form_field_active5'])) {
            $booking_form_field_active5 = 'On';
        } else {
            $booking_form_field_active5 = 'Off';
        }
        update_bk_option('booking_form_field_active5', $booking_form_field_active5);
        if (isset($_POST['booking_form_field_required5'])) {
            $booking_form_field_required5 = 'On';
        } else {
            $booking_form_field_required5 = 'Off';
        }
        update_bk_option('booking_form_field_required5', $booking_form_field_required5);
        update_bk_option('booking_form_field_label5', $_POST['booking_form_field_label5']);
    }
    $booking_form_field_active5 = get_bk_option('booking_form_field_active5');
    $booking_form_field_required5 = get_bk_option('booking_form_field_required5');
    $booking_form_field_label5 = get_bk_option('booking_form_field_label5');
    ?>
                                <div class="control-group">
                                  <label for="name" class="control-label" style="font-weight:bold;"><?php 
    _e('Textarea Label', 'wpdev-booking');
    ?>
:</label>
                                  <div class="controls"> 
                                      
                                    <input type="text" class="large-text" 
                                           name="booking_form_field_label5" value="<?php 
    echo $booking_form_field_label5;
    ?>
">&nbsp;&nbsp;&nbsp;
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_active5"
                                            <?php 
    if ($booking_form_field_active5 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_active5;
    ?>
" >
                                        <?php 
    _e('Active', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <label class="checkbox inline">
                                        <input type="checkbox"  name="booking_form_field_required5"
                                            <?php 
    if ($booking_form_field_required5 == 'On') {
        echo ' checked="checked" ';
    }
    ?>
  
                                            value="<?php 
    echo $booking_form_field_required5;
    ?>
" >
                                        <?php 
    _e('Required', 'wpdev-booking');
    ?>
                                    </label> 
                                    
                                    <p class="help-block"><?php 
    _e('Activate or deactivate field and change the label title', 'wpdev-booking');
    ?>
</p>
                                  </div>
                                </div>


                     </div></div></div>
                      
                    <div <?php 
    $my_close_open_alert_id = 'bk_alert_settings_form_in_free';
    ?>
                        class="alert alert-block alert-info <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_alert_id)) {
        echo 'closed';
    }
    ?>
"                             
                        id="<?php 
    echo $my_close_open_alert_id;
    ?>
">
                      <a class="close tooltip_left" rel="tooltip" title="Don't show the message anymore" data-dismiss="alert" href="javascript:void(0)"
                         onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_alert_id;
    ?>
');"
                         >&times;</a>
                      <strong class="alert-heading">Note!</strong>
                          Check how in <a href="http://wpbookingcalendar.com/help/versions-overview/" target="_blank" style="text-decoration:underline;">other versions of Booking Calendar</a> is possible fully <a href="http://wpbookingcalendar.com/help/booking-form-fields/" target="_blank" style="text-decoration:underline;">customize the booking form</a> <em>(add or remove fields, change structure of booking form, etc...)</em>
                    </div>
                      
                  </div>
                    
                  <input class="button-primary button" style="" type="submit" value="<?php 
    _e('Save Changes', 'wpdev-booking');
    ?>
" name="Submit" />
                  <div class="clear" style="height:10px;"></div>                  
                </form>
            </div>
         <?php 
}
function wpbc_settings_emails()
{
    if (isset($_POST['email_reservation_adress'])) {
        $email_reservation_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_reservation_adress']));
        $email_reservation_from_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_reservation_from_adress']));
        $email_reservation_subject = htmlspecialchars(str_replace('\\"', '"', $_POST['email_reservation_subject']));
        $email_reservation_content = str_replace('\\"', '"', $_POST['email_reservation_content']);
        $email_reservation_adress = str_replace("\\'", "'", $email_reservation_adress);
        $email_reservation_from_adress = str_replace("\\'", "'", $email_reservation_from_adress);
        $email_reservation_subject = str_replace("\\'", "'", $email_reservation_subject);
        $email_reservation_content = str_replace("\\'", "'", $email_reservation_content);
        if (isset($_POST['is_email_reservation_adress'])) {
            $is_email_reservation_adress = 'On';
        } else {
            $is_email_reservation_adress = 'Off';
        }
        update_bk_option('booking_is_email_reservation_adress', $is_email_reservation_adress);
        if (get_bk_option('booking_email_reservation_adress') !== false) {
            update_bk_option('booking_email_reservation_adress', $email_reservation_adress);
        } else {
            add_bk_option('booking_email_reservation_adress', $email_reservation_adress);
        }
        if (get_bk_option('booking_email_reservation_from_adress') !== false) {
            update_bk_option('booking_email_reservation_from_adress', $email_reservation_from_adress);
        } else {
            add_bk_option('booking_email_reservation_from_adress', $email_reservation_from_adress);
        }
        if (get_bk_option('booking_email_reservation_subject') !== false) {
            update_bk_option('booking_email_reservation_subject', $email_reservation_subject);
        } else {
            add_bk_option('booking_email_reservation_subject', $email_reservation_subject);
        }
        if (get_bk_option('booking_email_reservation_content') !== false) {
            update_bk_option('booking_email_reservation_content', $email_reservation_content);
        } else {
            add_bk_option('booking_email_reservation_content', $email_reservation_content);
        }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        $email_approval_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_approval_adress']));
        $email_approval_subject = htmlspecialchars(str_replace('\\"', '"', $_POST['email_approval_subject']));
        $email_approval_content = str_replace('\\"', '"', $_POST['email_approval_content']);
        $email_approval_adress = str_replace("\\'", "'", $email_approval_adress);
        $email_approval_subject = str_replace("\\'", "'", $email_approval_subject);
        $email_approval_content = str_replace("\\'", "'", $email_approval_content);
        if (isset($_POST['is_email_approval_adress'])) {
            $is_email_approval_adress = 'On';
        } else {
            $is_email_approval_adress = 'Off';
        }
        update_bk_option('booking_is_email_approval_adress', $is_email_approval_adress);
        if (isset($_POST['is_email_approval_send_copy_to_admin'])) {
            $is_email_approval_send_copy_to_admin = 'On';
        } else {
            $is_email_approval_send_copy_to_admin = 'Off';
        }
        update_bk_option('booking_is_email_approval_send_copy_to_admin', $is_email_approval_send_copy_to_admin);
        if (get_bk_option('booking_email_approval_adress') !== false) {
            update_bk_option('booking_email_approval_adress', $email_approval_adress);
        } else {
            add_bk_option('booking_email_approval_adress', $email_approval_adress);
        }
        if (get_bk_option('booking_email_approval_subject') !== false) {
            update_bk_option('booking_email_approval_subject', $email_approval_subject);
        } else {
            add_bk_option('booking_email_approval_subject', $email_approval_subject);
        }
        if (get_bk_option('booking_email_approval_content') !== false) {
            update_bk_option('booking_email_approval_content', $email_approval_content);
        } else {
            add_bk_option('booking_email_approval_content', $email_approval_content);
        }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        $email_newbookingbyperson_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_newbookingbyperson_adress']));
        $email_newbookingbyperson_subject = htmlspecialchars(str_replace('\\"', '"', $_POST['email_newbookingbyperson_subject']));
        $email_newbookingbyperson_content = str_replace('\\"', '"', $_POST['email_newbookingbyperson_content']);
        $email_newbookingbyperson_adress = str_replace("\\'", "'", $email_newbookingbyperson_adress);
        $email_newbookingbyperson_subject = str_replace("\\'", "'", $email_newbookingbyperson_subject);
        $email_newbookingbyperson_content = str_replace("\\'", "'", $email_newbookingbyperson_content);
        if (isset($_POST['is_email_newbookingbyperson_adress'])) {
            $is_email_newbookingbyperson_adress = 'On';
        } else {
            $is_email_newbookingbyperson_adress = 'Off';
        }
        update_bk_option('booking_is_email_newbookingbyperson_adress', $is_email_newbookingbyperson_adress);
        if (get_bk_option('booking_email_newbookingbyperson_adress') !== false) {
            update_bk_option('booking_email_newbookingbyperson_adress', $email_newbookingbyperson_adress);
        } else {
            add_bk_option('booking_email_newbookingbyperson_adress', $email_newbookingbyperson_adress);
        }
        if (get_bk_option('booking_email_newbookingbyperson_subject') !== false) {
            update_bk_option('booking_email_newbookingbyperson_subject', $email_newbookingbyperson_subject);
        } else {
            add_bk_option('booking_email_newbookingbyperson_subject', $email_newbookingbyperson_subject);
        }
        if (get_bk_option('booking_email_newbookingbyperson_content') !== false) {
            update_bk_option('booking_email_newbookingbyperson_content', $email_newbookingbyperson_content);
        } else {
            add_bk_option('booking_email_newbookingbyperson_content', $email_newbookingbyperson_content);
        }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        $email_deny_adress = htmlspecialchars(str_replace('\\"', '"', $_POST['email_deny_adress']));
        $email_deny_subject = htmlspecialchars(str_replace('\\"', '"', $_POST['email_deny_subject']));
        $email_deny_content = str_replace('\\"', '"', $_POST['email_deny_content']);
        $email_deny_adress = str_replace("\\'", "'", $email_deny_adress);
        $email_deny_subject = str_replace("\\'", "'", $email_deny_subject);
        $email_deny_content = str_replace("\\'", "'", $email_deny_content);
        if (isset($_POST['is_email_deny_adress'])) {
            $is_email_deny_adress = 'On';
        } else {
            $is_email_deny_adress = 'Off';
        }
        update_bk_option('booking_is_email_deny_adress', $is_email_deny_adress);
        if (isset($_POST['is_email_deny_send_copy_to_admin'])) {
            $is_email_deny_send_copy_to_admin = 'On';
        } else {
            $is_email_deny_send_copy_to_admin = 'Off';
        }
        update_bk_option('booking_is_email_deny_send_copy_to_admin', $is_email_deny_send_copy_to_admin);
        if (get_bk_option('booking_email_deny_adress') !== false) {
            update_bk_option('booking_email_deny_adress', $email_deny_adress);
        } else {
            add_bk_option('booking_email_deny_adress', $email_deny_adress);
        }
        if (get_bk_option('booking_email_deny_subject') !== false) {
            update_bk_option('booking_email_deny_subject', $email_deny_subject);
        } else {
            add_bk_option('booking_email_deny_subject', $email_deny_subject);
        }
        if (get_bk_option('booking_email_deny_content') !== false) {
            update_bk_option('booking_email_deny_content', $email_deny_content);
        } else {
            add_bk_option('booking_email_deny_content', $email_deny_content);
        }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    }
    $email_reservation_adress = get_bk_option('booking_email_reservation_adress');
    $email_reservation_from_adress = get_bk_option('booking_email_reservation_from_adress');
    $email_reservation_subject = get_bk_option('booking_email_reservation_subject');
    $email_reservation_content = get_bk_option('booking_email_reservation_content');
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $email_newbookingbyperson_adress = get_bk_option('booking_email_newbookingbyperson_adress');
    $email_newbookingbyperson_subject = get_bk_option('booking_email_newbookingbyperson_subject');
    $email_newbookingbyperson_content = get_bk_option('booking_email_newbookingbyperson_content');
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $email_approval_adress = get_bk_option('booking_email_approval_adress');
    $email_approval_subject = get_bk_option('booking_email_approval_subject');
    $email_approval_content = get_bk_option('booking_email_approval_content');
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $email_deny_adress = get_bk_option('booking_email_deny_adress');
    $email_deny_subject = get_bk_option('booking_email_deny_subject');
    $email_deny_content = get_bk_option('booking_email_deny_content');
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    $is_email_reservation_adress = get_bk_option('booking_is_email_reservation_adress');
    $is_email_newbookingbyperson_adress = get_bk_option('booking_is_email_newbookingbyperson_adress');
    $is_email_approval_adress = get_bk_option('booking_is_email_approval_adress');
    $is_email_approval_send_copy_to_admin = get_bk_option('booking_is_email_approval_send_copy_to_admin');
    $is_email_deny_adress = get_bk_option('booking_is_email_deny_adress');
    $is_email_deny_send_copy_to_admin = get_bk_option('booking_is_email_deny_send_copy_to_admin');
    // Replace <br> to  <br> with  new line
    $email_reservation_content = preg_replace(array("@(&lt;|<)br/?(&gt;|>)(\r\n)?@", "/\\[bookingtype\\]/"), array("<br/>", ""), $email_reservation_content);
    $email_newbookingbyperson_content = preg_replace(array("@(&lt;|<)br/?(&gt;|>)(\r\n)?@", "/\\[bookingtype\\]/"), array("<br/>", ""), $email_newbookingbyperson_content);
    $email_approval_content = preg_replace(array("@(&lt;|<)br/?(&gt;|>)(\r\n)?@", "/\\[bookingtype\\]/"), array("<br/>", ""), $email_approval_content);
    $email_deny_content = preg_replace(array("@(&lt;|<)br/?(&gt;|>)(\r\n)?@", "/\\[bookingtype\\]/"), array("<br/>", ""), $email_deny_content);
    ?>
    <div class="clear" style="height:0px;"></div>
    <div id="ajax_working"></div>
    <div id="poststuff0" class="metabox-holder">
        <form  name="post_settings_email_templates" action="" method="post" id="post_settings_email_templates" >

            <div id="visibility_container_email_new_to_admin" class="visibility_container" style="display:block;">

                <div class='meta-box'> <div <?php 
    $my_close_open_win_id = 'bk_settings_emails_to_admin';
    ?>
  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', '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('Email to "Admin" after a new booking', 'booking');
    ?>
</span></h3> <div class="inside">

                    <table class="form-table email-table0" >
                        <tbody>
                            <tr>
                                <th scope="row"><?php 
    _e('Status', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_reservation_adress">
                                            <input id="is_email_reservation_adress" name="is_email_reservation_adress" type="checkbox" 
                                                <?php 
    if ($is_email_reservation_adress == 'On') {
        echo "checked";
    }
    ?>
  
                                                value="<?php 
    echo $is_email_reservation_adress;
    ?>
" 
                                                onchange="document.getElementById('booking_is_email_reservation_adress_dublicated').checked=this.checked;"
                                                />
                                            <?php 
    _e('Active', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>
                            <tr valign="top">
                                <th scope="row"><label for="email_reservation_adress" ><?php 
    _e('To', 'booking');
    ?>
:</label></th>
                                <td><input id="email_reservation_adress"  name="email_reservation_adress" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_reservation_adress;
    ?>
" />
                                    <span class="description"><?php 
    printf(__('Type default %sadmin email%s for booking confirmation', 'booking'), '<b>', '</b>');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row"><label for="email_reservation_from_adress" ><?php 
    _e('From', 'booking');
    ?>
:</label></th>
                                <td><input id="email_reservation_from_adress" name="email_reservation_from_adress" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_reservation_from_adress;
    ?>
" />
                                    <span class="description"><?php 
    printf(__('Type the default %sadmin email%s sending the booking confimation. You can use this %s shortcode.', 'booking'), '<b>', '</b>', '<code>[visitoremail]</code>');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_reservation_subject" ><?php 
    _e('Subject', 'booking');
    ?>
:</label></th>
                                    <td><input id="email_reservation_subject" name="email_reservation_subject"  class="regular-text code" type="text" size="45" value="<?php 
    echo $email_reservation_subject;
    ?>
" />
                                        <span class="description"><?php 
    printf(__('Type your email %ssubject%s for the booking confimation message.', 'booking'), '<b>', '</b>');
    ?>
</span>
                                    </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row"><label for="email_reservation_content" ><?php 
    _e('Content', 'booking');
    ?>
:</label></th>
                                <td>     <?php 
    /**/
    wp_editor($email_reservation_content, 'email_reservation_content', array('wpautop' => false, 'media_buttons' => false, 'textarea_name' => 'email_reservation_content', 'textarea_rows' => 10, 'editor_class' => 'wpbc-textarea-tinymce', 'teeny' => true, 'drag_drop_upload' => false));
    /*
                                                      <textarea id="email_reservation_content" name="email_reservation_content" style="width:100%;" rows="10"><?php echo ($email_reservation_content); ?></textarea> /**/
    ?>
                                      <p class="description"><?php 
    printf(__('Type your %semail message content for checking booking%s in. ', 'booking'), '<b>', '</b>');
    ?>
</p>
                                </td>
                            </tr>
                            <tr><td></td>
                                <td>
                                      <?php 
    $skip_shortcodes = array('denyreason', 'paymentreason', 'visitorbookingediturl', 'visitorbookingcancelurl', 'visitorbookingpayurl', 'cost', 'bookingtype', 'check_in_date', 'check_out_date', 'dates_count');
    email_help_section($skip_shortcodes, sprintf(__('For example: "You have a new reservation %s on the following date(s): %s Contact information: %s You can approve or cancel this booking at: %s Thank you, Reservation service."', 'booking'), '', '[dates]&lt;br/&gt;&lt;br/&gt;', '&lt;br/&gt; [content]&lt;br/&gt;&lt;br/&gt;', htmlentities(' <a href="[moderatelink]">' . __('here', 'booking') . '</a> ') . '&lt;br/&gt;&lt;br/&gt; '));
    ?>
                                                      
                                </td>
                            </tr>
                        </tbody>
                    </table>

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

            </div>


            <div id="visibility_container_email_new_to_visitor" class="visibility_container" style="display:none;">

                <div class='meta-box'> <div <?php 
    $my_close_open_win_id = 'bk_settings_emails_to_person_after_new';
    ?>
  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', '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('Email to "Person" after they make a new reservation', 'booking');
    ?>
</span></h3> <div class="inside">


                    <table class="form-table email-table0" >
                        <tbody>
                            <tr>
                                <th scope="row"><?php 
    _e('Status', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_newbookingbyperson_adress">
                                            <input id="is_email_newbookingbyperson_adress" name="is_email_newbookingbyperson_adress" 
                                                   type="checkbox" <?php 
    if ($is_email_newbookingbyperson_adress == 'On') {
        echo "checked";
    }
    ?>
  
                                                   value="<?php 
    echo $is_email_newbookingbyperson_adress;
    ?>
" 
                                                   onchange="document.getElementById('booking_is_email_newbookingbyperson_adress_dublicated').checked=this.checked;"  
                                                   />
                                            <?php 
    _e('Active', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>
                            <tr valign="top">
                                <th scope="row"><label for="email_newbookingbyperson_adress" ><?php 
    _e('From', 'booking');
    ?>
:</label></th>
                                <td><input id="email_newbookingbyperson_adress"  name="email_newbookingbyperson_adress" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_newbookingbyperson_adress;
    ?>
" />
                                    <span class="description"><?php 
    printf(__('Type the default %sadmin email%s sending the booking confimation', 'booking'), '<b>', '</b>');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_newbookingbyperson_subject" ><?php 
    _e('Subject', 'booking');
    ?>
:</label></th>
                                    <td><input id="email_newbookingbyperson_subject"  name="email_newbookingbyperson_subject" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_newbookingbyperson_subject;
    ?>
" />
                                        <span class="description"><?php 
    printf(__('Type email subject for %svisitor after creating a new reservation%s.', 'booking'), '<b>', '</b>');
    ?>
</span>
                                    </td>
                            </tr>

                            <tr valign="top">
                                <th scope="row">
                                    <label for="email_newbookingbyperson_content" ><?php 
    _e('Content', 'booking');
    ?>
:</label></th>
                                <td>     <?php 
    /**/
    wp_editor($email_newbookingbyperson_content, 'email_newbookingbyperson_content', array('wpautop' => false, 'media_buttons' => false, 'textarea_name' => 'email_newbookingbyperson_content', 'textarea_rows' => 10, 'editor_class' => 'wpbc-textarea-tinymce', 'teeny' => true, 'drag_drop_upload' => false));
    /*
                                                      <textarea id="email_newbookingbyperson_content" name="email_newbookingbyperson_content" style="width:100%;" rows="10"><?php echo ($email_newbookingbyperson_content); ?></textarea> /**/
    ?>
                                      <p class="description"><?php 
    printf(__('Type your %semail message for visitor after creating a new reservation%s', 'booking'), '<b>', '</b>');
    ?>
</p>
                                </td>
                            </tr>
                            <tr><td></td>
                                <td>                                                      <?php 
    $skip_shortcodes = array('moderatelink', 'denyreason', 'paymentreason', 'visitorbookingpayurl', 'cost', 'bookingtype', 'check_in_date', 'check_out_date', 'dates_count');
    email_help_section($skip_shortcodes, sprintf(__('For example: "Your reservation %s on these date(s): %s is processing now! We will send confirmation by email. %s Thank you, Reservation service."', 'booking'), '', '[dates]', '&lt;br/&gt;&lt;br/&gt;[content]&lt;br/&gt;&lt;br/&gt;'));
    ?>
                            </td></tr>
                        </tbody>
                    </table>

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

            </div>


            <div id="visibility_container_email_approved" class="visibility_container" style="display:none;">

                <div class='meta-box'> <div <?php 
    $my_close_open_win_id = 'bk_settings_emails_to_person_after_approval';
    ?>
  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', '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('Email to "Person" after booking is approved', 'booking');
    ?>
</span></h3> <div class="inside">

                    <table class="form-table email-table0" >
                        <tbody>
                            <tr>    
                                <th scope="row"><?php 
    _e('Status', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_approval_adress">
                                            <input id="is_email_approval_adress" name="is_email_approval_adress" type="checkbox" 
                                                   <?php 
    if ($is_email_approval_adress == 'On') {
        echo "checked";
    }
    ?>
  
                                                   value="<?php 
    echo $is_email_approval_adress;
    ?>
" 
                                                   onchange="document.getElementById('booking_is_email_approval_adress_dublicated').checked=this.checked;" 
                                                   />
                                            <?php 
    _e('Active', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>
                            <tr>
                                <th scope="row"><?php 
    _e('Send to Admin', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_approval_send_copy_to_admin">
                                            <input id="is_email_approval_send_copy_to_admin" name="is_email_approval_send_copy_to_admin" 
                                                   type="checkbox" <?php 
    if ($is_email_approval_send_copy_to_admin == 'On') {
        echo "checked";
    }
    ?>
  
                                                   value="<?php 
    echo $is_email_approval_send_copy_to_admin;
    ?>
"                                                                    
                                                   />
                                            <?php 
    _e('Check this box to send copy of this email to Admin', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>                                            
                            <tr valign="top">
                                <th scope="row"><label for="email_approval_adress" ><?php 
    _e('From', 'booking');
    ?>
:</label></th>
                                <td><input id="email_approval_adress"  name="email_approval_adress" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_approval_adress;
    ?>
" />
                                    <span class="description"><?php 
    printf(__('Type the default %sadmin email%s sending the booking confimation', 'booking'), '<b>', '</b>');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_approval_subject" ><?php 
    _e('Subject', 'booking');
    ?>
:</label></th>
                                    <td><input id="email_approval_subject"  name="email_approval_subject" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_approval_subject;
    ?>
" />
                                        <span class="description"><?php 
    printf(__('Type your email subject for the %sapproved booking%s.', 'booking'), '<b>', '</b>');
    ?>
</span>
                                    </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_approval_content" ><?php 
    _e('Content', 'booking');
    ?>
:</label></th>
                                    <td>     <?php 
    /**/
    wp_editor($email_approval_content, 'email_approval_content', array('wpautop' => false, 'media_buttons' => false, 'textarea_name' => 'email_approval_content', 'textarea_rows' => 10, 'editor_class' => 'wpbc-textarea-tinymce', 'teeny' => true, 'drag_drop_upload' => false));
    /*
                                                      <textarea id="email_approval_content" name="email_approval_content" style="width:100%;" rows="10"><?php echo ($email_approval_content); ?></textarea> /**/
    ?>
                                      <p class="description"><?php 
    printf(__('Type your %semail message for the approved booking%s from the website', 'booking'), '<b>', '</b>');
    ?>
</p>
                                    </td>
                            </tr>
                            <tr valign="top"><td></td>
                                <td>
                                      <?php 
    $skip_shortcodes = array('moderatelink', 'denyreason', 'paymentreason', 'visitorbookingpayurl', 'cost', 'bookingtype', 'check_in_date', 'check_out_date', 'dates_count');
    email_help_section($skip_shortcodes, sprintf(__('For example: "Your reservation %s on these date(s): %s has been approved.%s Thank you, Reservation service."', 'booking'), '', '[dates]', '&lt;br/&gt;&lt;br/&gt;[content]&lt;br/&gt;&lt;br/&gt;'));
    ?>
                                </td>
                            </tr>
                        </tbody>
                    </table>

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

            </div>

            
            <div id="visibility_container_email_declined" class="visibility_container" style="display:none;">

                <div class='meta-box'> <div <?php 
    $my_close_open_win_id = 'bk_settings_emails_to_person_after_deny';
    ?>
  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', '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('Email to "Person" after their booking has been denied', 'booking');
    ?>
</span></h3> <div class="inside">


                    <table class="form-table email-table0" >
                        <tbody>

                            <tr>    
                                <th scope="row"><?php 
    _e('Status', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_deny_adress">
                                            <input id="is_email_deny_adress" name="is_email_deny_adress" type="checkbox" 
                                                <?php 
    if ($is_email_deny_adress == 'On') {
        echo "checked";
    }
    ?>
  
                                                   value="<?php 
    echo $is_email_deny_adress;
    ?>
" 
                                                   onchange="document.getElementById('booking_is_email_declined_adress_dublicated').checked=this.checked;"  />
                                            <?php 
    _e('Active', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>
                            <tr>
                                <th scope="row"><?php 
    _e('Send to Admin', 'booking');
    ?>
:</th>
                                <td>
                                    <fieldset>
                                        <label for="is_email_deny_send_copy_to_admin">
                                            <input id="is_email_deny_send_copy_to_admin" name="is_email_deny_send_copy_to_admin" 
                                                   type="checkbox" <?php 
    if ($is_email_deny_send_copy_to_admin == 'On') {
        echo "checked";
    }
    ?>
  
                                                   value="<?php 
    echo $is_email_deny_send_copy_to_admin;
    ?>
" 
                                                   />
                                            <?php 
    _e('Check this box to send copy of this email to Admin', 'booking');
    ?>
                                        </label>
                                    </fieldset>   
                                </td>
                            </tr>                                            

                            <tr valign="top">
                                <th scope="row"><label for="email_deny_adress" ><?php 
    _e('From', 'booking');
    ?>
:</label></th>
                                <td><input id="email_deny_adress"  name="email_deny_adress" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_deny_adress;
    ?>
" />
                                    <span class="description"><?php 
    printf(__('Type the default %sadmin email%s sending the booking confimation', 'booking'), '<b>', '</b>');
    ?>
</span>
                                </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_deny_subject" ><?php 
    _e('Subject', 'booking');
    ?>
:</label></th>
                                    <td><input id="email_deny_subject"  name="email_deny_subject" class="regular-text code" type="text" size="45" value="<?php 
    echo $email_deny_subject;
    ?>
" />
                                        <span class="description"><?php 
    printf(__('Type your email subject for the %sdenied booking%s.', 'booking'), '<b>', '</b>');
    ?>
</span>
                                    </td>
                            </tr>

                            <tr valign="top">
                                    <th scope="row"><label for="email_deny_content" ><?php 
    _e('Content', 'booking');
    ?>
:</label></th>
                                    <td>     <?php 
    /**/
    wp_editor($email_deny_content, 'email_deny_content', array('wpautop' => false, 'media_buttons' => false, 'textarea_name' => 'email_deny_content', 'textarea_rows' => 10, 'editor_class' => 'wpbc-textarea-tinymce', 'teeny' => true, 'drag_drop_upload' => false));
    /*
                                                      <textarea id="email_deny_content" name="email_deny_content" style="width:100%;" rows="10"><?php echo ($email_deny_content); ?></textarea> /**/
    ?>
                                        <p class="description"><?php 
    printf(__('Type your %semail message for the denied booking%s from the website', 'booking'), '<b>', '</b>');
    ?>
</p>
                                    </td>
                            </tr>

                            <tr valign="top"><td></td>
                                <td>
                                      <?php 
    $skip_shortcodes = array('moderatelink', 'paymentreason', 'visitorbookingpayurl', 'visitorbookingediturl', 'visitorbookingcancelurl', 'cost', 'bookingtype', 'check_in_date', 'check_out_date', 'dates_count');
    email_help_section($skip_shortcodes, sprintf(__('For example: "Your reservation %s on these date(s): %s has been canceled. Please contact us for more information. %s Thank you, Reservation service."', 'booking'), '', '[dates]', '&lt;br/&gt;&lt;br/&gt;[denyreason]&lt;br/&gt;&lt;br/&gt;[content]&lt;br/&gt;&lt;br/&gt;'));
    ?>

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

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

            </div>
            <span class="wpdevbk">
                <div <?php 
    $my_close_open_alert_id = 'bk_alert_settings_email_in_free';
    ?>
                    class="alert alert-block alert-info <?php 
    if ('1' == get_user_option('booking_win_' . $my_close_open_alert_id)) {
        echo 'closed';
    }
    ?>
"                             
                    id="<?php 
    echo $my_close_open_alert_id;
    ?>
">
                  <a class="close tooltip_left" rel="tooltip" title="Don't show the message anymore" data-dismiss="alert" href="javascript:void(0)"
                     onclick="javascript:verify_window_opening(<?php 
    echo get_bk_current_user_id();
    ?>
, '<?php 
    echo $my_close_open_alert_id;
    ?>
');"
                     >&times;</a>
                  <strong class="alert-heading">Note!</strong>
                      Check how in <a href="http://wpbookingcalendar.com/demo/" target="_blank" style="text-decoration:underline;">other versions of Booking Calendar</a> possible to customize email templates with new additional shortcodes</em>
                </div>
            </span>        
        <input class="button-primary button" style="float:right;" type="submit" value="<?php 
    _e('Save Changes', 'booking');
    ?>
" name="Submit"/>
        <div class="clear" style="height:10px;"></div>

        </form>
    </div>
    <?php 
}
    public function show()
    {
        // Check if this window is already Hided or not
        if ('1' == get_user_option('booking_win_' . $this->element_id)) {
            // Panel Hided
            return false;
        } else {
            // Show Panel
            ?>
<script type="text/javascript"> jQuery('#<?php 
            echo $this->element_id;
            ?>
').show(); </script><?php 
        }
        wp_nonce_field('wpbc_ajax_admin_nonce', "wpbc_admin_panel_dismiss_window_nonce", true, true);
        // Show Hide link
        ?>
<a class="<?php 
        echo $this->html_class;
        ?>
" href="javascript:void(0)" 
             onclick="javascript: wpbc_hide_window('<?php 
        echo $this->element_id;
        ?>
');
                                 wpbc_dismiss_window(<?php 
        echo get_bk_current_user_id();
        ?>
, '<?php 
        echo $this->element_id;
        ?>
');"
          ><?php 
        echo $this->title;
        ?>
</a><?php 
    }
function wpbc_gcal_extend_buttons_in_action_toolbar_booking_listing()
{
    $booking_gcal_feed = get_bk_option('booking_gcal_feed');
    $is_this_btn_disabled = false;
    if (!class_exists('wpdev_bk_personal') && $booking_gcal_feed == '') {
        $is_this_btn_disabled = true;
        $settigns_link = "admin.php?page=" . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . "wpdev-booking-option&tab=sync";
    } else {
        $booking_gcal_events_from = get_bk_option('booking_gcal_events_from');
        $booking_gcal_events_from_offset = get_bk_option('booking_gcal_events_from_offset');
        $booking_gcal_events_from_offset_type = get_bk_option('booking_gcal_events_from_offset_type');
        $booking_gcal_events_until = get_bk_option('booking_gcal_events_until');
        $booking_gcal_events_until_offset = get_bk_option('booking_gcal_events_until_offset');
        $booking_gcal_events_until_offset_type = get_bk_option('booking_gcal_events_until_offset_type');
        $booking_gcal_events_max = get_bk_option('booking_gcal_events_max');
        // $booking_gcal_timezone = get_bk_option( 'booking_gcal_timezone');
    }
    ?>
    <div id="wpbc_gcal_import_events" class="modal" style="display:none;width:59%;" >
       <div class="modal-header">
           <a class="close" data-dismiss="modal">&times;</a>
           <h3><?php 
    if ($is_this_btn_disabled) {
        _e('Warning!', 'booking');
    } else {
        _e('Retrieve Google Calendar Events ', 'booking');
    }
    ?>
</h3>
       </div>
       <div class="modal-body">
         <?php 
    if ($is_this_btn_disabled) {
        ?>
   
            <label class="help-block" style="display:block;">
                <?php 
        printf(__('Please configure settings for import Google Calendar events', 'booking'), '<b>', ',</b>');
        ?>
 
                <a href="<?php 
        echo $settigns_link;
        ?>
"><?php 
        _e('here', 'booking');
        ?>
</a>
            </label>
          <?php 
    } else {
        ?>

                <table class="visibility_gcal_feeds_settings form-table settings-table"  >
                    <tbody>
                    <?php 
        if (function_exists('wpbc_gcal_settings_content_field_selection_booking_resources')) {
            wpbc_gcal_settings_content_field_selection_booking_resources();
        } else {
            ?>
<input type="hidden" name="wpbc_booking_resource" id="wpbc_booking_resource" value="" /><?php 
        }
        wpbc_gcal_settings_content_field_from($booking_gcal_events_from, $booking_gcal_events_from_offset, $booking_gcal_events_from_offset_type);
        wpbc_gcal_settings_content_field_until($booking_gcal_events_until, $booking_gcal_events_until_offset, $booking_gcal_events_until_offset_type);
        wpbc_gcal_settings_content_field_max_feeds($booking_gcal_events_max);
        // wpbc_gcal_settings_content_field_timezone($booking_gcal_timezone);
        ?>
  
                    </tbody>
                </table>

          <?php 
    }
    ?>
 
       </div>
        <div class="modal-footer" style="text-align:center;"> 
         <?php 
    if ($is_this_btn_disabled) {
        ?>
   
         <a href="<?php 
        echo $settigns_link;
        ?>
" 
            class="button button-primary"  style="float:none;" >
             <?php 
        _e('Configure', 'booking');
        ?>
         </a>
         <?php 
    } else {
        ?>
         <a href="javascript:void(0)" class="button button-primary"  style="float:none;"                                        
            onclick="javascript:wpbc_import_gcal_events('<?php 
        echo get_bk_current_user_id();
        ?>
'
                                                            , [ jQuery('#booking_gcal_events_from').val(), jQuery('#booking_gcal_events_from_offset').val(), jQuery('#booking_gcal_events_from_offset_type').val() ]
                                                        , [ jQuery('#booking_gcal_events_until').val(), jQuery('#booking_gcal_events_until_offset').val(), jQuery('#booking_gcal_events_until_offset_type').val() ]
                                                        , jQuery('#booking_gcal_events_max').val()
                                                        , jQuery('#wpbc_booking_resource').val()
                 );jQuery('#wpbc_gcal_import_events').modal('hide');"
            ><?php 
        _e('Import Google Calendar Events', 'booking');
        ?>
</a>
         <?php 
    }
    ?>
   
         <a href="javascript:void(0)" class="button" style="float:none;" data-dismiss="modal"><?php 
    _e('Close', 'booking');
    ?>
</a>
       </div>
    </div>
    <div class="btn-group">                            
        <a  data-original-title="<?php 
    _e('Import Google Calendar Events', 'booking');
    ?>
"  rel="tooltip"
            class="tooltip_top button button-secondary<?php 
    if ($is_this_btn_disabled) {
        echo ' disabled';
    }
    ?>
" 
            <?php 
    if (true) {
        ?>
                onclick='javascript:jQuery("#wpbc_gcal_import_events").modal("show");'
            <?php 
    } else {
        ?>
                onclick="javascript:wpbc_import_gcal_events('<?php 
        echo get_bk_current_user_id();
        ?>
' );"
            <?php 
    }
    ?>
                            
           /><?php 
    _e('Import', 'booking');
    ?>
 <i class="icon-download"></i></a>
        <!--a data-original-title="<?php 
    _e('Export only current page of bookings to CSV format', 'booking');
    ?>
"  rel="tooltip" 
           class="tooltip_top  button button-secondary" onclick='javascript:export_booking_listing("page", "<?php 
    echo getBookingLocale();
    ?>
");'
           /> <i class="icon-chevron-down"></i></a-->
    </div>
    <?php 
}
        function settings_general_content()
        {
            $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'];
                //$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 = $_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'];
                }
                if (isset($_POST['multiple_day_selections'])) {
                    $multiple_day_selections = $_POST['multiple_day_selections'];
                }
                if (isset($_POST['is_delete_if_deactive'])) {
                    $is_delete_if_deactive = $_POST['is_delete_if_deactive'];
                }
                // check
                if (isset($_POST['wpdev_copyright'])) {
                    $wpdev_copyright = $_POST['wpdev_copyright'];
                }
                // 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['is_show_legend'])) {
                    $is_show_legend = $_POST['is_show_legend'];
                }
                // 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'];
                $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';
                    $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', $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( '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 ($this->get_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);
                }
                if (isset($multiple_day_selections)) {
                    $multiple_day_selections = 'On';
                } else {
                    $multiple_day_selections = 'Off';
                }
                update_bk_option('booking_multiple_day_selections', $multiple_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)) {
                    $wpdev_copyright = 'On';
                } else {
                    $wpdev_copyright = 'Off';
                }
                update_bk_option('booking_wpdev_copyright', $wpdev_copyright);
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////
                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');
                //$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_dif_colors_approval_pending = get_bk_option( 'booking_dif_colors_approval_pending' );
                $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');
                $multiple_day_selections = get_bk_option('booking_multiple_day_selections');
                $is_delete_if_deactive = get_bk_option('booking_is_delete_if_deactive');
                // check
                $wpdev_copyright = get_bk_option('booking_wpdev_copyright');
                // 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
                $is_show_legend = get_bk_option('booking_is_show_legend');
                // 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');
                $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>
<form  name="post_option" action="" method="post" id="post_option" >

    <div  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="admin_cal_count" ><?php 
            _e('Admin email', 'wpdev-booking');
            ?>
:</label></th>
                                    <td><input id="email_reservation_adress"  name="email_reservation_adress" class="regular-text code" type="text" style="width:350px;" size="145" value="<?php 
            echo $email_reservation_adress;
            ?>
" /><br/>
                                        <span class="description"><?php 
            printf(__('Type default %sadmin email%s for checking bookings', 'wpdev-booking'), '<b>', '</b>');
            ?>
</span>
                                    </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"><label for="is_use_hints_at_admin_panel" ><?php 
            _e('Show hints', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('Show / hide hints', 'wpdev-booking');
            ?>
</th>
                                    <td><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"/>
                                        <span class="description"><?php 
            _e(' Check, if you want to show help hints at the admin panel.', 'wpdev-booking');
            ?>
</span>
                                    </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');"
                                           style="text-decoration: none;font-weight: bold;font-size: 11px;">
                                           + <span style="border-bottom:1px dashed #21759B;"><?php 
            _e('Show advanced settings of JavaScript loading', 'wpdev-booking');
            ?>
</span>
                                        </span>
                                    </div>


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

                                    <tr valign="top">
                                        <th scope="row"><label for="is_not_load_bs_script_in_client" ><?php 
            _e('Dissable Bootstrap loading', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('Client side', 'wpdev-booking');
            ?>
</th>
                                        <td><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 dissbale of loading some JavaScripts Do you really want to do this?", 'wpdev-booking');
            ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"      
                                                   />
                                            <span class="description"><?php 
            _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can dissable  loading of this script by this plugin.', 'wpdev-booking');
            ?>
</span>
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <th scope="row"><label for="is_not_load_bs_script_in_admin" ><?php 
            _e('Dissable Bootstrap loading', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('Admin  side', 'wpdev-booking');
            ?>
</th>
                                        <td><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 dissbale of loading some JavaScripts Do you really want to do this?", 'wpdev-booking');
            ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"
                                                   />
                                            <span class="description"><?php 
            _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can dissable  loading of this script by this plugin.', 'wpdev-booking');
            ?>
</span>
                                        </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('#togle_settings_powered').slideToggle('normal');"
                                           style="text-decoration: none;font-weight: bold;font-size: 11px;">
                                           + <span style="border-bottom:1px dashed #21759B;"><?php 
            _e('Show settings of powered by notice', 'wpdev-booking');
            ?>
</span>
                                        </span>
                                    </div>

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

                                            <tr valign="top">
                                                <th scope="row"><label for="booking_is_show_powered_by_notice" ><?php 
            _e('Powered by notice', 'wpdev-booking');
            ?>
:</label></th>
                                                <td><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"/>
                                                    <span class="description"><?php 
            printf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.', 'wpdev-booking'), 'wpbookingcalendar.com');
            ?>
</span>
                                                </td>
                                            </tr>


                                            <tr valign="top">
                                                <th scope="row"><label for="wpdev_copyright" ><?php 
            _e('Copyright notice', 'wpdev-booking');
            ?>
:</label></th>
                                                <td><input id="wpdev_copyright" type="checkbox" <?php 
            if ($wpdev_copyright == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $wpdev_copyright;
            ?>
" name="wpdev_copyright"/>
                                                    <span class="description"><?php 
            printf(__(' Turn On/Off copyright %s notice at footer of site view.', 'wpdev-booking'), 'wpdevelop.com');
            ?>
</span>
                                                </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 
            //TODO: Read the conatct from 2 folders and show results at this select box, aqrray with values and names
            // Create 2 more skins: one black for freee versions
            // One modern light/white for paid versions
            $dir_list = $this->dirList(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 = '';
                }
                echo '<option ' . $selected_item . ' value="' . $value[1] . '" >' . $value[2] . '</option>';
            }
            ?>
                                        </select>
                                        <span class="description"><?php 
            _e('Select the skin of booking calendar', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>

                                <tr valign="top">
                                    <th scope="row"><label for="start_day_weeek" ><?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 < 13; $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 your maximum number of scroll months at booking calendar', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>

                                <tr valign="top">
                                    <th scope="row"><label for="start_day_weeek" ><?php 
            _e('Start Day of 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="multiple_day_selections" ><?php 
            _e('Multiple days selection', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('in calendar', 'wpdev-booking');
            ?>
</th>
                                    <td><input id="multiple_day_selections" type="checkbox" <?php 
            if ($multiple_day_selections == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $multiple_day_selections;
            ?>
" name="multiple_day_selections"/>
                                        <span class="description"><?php 
            _e(' Check, if you want have multiple days selection at calendar.', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>
                                
                                <?php 
            do_action('settings_advanced_set_range_selections');
            ?>
                                <?php 
            do_action('settings_advanced_set_fixed_time');
            ?>
                                <?php 
            do_action('settings_set_show_cost_in_tooltips');
            ?>
                                <?php 
            do_action('settings_set_show_availability_in_tooltips');
            ?>
                                

                                <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"><label for="is_dif_colors_approval_pending" ><?php 
            _e('Unavailable days', 'wpdev-booking');
            ?>
:</label></th>
                                    <td>    <div style="float:left;width:500px;border:0px solid red;">
                                            <input id="unavailable_day0" name="unavailable_day0" <?php 
            if ($unavailable_day0 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day0;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Sunday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day1" name="unavailable_day1" <?php 
            if ($unavailable_day1 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day1;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Monday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day2" name="unavailable_day2" <?php 
            if ($unavailable_day2 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day2;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Tuesday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day3" name="unavailable_day3" <?php 
            if ($unavailable_day3 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day3;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Wednesday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day4" name="unavailable_day4" <?php 
            if ($unavailable_day4 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day4;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Thursday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day5" name="unavailable_day5" <?php 
            if ($unavailable_day5 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day5;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Friday', 'wpdev-booking');
            ?>
</span>&nbsp;
                                            <input id="unavailable_day6" name="unavailable_day6" <?php 
            if ($unavailable_day6 == 'On') {
                echo "checked";
            }
            ?>
  value="<?php 
            echo $unavailable_day6;
            ?>
"  type="checkbox" />
                                            <span class="description"><?php 
            _e('Saturday', 'wpdev-booking');
            ?>
</span>
                                        </div>
                                        <div style="width:auto;margin-top:25px;">
                                           <span class="description"><?php 
            _e('Check unavailable days in calendars. This option is overwrite all other settings.', 'wpdev-booking');
            ?>
</span></div>
                                    </td>
                                </tr>


                    </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>

                                <tr valign="top">
                                    <th scope="row"><label for="is_use_captcha" ><?php 
            _e('CAPTCHA', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('at booking form', 'wpdev-booking');
            ?>
</th>
                                    <td><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"/>
                                        <span class="description"><?php 
            _e(' Check, if you want to activate CAPTCHA inside of booking form.', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>

                                <tr valign="top">
                                    <th scope="row"><label for="is_use_autofill_4_logged_user" ><?php 
            _e('Auto fill fields', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('for logged in users', 'wpdev-booking');
            ?>
</th>
                                    <td><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"/>
                                        <span class="description"><?php 
            _e(' Check, if you want activate auto fill fields of booking form for logged in users.', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>




                                <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, if you want to show legend of dates under booking calendar.', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>

                        <tr valign="top" style="padding: 0px;">


                                <td style="width:50%;font-weight: bold;"><input  <?php 
            if ($type_of_thank_you_message == 'message') {
                echo 'checked="checked"';
            }
            /**/
            ?>
 value="message" type="radio" id="type_of_thank_you_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');"  /> <label for="type_of_thank_you_message" ><?php 
            _e('Show "thank you" message after booking is done', 'wpdev-booking');
            ?>
</label></td>
                                <td style="width:50%;font-weight: bold;"><input  <?php 
            if ($type_of_thank_you_message == 'page') {
                echo 'checked="checked"';
            }
            /**/
            ?>
 value="page" type="radio" id="type_of_thank_you_message"  name="type_of_thank_you_message"  onclick="javascript: jQuery('#togle_settings_thank-you_page').slideDown('normal');jQuery('#togle_settings_thank-you_message').slideUp('normal');"  /> <label for="type_of_thank_you_message" ><?php 
            _e('Redirect visitor to a new "thank you" page', 'wpdev-booking');
            ?>
 </label></td>



                        </tr>
                        <tr valign="top" style="padding: 0px;"><td colspan="2">
                            <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" style="font-size:12px;" ><?php 
            _e('New booking title', 'wpdev-booking');
            ?>
:</label><br/>
            <?php 
            printf(__('%sshowing after%s booking', 'wpdev-booking'), '<span style="color:#888;font-weight:bold;">', '</span>');
            ?>
                                            </th>
                                            <td>
                                                <input id="new_booking_title" class="regular-text code" type="text" size="45" value="<?php 
            echo $new_booking_title;
            ?>
" name="new_booking_title" style="width:99%;"/>
                                                <span class="description"><?php 
            printf(__('Type title of new booking %safter booking has done by user%s', 'wpdev-booking'), '<b>', '</b>');
            ?>
</span>
                                                <?php 
            make_bk_action('show_additional_translation_shortcode_help');
            ?>
                                            </td>
                                </tr>
                                <tr><th>
                                            <label for="new_booking_title" style=" font-weight: bold;font-size: 12px;" ><?php 
            _e('Showing title time', 'wpdev-booking');
            ?>
:</label><br/>
            <?php 
            printf(__('%snew booking%s', 'wpdev-booking'), '<span style="color:#888;font-weight:bold;">', '</span>');
            ?>
                                            </th>
                                        <td>
                                            <input id="new_booking_title_time" class="regular-text code" type="text" size="45" value="<?php 
            echo $new_booking_title_time;
            ?>
" name="new_booking_title_time" />
                                            <span class="description"><?php 
            printf(__('Type in miliseconds count of time for showing new booking title', 'wpdev-booking'), '<b>', '</b>');
            ?>
</span>
                                        </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" style="width:170px;"><label for="thank_you_page_URL" ><?php 
            _e('URL of "thank you" page', 'wpdev-booking');
            ?>
:</label></th>
                                    <td><input value="<?php 
            echo $thank_you_page_URL;
            ?>
" name="thank_you_page_URL" id="thank_you_page_URL" class="regular-text code" type="text" size="45"  style="width:99%;" />
                                        <span class="description"><?php 
            printf(__('Type URL of %s"thank you" page%s', 'wpdev-booking'), '<b>', '</b>');
            ?>
</span>
                                    </td>
                                </tr>
                            </table>


                    </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_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');
            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">
                                    <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>

                                <?php 
            make_bk_action('wpdev_bk_general_settings_set_default_booking_resource');
            ?>
                                
                                <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 code" 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;';
            ?>
            <?php 
            printf(__('Type your date format for showing in emails and booking table. %sDocumentation on date formatting.%s', 'wpdev-booking'), '<br/><a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">', '</a>');
            ?>
                                    </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 default type of dates view at 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 style="width:35%; float:left;">

            <?php 
            $version = $this->get_version();
            if (wpdev_bk_is_this_demo()) {
                $version = 'free';
            }
            if ($version !== 'free' && $version !== 'biz_l') {
                $this->showUpgradeWindow($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 
            $this->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('Recomended 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 loyout, 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">
                                <td colspan="2">
                                    <span class="description"><?php 
            _e('Select user access level for the menu pages of plugin', 'wpdev-booking');
            ?>
</span>
                                </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_useraccess').slideToggle('normal');"
                                           style="text-decoration: none;font-weight: bold;font-size: 11px;">
                                           + <span style="border-bottom:1px dashed #21759B;"><?php 
            _e('Show settings of user access level to admin menu', 'wpdev-booking');
            ?>
</span>
                                        </span>
                                    </div>

                                    <table id="togle_settings_useraccess" style="display:none;" class="hided_settings_table">
                                        <tr valign="top"-->

                                            <th scope="row"><label for="start_day_weeek" ><?php 
            _e('Bookings', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('menu page', 'wpdev-booking');
            ?>
</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="start_day_weeek" ><?php 
            _e('Add booking', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('access level', 'wpdev-booking');
            ?>
</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><br><?php 
                _e('access level', 'wpdev-booking');
                ?>
</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="start_day_weeek" ><?php 
            _e('Settings', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('access level', 'wpdev-booking');
            ?>
</th>
                                            <td>
                                                <select id="user_role_settings" name="user_role_settings">
                                                    <option <?php 
            if ($user_role_settings == 'subscriber') {
                echo "selected";
            }
            ?>
 value="subscriber" ><?php 
            echo translate_user_role('Subscriber');
            ?>
</option>
                                                    <option <?php 
            if ($user_role_settings == 'administrator') {
                echo "selected";
            }
            ?>
 value="administrator" ><?php 
            echo translate_user_role('Administrator');
            ?>
</option>
                                                    <option <?php 
            if ($user_role_settings == 'editor') {
                echo "selected";
            }
            ?>
 value="editor" ><?php 
            echo translate_user_role('Editor');
            ?>
</option>
                                                    <option <?php 
            if ($user_role_settings == 'author') {
                echo "selected";
            }
            ?>
 value="author" ><?php 
            echo translate_user_role('Author');
            ?>
</option>
                                                    <option <?php 
            if ($user_role_settings == 'contributor') {
                echo "selected";
            }
            ?>
 value="contributor" ><?php 
            echo translate_user_role('Contributor');
            ?>
</option>
                                                </select>
            <?php 
            if (wpdev_bk_is_this_demo()) {
                ?>
 <br/><span class="description" style="font-weight: bold;">You do not allow to change this items because right now you test DEMO</span> <?php 
            }
            ?>
                                            </td>
                                        </tr>
                                    <!--/table>
                                    </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('Uninstal / deactivation', 'wpdev-booking');
            ?>
</span></h3> <div class="inside">
                    <table class="form-table"><tbody>


                                <tr valign="top">
                                    <th scope="row"><label for="is_delete_if_deactive" ><?php 
            _e('Delete booking data', 'wpdev-booking');
            ?>
:</label><br><?php 
            _e('when plugin deactivated', 'wpdev-booking');
            ?>
</th>
                                    <td><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, at uninstall process of this plugin all your booking data will be deleted. Do you really want to do this?", 'wpdev-booking');
            ?>
'); if ( answer){ this.checked = true; } else {this.checked = false;} }"
                                               />
                                        <span class="description"><?php 
            _e(' Check, if you want delete booking data during uninstalling plugin.', 'wpdev-booking');
            ?>
</span>
                                    </td>
                                </tr>

                    </tbody></table>

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

    </div>

    <div class="clear" style="height:10px;"></div>
    <input class="button-primary" style="float:right;" type="submit" value="<?php 
            _e('Save Changes', 'wpdev-booking');
            ?>
" name="Submit"/>
    <div class="clear" style="height:10px;"></div>



</form>
            <?php 
        }