<? global $vis_language; ?>
<link href="<?= VIS_PATH_SCRIPT; ?>colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<section class="padder">
 <section class="panel-default">
  <div class="panel-body">
    <form action="index.php" class="form-horizontal" method="post" name="vis_mng_portal_setting" id="vis_mng_portal_setting" enctype="multipart/form-data">
        <div class="form-group">
			<label class="col-sm-3 control-label" >Logo</label>
			<div class="col-sm-9">
				<div class="col-sm-2">
					<div class="radio i-checks pull-left">
					  <label>
						<input type="radio" value="image" name="vis_logo" onclick="toggle_logo(this);" <? if($poral_settingm['vis_manage_logo']=='image' || empty($poral_settingm['vis_manage_logo'])) echo 'checked="checked"'; ?>><i></i><?= $vis_language['TXTIMG'];?>
					  </label>
					</div>
				</div>
				<div class="col-sm-2">
					<div class="radio i-checks pull-left">
					  <label>
						<input type="radio" value="text" name="vis_logo" onclick="toggle_logo(this);" <? if($poral_settingm['vis_manage_logo']=='text') echo 'checked="checked"'; ?>><i></i><?= $vis_language['TXTTEXT'];?>
					  </label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label" id="image_logo" <? echo (((isset($poral_settingm['vis_manage_logo'])) && $poral_settingm['vis_manage_logo']=='image') || empty($poral_settingm['vis_manage_logo']))?'style="display:"':'style="display:none"'; ?>></label>
				<label class="col-sm-3 control-label" id="text_logo" <?echo ((isset($poral_setting['vis_manage_logo'])) && $poral_setting['vis_manage_logo']=='text')?'style="display:"':'style="display:none"'; ?>><? echo $vis_language['TXTENTTXTLOGO']; ?></label>
			<div class="col-sm-9">
				<span id="vis_logo_image" class="m-l-xl" <? echo ($poral_settingm['vis_manage_logo']=='image' || empty($poral_settingm['vis_manage_logo']))?'style="display:"':'style="display:none"'; ?>>
				<span id="vis_manage_logo" class="pull-left m-r-xl"><img width="200px" src="<? echo (isset($poral_settingm['vis_manage_portal_logo']) && $poral_settingm['vis_manage_portal_logo']!='image')?(VIS_PATH_PROFILE.$poral_settingm['vis_manage_portal_logo']):(VIS_PATH_IMAGES.'vh-logo.svg?ver=02122014'); ?>" /></span>
				<span id="vis_portal_logo" class="pull-left m-t-md">
					<input type="file" name=vis_portal_img class="filestyle" data-icon="false" data-classButton="btn btn-link link m-t-xs" data-buttonText="<? echo $vis_language['TXTUPLOADIMG']; ?>" data-input="false"  onchange="$(this).visExecution('upload_file', {'vis_static_area':'#vis_profile_image', 'vis_form':'vis_mng_portal_setting', 'vis_upload_area':'#vis_portal_logo', 'vis_action':'index.php?vis_module=setting&vis_operation=upload_logo_popup'});">
				</span>
				<span id="clear_manage_logo_Img">
					<? if(isset($poral_settingm['vis_manage_portal_logo']) && $poral_settingm['vis_manage_portal_logo']!='image') {?>
						<button type="button" id="clear_manage_logo_Btn" class="btn btn-primary btn-xs pull-left m-t-lg" onclick="javascript:clear_manage_logo();"><? echo $vis_language['TXTCLEAR']; ?></button>
					<? }?>
				</span>
				</span>
				 <span id="vis_logo_text" <? echo ($poral_settingm['vis_manage_logo']=='text')?'style="display:"':'style="display:none"'; ?>>
					<div class="row">
					  <div class="col-sm-8">
						<input class="form-control input-sm" id="logo_text" name="logo_text" value="<?= $poral_settingm['vis_manage_portal_text']; ?>" type="text">
					  </div>
					  <div class="col-sm-3">
						<div class="input-group">
							<input class="form-control input-sm demo-auto" placeholder="Text color" name="logo_text_colour" type="text" value="<?= $poral_settingm['vis_manage_portal_text_colour'];?>">
							<span class="input-group-addon input-sm">
								<label class="i-checks m-b-n m-l-xs">
									<input type="checkbox" name="logo_text_bold"<? if($poral_settingm['vis_manage_portal_text_bold'] == 1) echo ' checked="checked"';?>><i></i> Bold
								</label>
							</span>
							<span class="input-group-addon input-sm">
								<label class="i-checks m-b-n m-l-xs">
									<input type="checkbox" name="logo_text_italic"<? if($poral_settingm['vis_manage_portal_text_italic'] == 1) echo ' checked="checked"';?>><i></i> Italic
								</label>
							</span>
						</div>
					  </div>
					</div>
				 </span>
			</div>
		</div>
        <div class="form-group">
			<label class="col-sm-3 control-label" >Staff portal theme</label>
			<div class="col-sm-9">
                <select class="form-control input-sm selectpicker" name="vis_theme" id="vis_theme" <? if(count($themesm)>10) echo 'data-live-search="true"';?> ><? for($i=0;$i<count($themesm);$i++) {
			echo '<option value="'.$themesm[$i]['theme'].'"'.(((empty($poral_settingm['vis_manage_portal_theme']) && $themesm[$i]['theme'] == 'default') || $themesm[$i]['theme']==$poral_settingm['vis_manage_portal_theme']) ? ' selected="selected"':'').' style="'.$themesm[$i]['style'].'">';
			if($themesm[$i]['theme'] == 'dark_blue')
				echo ucwords(str_replace('_', ' ', $themesm[$i]['theme']));
			else
				echo ucwords($themesm[$i]['theme']);
			echo '</option>';
			} ;?> </select>
			</div>
		</div>
        <div class="form-group">
               <label class="col-sm-3 control-label" >Client portal theme</label>
               <div class="col-sm-9">
                  <input  class="form-control input-sm demo-auto" name="vis_portal_color" id="vis_portal_color_area" type="text" value="<?= $poral_setting['theme_color']?>">
               </div>
            </div>
		<div class="line b-b line-lg pull-in"></div><br/>
		<div class="form-group">
			<div class="col-sm-10 col-sm-offset-2 text-right">
				<button id="submitpopupfrm" onclick="return checkdata();"  class="btn btn-primary" type="button"> <? echo $vis_language['TXTNEXT']; ?> </button>
			</div>
		</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>
   $(".selectpicker").selectpicker();
	$(function() {
		function createColorpickers() {
			$('.demo-auto').colorpicker();
		}
		createColorpickers();
	});
	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_manage_logo()
	{
		$('#clear_manage_logo_Img').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'remove_logo_popup','vis_manage':1});
		
	}

function checkdata()
{ 
	
	$.ajax({
            url: 'index.php',
            type: "POST",
           data: { 'vis_action': $("#vis_mng_portal_setting").serialize(), 'vis_module': 'setting', 'vis_operation': 'update_manage_portal_setting_popup', 'vis_form': 'vis_mng_portal_setting' },
           success: function(data) {
			
		    if(data==1)
			{
				$("#vis_global_msg_div").visInterface("load_global_message", "<?=$vis_language['MSGERROPRT']?>");
				  
			}else{
				$("#vis_details_list").visExecution("load_operations",{"vis_module":"setting", "vis_operation":"mailqueue_details_popup"});
				//$("#vis_global_msg_div").visInterface("load_global_message", "<?=$vis_language['MSGSUCCOPRT']?>");
                 set_active_tab('mailqueue');
              }
           }
        });
		
}
</script>

