<? global $vis_language;?>

<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTTITLE']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_app_title" id="vis_app_title" value="<? echo $asterisk_details['db_prefix']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><b><? echo $vis_language['TXTASTDBCONFIGURATION']; ?></b></label>
	<div class="col-sm-10">	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTDBHOST']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_dbhost" id="vis_dbhost" value="<? echo $asterisk_details['host_name']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTDBUSER']; ?></label>
	<div class="col-sm-10">
		 <input type="text" class="form-control input-sm" name="vis_dbuser" id="vis_dbuser" value="<? echo $asterisk_details['user_name']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTDBPASSWORD']; ?></label>
	<div class="col-sm-10">
		 <input type="password" class="form-control input-sm" name="vis_db_pass" id="vis_db_pass" value="<? echo $asterisk_details['db_password']; ?>" />
	</div>
</div>

<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTDBNAME']; ?></label>
	<div class="col-sm-10">
		 <input type="text" class="form-control input-sm" name="vis_dnname" id="vis_dnname" value="<? echo $asterisk_details['db_name']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTRECORDINGPATH']; ?></label>
	<div class="col-sm-10">
		 <input type="text" class="form-control input-sm" name="vis_rec_path" id="vis_rec_path" value="<? echo $asterisk_details['rec_path']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTCONTACTNUMBER']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_read_timeout" id="vis_read_timeout" value="<? echo $asterisk_details['read_timeout']; ?>" />
	</div>
</div>
<?php /* ?>
<div class="form-group">
	<label class="col-sm-2 control-label"><b><? echo $vis_language['TXTASTCONFIGURATION']; ?></b></label>
	<div class="col-sm-10">	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTHOSTNAME']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_host_name" id="vis_host_name" value="<? echo $asterisk_details['billing_url']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTPORT']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_port" id="vis_port" value="<? echo $asterisk_details['api_key']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTUSER']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_user" id="vis_user" value="<? echo $asterisk_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_password" id="vis_password" value="<? echo $asterisk_details['admin_password']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTCONNECTTIMEOUT']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_con_timeout" id="vis_con_timeout" value="<? echo $asterisk_details['con_timeout']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTREADTIMEOUT']; ?></label>
	<div class="col-sm-10">
		<input type="text" class="form-control input-sm" name="vis_read_timeout" id="vis_read_timeout" value="<? echo $asterisk_details['read_timeout']; ?>" />
	</div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTSCHEM']; ?></label>
	<div class="col-sm-10">
		<select class='form-control input-sm selectpicker' name="vis_scheme" id="vis_scheme" >
			<option value="tcp://" <? echo ($asterisk_details['scheme']=='tcp://')?"selected='selected'":""; ?>>tcp://</option>
			<option value="tls://" <? echo ($asterisk_details['scheme']=='tls://')?"selected='selected'":""; ?>>tls://</option>
		</select>
	</div>
</div> <?php */ ?>

<?php /* ?>
  <div class="form-group" style="display:none">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTAUTOTICKETECREATION']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left "><label>
                  <input type="radio" value="1"  id="vis_app_sid_y" name="vis_app_sid" <?php if($asterisk_details['db_password']==1){ echo 'checked="checked"'; } ?>><i></i>
                  Yes</label></div>
                  <div class="radio i-checks m-r-lg pull-left "><label>
                  <input type="radio" value="0" id="vis_app_sid_n" name="vis_app_sid" <?php if($asterisk_details['db_password']!=1){ echo 'checked="checked"'; } ?> ><i></i>
                  No  </label></div>
               </div>
  </div> <?php */ ?>
			

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



<input type="hidden" name="vis_integration_id"  id="vis_integration_id" value="<? echo $asterisk_details['integration_id']; ?>"/>
<input type="hidden" name="vis_integration_type"  id="vis_integration_type" value="51"/>

<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_asterisk_setting', 'vis_form':'vis_integration_form'})"><? echo $vis_language['TXTSAVE']; ?></button>
             <? if($asterisk_details !=-1 && !empty($asterisk_details)) {?>          
            <button type="button" class="btn btn-primary m-l" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'delete_twilio_setting', 'vis_form':'vis_integration_form','vis_integration_type':51})"><? echo $vis_language['TXTDELETE']; ?></button>
             <? } ?> 
		</div> 
		<?php /* ?>
		<div class="col-sm-6 text-right">
			<ul class="navSeprator m-n bred_rlink">
				<li><a href="#/setting/asterisk_dialplan/<? echo $vis_language['TXTASTDIALPLANS']; ?>/<?php echo  $asterisk_details['integration_id'] ; ?>" class="link"><? echo $vis_language['TXTASTDIALPLANS']; ?></a></li>
			</ul>
		</div><?php */ ?>
		
	</div>
</form>

