
<? global $vis_language;?>
<link href="<?= VIS_PATH_SCRIPT; ?>colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
   <div class="col-sm-6">
      <h3 class="m-b-xs text-black"><? echo $operation['view_title'];?></h3>
      <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
            <li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME']; ?></a></li>
            <li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><? echo $vis_language['TXTSETTINGS']; ?></a></li>
            <li class="active"><? echo $operation['view_title']; ?></li>
      </ul>
      <div>
      </div>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $vis_language['TXTCLIENTPORTAL']; ?></header>
      <div class="panel-body" >
		  
         <form class="form-horizontal" action="index.php" method="post" name="vis_portal_setting" id="vis_portal_setting" enctype="multipart/form-data" target="vis_hidden_frame">
		 <? if(count($domain) > 1 && VIS_ADMIN_ACCESS_LEVEL==1) { ?>
			<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTSATELLITEHELPDESK']; ?></label>
               <div class="col-sm-10">
					<div class="radio i-checks">
						<label class="m-r-xl pull-left" data-toggle="popover1"><input type="radio" name="vis_satellite_helpdesk" id="vis_satellite_helpdesk1"  value="1"<? if((isset($poral_setting['vis_satellite_helpdesk']) && $poral_setting['vis_satellite_helpdesk'] == 1) || !isset($operation['vis_satellite_helpdesk'])) echo ' checked="checked"'; ?>/><i></i><? echo 'OptionA'; ?></label>
						<label class="m-r-xl pull-left" data-toggle="popover2"><input type="radio" name="vis_satellite_helpdesk" id="vis_satellite_helpdesk2" value="2"<? if(isset($poral_setting['vis_satellite_helpdesk']) && $poral_setting['vis_satellite_helpdesk'] == 2) echo ' checked="checked"'; ?>/><i></i><? echo 'OptionB'; ?></label>
						<label class="pull-left" data-toggle="popover3"><input type="radio" name="vis_satellite_helpdesk" id="vis_satellite_helpdesk3" value="3"<? if(isset($poral_setting['vis_satellite_helpdesk']) && $poral_setting['vis_satellite_helpdesk'] == 3) echo ' checked="checked"'; ?>/><i></i><? echo 'OptionC'; ?></label>
					  </div>
                </div>
               <label class="col-sm-2 control-label"></label>
               <div class="col-sm-10"><label>Please read option A, B and C carefully and then set it as per your business requirement, We recommend setting this option at the initial setup and avoid switching between it later as it may cause operational issues.</label></div>
            </div>
		 <? } ?>
		 <div id="vis_portal_setting_div" > 
		  <?include(VIS_PATH_TEMPLATE.'portal_setting_form.php');?>
		  </div>
		  </form>
		  </div>
        
   </section>
