<? global $vis_language;  ?>
<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"><span><? echo $currentPage;?></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 class="active"><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"><a class="link" href="javascript:void(0);" onclick="$('#vis_workpanel_div').visExecution('load_module','<?echo $vis_language['TXTSINGLELOGIN'];?>',{'vis_module':'setting','vis_operation':'view_single_login'});"><? echo $vis_language['TXTSINGLELOGIN'];?></a></li>-->
			<li><? echo $currentPage; ?></li>
		</ul>
	</div>
</section>
<section class="padder">
	<section class='panel panel-default'>
		<header class="panel-heading sub_header"><? echo $currentPage; ?></header>
		<div class="panel-body">
			<form method="post" name="vis_integration_form" id="vis_integration_form" class="form-horizontal">
				<input type="hidden" value="<? echo $vis_integration_type; ?>" name="vis_type" />
				 
				<!--<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTDOMAIN']; ?></label>
					<div class='col-sm-10'>
						<select class='form-control input-sm selectpicker' name="vis_domain" id="vis_domain" onchange="vis_change_livechat(this)" <? if(count($department) > 10) echo 'data-live-search="true"' ?>>
							<option value="0">-- <? echo $vis_language['TXTSELECTDOMAIN']; ?> --</option>
							<? for($i=0;$i<count($department);$i++) echo '<option value="'.$department[$i]['domain_id'].'">'.$department[$i]['domain_name'].'</option>'; ?>
						</select>
					</div>
				</div>
				<div id="vis_smtp_area"></div>-->
				<div class="form-group">
			<label class="col-sm-2 control-label"><? echo $vis_language['TXTEMAIL']; ?></label>
			<div class="col-sm-10">
				<!-- <input type="text" class="form-control input-sm" name="vis_gcal_state" id="vis_gcal_state" value="<? //echo $crisp_details['admin_user']; ?>" /> -->
				<input type="text" class="form-control input-sm" name="vis_admin" id="vis_admin" value="<? echo $crisp_details['admin_user']; ?>" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label"><? echo $vis_language['TXTPASSWORD']; ?></label>
			<div class="col-sm-10">
				<input type="password" class="form-control input-sm" name="vis_api" id="vis_api" value="<? echo $crisp_details['api_key']; ?>" />
			</div>
    </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><? echo $vis_language['TXTSCRIPT']; ?></label>
            <div class="col-sm-10">
                 <textarea class="form-control input-sm" name="vis_url" id="vis_url" ><? echo $crisp_details['billing_url']; ?></textarea>
            </div>
        </div>
		<div class="form-group">
			<label class="col-sm-2 control-label" ><? echo $vis_language['TXTSTATUS']; ?></label>
			<div class="col-sm-1">
				<label class="switch"  value="0"<? if($crisp_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>  >
				<input type="checkbox" name="vis_status"  id="vis_status" value="1" <? if($crisp_details['is_enabled']==1 || !isset($crisp_details['is_enabled'])) echo ' checked="checked"'; ?> > 
				<span></span>
				</label>
			</div>
		</div>
       <input type="hidden" name="vis_integration_id"  id="vis_integration_id" value="<? echo $crisp_details['integration_id']; ?>"/>
		<div class="line b-b line-lg pull-in"></div><br/>
			<div class="form-group">
				<div class="col-sm-4 col-sm-offset-2">
					<button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'subsetting', 'vis_operation':'update_livechatinc', 'vis_integration_type':<?php echo $action[4];?>,'vis_form':'vis_integration_form','vis_domain':'0'})"><? echo $vis_language['TXTSAVE']; ?></button>
              <? if($crisp_details['integration_id']!=''){?>       
                    <button type="button" class="btn btn-primary m-l" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'subsetting', 'vis_operation':'delete_livechatinc_46', 'vis_integration_type':<?php echo $action[4];?>,'vis_form':'vis_integration_form'})"><? echo $vis_language['TXTDELETE']; ?></button>
              <? }?>      
				</div>
			</div>
            </form>
		</div>
	</section>
</section>
 <script>
	function vis_change_livechat(e){
        if(e.value==0) $("#vis_smtp_area").hide();
        else $('#vis_smtp_area').visExecution('load_area', {'vis_module':'setting', 'vis_operation':'crisp_setting', 'vis_integration_type':'<?=$vis_integration_type?>','vis_domain':'0'});
    }
</script>
