<? global $vis_language;?>
<div class="form-group">
	<label class="col-sm-2 control-label" ><? echo $vis_language['TXTGOTOMEETINGS']; ?></label>
	<div class="col-sm-1">
		<label class="switch"  value="1"<? if($meeting_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>  >
		<input type="checkbox"  name="vis_status_meeting"  id="vis_status_meeting" onclick="toggle_status_meeting();" value="1" <? if($meeting_details['is_enabled']==1) echo ' checked="checked"'; ?> > 
		<span></span>
		</label>
	</div>
</div>
<div id="access_gotomeeting">
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTCONKEY']; ?></label>
		<div class="col-sm-9">
			<input type="text" class="form-control input-sm" name="vis_meeting_consumer" id="vis_meeting_consumer" value="<? echo $meeting_details['api_key']; ?>" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTCALLBACKURL']; ?></label>
		<div class="col-sm-9">
			<input type="text" class="form-control input-sm" name="vis_url_meeting" id="vis_url_meeting" value="<? if(isset($meeting_details['billing_url'])){echo $meeting_details['billing_url'];}else echo "https://api.citrixonline.com"; ?>" />
		</div>
	</div>					
</div>

<div class="form-group">
	<label class="col-sm-2 control-label" ><? echo $vis_language['TXTGOTOASSIST']; ?></label>
	<div class="col-sm-1">
		<label class="switch"  value="1"<? if($assist_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>  >
		<input type="checkbox"  name="vis_status_assist"  id="vis_status_assist" onclick="toggle_status_assist();" value="1" <? if($assist_details['is_enabled']==1) echo ' checked="checked"'; ?> > 
		<span></span>
		</label>
	</div>
</div>
<div id="access_gotoassist">
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTCONKEY']; ?></label>
		<div class="col-sm-9">
			<input type="text" class="form-control input-sm" name="vis_assist_consumer" id="vis_assist_consumer" value="<? echo $assist_details['api_key']; ?>" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTCALLBACKURL']; ?></label>
		<div class="col-sm-9">
			 <input type="text" class="form-control input-sm" name="vis_url_assist" id="vis_url_assist" value="<? if(isset($assist_details['billing_url'])){echo $assist_details['billing_url'];}else echo "https://api.citrixonline.com"; ?>" />
		</div>
	</div>					
</div>

<div class="form-group">
	<label class="col-sm-2 control-label" ><? echo $vis_language['TXTWEBEX']; ?></label>
	<div class="col-sm-1">
		<label class="switch"  value="1"<? if($assist_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>  >
		<input type="checkbox"  name="vis_status_webex"  id="vis_status_webex" onclick="toggle_status_webex();" value="1" <? if($webex_details['is_enabled']==1) echo ' checked="checked"'; ?> > 
		<span></span>
		</label>
	</div>
</div>
<div id="access_webex">
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTSITEID']; ?></label>
		<div class="col-sm-9">
			<input type="text" class="form-control input-sm" name="vis_webex_siteid" id="vis_webex_siteid" value="<? echo $webex_details['host_name']; ?>" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTPARTNERID']; ?></label>
		<div class="col-sm-9">
			 <input type="text" class="form-control input-sm" name="vis_webex_partnerid" id="vis_webex_partnerid" value="<? echo $webex_details['user_name']; ?>" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-1"></label>
		<label class="col-sm-2 control-label"><? echo $vis_language['TXTCALLBACKURL']; ?></label>
		<div class="col-sm-9">
			 <input type="text" class="form-control input-sm" name="vis_webex_url" id="vis_webex_url" value="<? if(isset($webex_details['billing_url'])){echo $webex_details['billing_url'];}else echo "https://apidemoeu.webex.com"; ?>" />
		</div>
	</div>					
</div>


<div class="form-group">
	<label class="col-sm-2 control-label" ><? echo $vis_language['TXTTEAMVIEWER']; ?></label>
	<div class="col-sm-1">
		<label class="switch"  value="1"<? if($teamviewer_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>  >
		<input type="checkbox"  name="vis_status_teamviewer"  id="vis_status_teamviewer" value="1" <? if($teamviewer_details['is_enabled']==1) echo ' checked="checked"'; ?> > 
		<span></span>
		</label>
	</div>
</div>

<input type="hidden" name="vis_integration_id_meeting"  id="vis_integration_id_meeting" value="<? echo $meeting_details['integration_id']; ?>"/>
<input type="hidden" name="vis_integration_id_assist"  id="vis_integration_id_assist" value="<? echo $assist_details['integration_id']; ?>"/>
<input type="hidden" name="vis_integration_id_teamviewer"  id="vis_integration_id_teamviewer" value="<? echo $teamviewer_details['integration_id']; ?>"/>.
<input type="hidden" name="vis_integration_id_webex"  id="vis_integration_id_webex" value="<? echo $webex_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':'setting', 'vis_operation':'update_remoteaccess_setting', 'vis_form':'vis_integration_form'})"><? echo $vis_language['TXTSAVE']; ?></button>
            <? if(!empty($meeting_details) || !empty($assist_details) || !empty($teamviewer_details) || !empty($webex_details)) {?>
            <button type="button" class="btn btn-primary m-l" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'delete_remoteaccess_setting', 'vis_form':'vis_integration_form'})"><? echo $vis_language['TXTDELETE']; ?></button>
            <? } ?>
		</div>
	</div>
</form>
<script>
if(!$('#vis_status_meeting').is(":checked")){ $('#access_gotomeeting').hide();}
if(!$('#vis_status_assist').is(":checked")){ $('#access_gotoassist').hide();}
if(!$('#vis_status_webex').is(":checked")){ $('#access_webex').hide();}

function toggle_status_meeting(){
	if($('#vis_status_meeting').is(":checked")){ $('#access_gotomeeting').show();}
	else { $('#access_gotomeeting').hide();}
}
function toggle_status_assist(){
	if($('#vis_status_assist').is(":checked")){ $('#access_gotoassist').show();}
	else { $('#access_gotoassist').hide();}
}
function toggle_status_webex(){
	if($('#vis_status_webex').is(":checked")){ $('#access_webex').show();}
	else { $('#access_webex').hide();}
}
</script>