</section>
<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>
<script src="<?= VIS_PATH_SCRIPT; ?>colorpicker/js/bootstrap-colorpicker.js"></script>
<script>
	var tes = '<? echo calulate_timezone($domain_details['timezone'])."#".$domain_details['timezone_name']; ?>';
    $("#vis_timezone").val(tes);
    $(".selectpicker").selectpicker();
	function toggle_logo(e) {
		if(e.value=='image') {
			$("#vis_logo_image").css("display","");
			$("#vis_logo_text").css("display","none");
			$("#text_logo").css("display","none");
			$("#image_logo").css("display","");
		}
		else {
			$("#vis_logo_text").css("display","");
			$("#vis_logo_image").css("display","none");
			$("#text_logo").css("display","");
			$("#image_logo").css("display","none");
		}
	 }
	 function clear_logo()
	 {
		$('#clear_client_logo_Img').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'remove_logo'});
	 }
	 function clear_favicon()
	 {
		$('#clear_client_favicon_Img').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'remove_logo','vis_favicon_clear':1});
	 }
        function change(page, value, options,portal_setting) { 
			if(options=='Login'){
            $("#default_homepage").show(); 
            var dropdown_count =  $("#count").val();
			}
			else if(options=='Service catalog' || options=='View tickets'){
			$("#default_homepage_after_login").show();             
            var dropdown_count_after_login =  $("#after_login_count").val(); 
			}
			else {  
			$("#default_homepage").show(); 
            var dropdown_count =  $("#count").val();
            $("#default_homepage_after_login").show();             
            var dropdown_count_after_login =  $("#after_login_count").val(); 
			}
           if(page == 1 ) { 
			   if(options=='Login'){
			   dropdown_count++;
			   $("#count").val(dropdown_count);
			   changeSelect('vis_default_home_operation', value, options);
			   }else if(options=='Service catalog' || options=='View tickets')
			   {
				  dropdown_count_after_login++; 
				  $("#after_login_count").val(dropdown_count_after_login);
				  changeSelect('vis_default_page_after_login', value, options);
			   }
			   else {
			   dropdown_count_after_login++; 
               dropdown_count++;
			   $("#count").val(dropdown_count);
			   $("#after_login_count").val(dropdown_count_after_login);
               changeSelect('vis_default_home_operation', value, options);
			   changeSelect('vis_default_page_after_login', value, options);
			}
        }
           else if(page == 0 ) {
			    if(options=='Login'){
				   $("select#vis_default_home_operation option[value='"+value+"']").remove();  
				   dropdown_count--;
				   $("#count").val(dropdown_count);
				}else if(options=='Service catalog' || options=='View tickets')
				{
				   $("select#vis_default_page_after_login option[value='"+value+"']").remove();
				   dropdown_count_after_login--;
				   $("#after_login_count").val(dropdown_count_after_login);
				}else{	
				   $("select#vis_default_home_operation option[value='"+value+"']").remove();  
				   $("select#vis_default_page_after_login option[value='"+value+"']").remove();  
                   dropdown_count--;
                   dropdown_count_after_login--;
                   $("#count").val(dropdown_count);
                   $("#after_login_count").val(dropdown_count_after_login);
			   }
			   if(dropdown_count < 1) $("#default_homepage").hide();
			   if(dropdown_count_after_login < 1) $("#default_homepage_after_login").hide();
           }
       }
        function changeSelect(fieldID, newValues, newOptions)
        {
          selectField = document.getElementById(fieldID);                  
          if (newValues && newOptions)
          {
             selectField.options[selectField.length] = new Option(newOptions, newValues);
          }
        }
</script>
<script>
$(function() {
   	function createColorpickers() {
   		$('.demo-auto').colorpicker();
   	}
   	createColorpickers();
	
	$("[id^='vis_satellite_helpdesk']").bind('click', function() {
		//console.log(this.id);
		if(this.id == 'vis_satellite_helpdesk3') {
			$("#domain_list").hide();
		} else {
			$("#domain_list").show();
		}		
	});	
 });
 	$("[data-toggle=popover1]").popover({
		placement: "bottom",
		content: "This option offers - <br>1) Single staff portal to manage multiple companies / brands / products support at one place.<br>2) Each Company can have its own customer portal.<br>3) Cutomer registered on company A customer portal can not use same login on Company B customer portal.<br>4) Tickets from company A cannot be moved to Company B.",
		trigger: "hover",
		html: 'true'
	});
	$("[data-toggle=popover2]").popover({
		placement: "bottom",
		content: "This option offers - <br>1) Single staff portal to manage multiple companies / brands / products support at one place.<br>2) Each Company can have its own customer portal.<br>3) Cutomer registered on company A customer portal can use same login on Company B customer portal and vice versa.<br>4) Tickets from company A can be moved to Company B and vice versa.",
		trigger: "hover",
		html: 'true'
	});
	$("[data-toggle=popover3]").popover({
		placement: "bottom",
		content: "This option offers - <br>1) Single staff portal to manage multiple companies / brands / products support at one place.<br>2) Single Customer portal<br>3) Tickets from company A can be moved to Company B and vice versa.",
		trigger: "hover",
		html: 'true'
	});
	
	function showpagesetting(id)
	{
		if(id==1){
			$('#pagesettings').hide();
		}else{
			$('#pagesettings').show();
		}
		
	}
function showcustomdatetime(setv){
		if(setv=='custom'){
			$('#customdtm').removeClass('hide');
			$('#customdtm').addClass('show');
		}else{
			$('#customdtm').removeClass('show');
			$('#customdtm').addClass('hide');
		}
		
	}
	
</script>

