<?php  

include(dirname(__FILE__).'/header.php');
include(dirname(__FILE__).'/user_session_check.php');
include(dirname(dirname(__FILE__)) . "/objects/class_adminprofile.php");
include(dirname(dirname(__FILE__)) . "/objects/class_services.php");
$con = new cleanto_db();
$conn = $con->connect();

$objservice = new cleanto_services();
$objservice->conn = $conn;


?>
    <script type="text/javascript">
        var ajax_url = '<?php echo AJAX_URL;?>';
        var base_url = '<?php echo BASE_URL;?>';
        var profile_site_url = {'prof_site_url':'<?php echo SITE_URL;?>'};
    </script>
    <script>
        jQuery(document).on('change','input[name="second-widget-loading"]', function(){
            if(jQuery(this).val()=='on_btn_click'){
                jQuery('#button-click-content').show( "slide", {direction: "up" }, 1000 );
            }else{
                jQuery('#button-click-content').hide( "slide", {direction: "up" }, 500  );
            }
        });
    </script>
<?php 
 $ct_cart_scrollable =  $setting->get_option('ct_cart_scrollable');

$userembeddcode ='<div id="cleanto" class="direct-load" data-url="'.SITE_URL.'"></div><script src="'.SITE_URL.'assets/js/jquery-2.1.4.min.js" type="text/javascript"></script><script src="'.SITE_URL.'assets/js/embed.js?time='.time().'" type="text/javascript" ></script>';

?>
    <div id="cta-profile" class="panel tab-content">
        <div class="panel-body">
            <div class="ct-admin-profile-details tab-content col-md-9 col-sm-9 col-lg-9 col-xs-12">
                <div class="col-lg-7 col-md-8 col-sm-12 col-xs-12 ">
                    <h4 class="header4"><?php echo $label_language_values['get_embed_code_to_show_booking_widget_on_your_website'];?></h4>
                   
                    <div class="cta-embed-button cb">
                        <form class="form-horizontal">
                            <ol class="ct-embed-code">
                                <li class="embed-code-li necessary_option_check">
                                    <span class="ct-embed-count"><?php echo $label_language_values['please_set_below_values'];?></span>
                                    <div class="ct-embed-code">
                                        <div class="check_options_left_toset">
                                            <!-- Check for the options are set or not -->
                                            <!-- Check for the options are set or not END -->
                                        </div>
                                    </div>
                                </li>
                                <li class="embed-code-li all_ok">
                                    <span class="ct-embed-count"><?php echo $label_language_values['0_1'];?></span>
                                    <?php  echo $label_language_values['widget_loading_style'];?>
                                    <div class="ct-embed-code">
                                        <div class="ct-custom-new-radio">
                                            <ul class="ct-new-radio-list np">
                                                <li>
                                                    <input id="show-on-page-load" class="ct-radio ad_button_type" name="second-widget-loading" value="show_on_page_load" checked="checked" type="radio">
                                                    <label for="show-on-page-load"><span></span>  <?php  echo $label_language_values['show_on_page_load'];?></label>
                                                </li>
                                                <li>
                                                    <input id="show-on-btnclick" class="ct-radio ad_button_type" name="second-widget-loading" value="on_btn_click" type="radio">
                                                    <label for="show-on-btnclick"><span></span><?php echo $label_language_values['show_on_a_button_click'];?></label>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="show-on-btn-click" id="button-click-content">
                                        <ol class="ct-embed-code second-child-ol">
                                            <li class="embed-code-li">
                                                <span class="ct-embed-count"><?php echo $label_language_values['1_1'];?></span>
                                                <?php  echo $label_language_values['button_position'];?>
                                                <div class="ct-embed-code">
                                                    <div class="ct-custom-new-radio">
                                                        <ul class="ct-new-radio-list np">
                                                            <li>
                                                                <input id="show-embed-position" class="ct-radio ad_button_type" name="third-button-position" value="" checked="checked" type="radio">
                                                                <label for="show-embed-position"><span></span>
                                                                    <?php  echo $label_language_values['show_button_on_given_embeded_position'];?></label>
                                                            </li>
                                                      
                                                        </ul>
                                                    </div>
                                                </div>
                                                <div class="ct-embed-code col-md-12">
                                                    <label><?php echo $label_language_values['online_booking_button_style'];?> </label>
                                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                                        <h5 class="header5 mt-20"><?php echo $label_language_values['background_color'];?></h5>
                                                        <input type="text" value="<?php echo $setting->get_option('ct_secondary_color_admin');?>" name="ct_bookbtn_bg_color" id="ct-bookbtn-bg-color" class="form-control demo" data-control="saturation" value="" />
                                                    </div>
                                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                                        <h5 class="header5 mt-20"><?php echo $label_language_values['text_color'];?></h5>
                                                        <input type="text" value="<?php echo $setting->get_option('ct_text_color_admin');?>" name="ct_bookbtn_text_color" id="ct-bookingtxt-color" class="form-control demo ct-bookbtn-text-color" data-control="saturation" value="" />
                                                    </div>
                                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                                        <h5 class="header5 mt-20"><?php echo $label_language_values['button_text'];?></h5>
                                                        <input id="cta-step3" class="form-control" placeholder="Book Now" type="text">
                                                    </div>
                                                    <div class="col-md-6 col-sm-12 col-xs-12">
                                                        <h5 class="header5 mt-20"><?php echo $label_language_values['button_preview'];?></h5>
                                                        <a class="btn buttonpreview" id="buttonpreview" style="background-color: <?php  echo  $setting->get_option('ct_secondary_color_admin');?>;color: <?php  echo $setting->get_option('ct_text_color_admin');?>;"><?php echo $label_language_values['book_now'];?></a>
                                                    </div>
                                                </div>
                                            </li>
                                            <script>
                                                var tmpembedbackground = '<?php echo  $setting->get_option('ct_secondary_color_admin');?>';
                                                var tmpembedcolor = '<?php echo $setting->get_option('ct_text_color_admin');?>';
                                                var tmpembedbuttontxt = "Book Now";
                                                var tmpembedClassname = "button-new";
                                                var encryptedbid = 1;
												var jquery_url = "<script type=text/javascript src=<?php  echo SITE_URL ?>assets/js/jquery-2.1.4.min.js>";
                                                var url = "<?php echo SITE_URL."assets/js/embed.js?time=".time();?>";
                                                var sites_urls = "<?php echo SITE_URL;?>";
                                                jQuery(document).on('click','#show-on-btnclick',function(){
                                                    jQuery('#cta-user-embedd-code').html('&#x3C;a id=&#x22;cleanto&#x22; data-url=\"'+sites_urls+'\"style=\&#x22;background:'+tmpembedbackground+';color:'+tmpembedcolor+'\&#x22;   class=\&#x22;'+tmpembedClassname+'\&#x22;&#x3E;'+tmpembedbuttontxt+'&#x3C;/a&#x3E;&#x3C;script src=\&#x22;'+url+'\&#x22; id=\&#x22;'+encryptedbid+'\&#x22; type=\&#x22;text/javascript\&#x22; &#x3E;&#x3C;/script&#x3E;');
                                                });
                                                jQuery(document).on('blur','#ct-bookbtn-bg-color',function(){
                                                    jQuery("#buttonpreview").css('background-color', jQuery('#ct-bookbtn-bg-color').val());
                                                    tmpembedbackground = jQuery('#ct-bookbtn-bg-color').val();
                                                    jQuery('#show-on-btnclick').trigger("click");
                                                });
                                                jQuery(document).on('blur','#ct-bookingtxt-color',function(){
                                                    jQuery("#buttonpreview").css('color', jQuery('#ct-bookingtxt-color').val());
                                                    tmpembedcolor = jQuery('#ct-bookingtxt-color').val();
                                                    jQuery('#show-on-btnclick').trigger("click");
                                                });
                                                jQuery(document).on('keyup','#cta-step3',function(){
                                                    jQuery("#buttonpreview").html( jQuery('#cta-step3').val());
                                                    tmpembedbuttontxt = jQuery('#cta-step3').val();
                                                    jQuery('#show-on-btnclick').trigger("click");
                                                });
                                                jQuery(document).on('click','#scroll-btn-to-website',function(){
                                                    if(jQuery(this).is(':checked')) {
                                                        tmpembedClassname = 'side-button-new';
                                                        jQuery('#show-on-btnclick').trigger("click");
                                                    }
                                                });
                                                jQuery(document).on('click','#show-embed-position',function(){
                                                    if(jQuery(this).is(':checked')) {
                                                        tmpembedClassname = 'button-new';
                                                        jQuery('#show-on-btnclick').trigger("click");
                                                    }
                                                });
                                                jQuery(document).on('click','#new-window-tab',function(){
                                                    if(jQuery(this).is(':checked')) {
                                                        tmpembedClassname = 'button-new';
                                                        jQuery('#show-on-btnclick').trigger("click");
                                                    }
                                                });
                                                jQuery(document).on('click','#show-popup-widget',function(){
                                                    if(jQuery(this).is(':checked')) {
                                                        tmpembedClassname = 'button-pop';
                                                        jQuery('#show-on-btnclick').trigger("click");
                                                    }
                                                });
                                                jQuery(document).on('click','#show-on-page-load',function(){
                                                    jQuery('#cta-user-embedd-code').html('&#x3C;div id=&#x22;cleanto&#x22; data-url=\"'+sites_urls+'\" class=\&#x22;direct-load&#x22;&#x3E;&#x3C;/div&#x3E;&#x3C;script src=\"'+sites_urls+'assets/js/jquery-2.1.4.min.js\" type=\"text/javascript\"&#x3E;&#x3C;/script&#x3E;&#x3C;script src=\&#x22;'+url+'\&#x22; type=\&#x22;text/javascript\&#x22; &#x3E;&#x3C;/script&#x3E;');
                                                });
                                            </script>
                                            <li class="embed-code-li">
                                                <span class="ct-embed-count"><?php echo $label_language_values['1_2'];?></span>
                                                <?php  echo $label_language_values['behaviour_on_click_of_button'];?>
                                                <div class="ct-embed-code">
                                                    <div class="ct-custom-new-radio">
                                                        <ul class="ct-new-radio-list np">
                                                            <li>
                                                                <input id="new-window-tab" class="ct-radio ad_button_type" name="fourth-on-click-button" value="" checked="checked" type="radio">
                                                                <label for="new-window-tab"><span></span>
                                                                    <?php  echo $label_language_values['open_widget_in_a_new_page'];?></label>
                                                            </li>
                                                      
                                                        </ul>
                                                    </div>
                                                </div>
                                            </li>
													<!--									<li class="embed-code-li">
                                                <span class="ct-embed-count"><?php echo $label_language_values['1_2'];?></span>
                                                <?php  echo $label_language_values['behaviour_on_click_of_button'];?>
                                                <div class="ct-embed-code">
                                                    <div class="ct-custom-new-radio">
                                                        <ul class="ct-new-radio-list np">
                                                            <li>
                                                                <input id="new-window-tab" class="ct-radio ad_button_type" name="fourth-on-click-button" value="" checked="checked" type="radio">
                                                                <label for="new-window-tab"><span></span>
                                                                    <?php  echo $label_language_values['open_widget_in_a_new_page'];?></label>
                                                            </li>
                                                      
                                                        </ul>
                                                    </div>
                                                </div>
                                            </li>-->
                                        </ol>
                                    </div>
                                </li>
                                <li class="embed-code-li  all_ok">
                                    <span class="ct-embed-count"><?php echo $label_language_values['0_2'];?></span>
                                    <?php  echo $label_language_values['get_the_embeded_code'];?>
                                    <div class="ct-embed-code">
                                        <textarea class="form-control cta-user-embedd-code" readonly="" id="cta-user-embedd-code" rows="6"><?php echo htmlspecialchars_decode($userembeddcode); ?></textarea>
                                        <div class="ct-embed-code-help"><?php echo $label_language_values['please_copy_above_code_and_paste_in_your_website'];?></div>
                                    </div>
                                </li>
																<li class="embed-code-li  all_ok">
																		<span class="ct-embed-count"><?php echo $label_language_values['0_3'];?></span>
																		<?php echo $label_language_values['service_based_embed_code'];?>
																		<div class="ct-embed-code">
																			  <div class="col-md-3 col-sm-12 sel-ser col-xs-12 col-lg-12 mb-10">											
																				<select multiple name="service_name" id="service_name" class="service_name" data-size="10" data-live-search="true">										
																					<?php $services_data = $objservice->readall_for_frontend_services();
																				
																				if (mysqli_num_rows($services_data) > 0) {
																				while ($s_arr = mysqli_fetch_array($services_data)) {	
																				?>							
																					<option value="<?php  echo $s_arr['id']; ?>" data-id="<?php  echo $s_arr['id']; ?>"><?php  echo $s_arr['title']; ?></option>
																				<?php }} ?>
																				</select>								
																				</div>	
																			<div class="col-md-6 col-sm-12 col-xs-12">
																				<a class="genrate_embed" id="genrate_embed"><?php echo $label_language_values['genrate_embed'];?></a>
																			</div>
																					
																				 
																			<textarea  class="form-control cta-user-embedd-code-service mt-10" readonly="" id="cta-user-embedd-code-service" rows="6"></textarea>
																			<div class="ct-embed-code-help"><?php echo $label_language_values['please_copy_above_code_and_paste_in_your_website'];?></div>
																		</div>
																</li>
																
																
                            </ol>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php 
include(dirname(__FILE__).'/footer.php');
?>