configure.php 2.98 KB
Newer Older
Kulya's avatar
Kulya committed
1
<?php namespace AloVoice; include("header.php"); ?>
Kulya's avatar
Kulya committed
2
<?php if($this->isAmi || $this->appInstalled) { ?>
Kulya's avatar
Kulya committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
	<script src="//api.bitrix24.com/api/v1/"></script>
	<script> BX24.init(function(){ BX24.installFinish();  location.href = '<?=$this->alvhost?>'; }); </script>
<?php } else { ?>
<center><h1>Добро пожаловать в <b>AloVoice BX24</b></h1></center>
<div class="card mt-4">
	<div class="card-header">
		<?php if(!empty($this->_error)){ ?>
			<span style="padding:10px;  color:#f00;"><?php echo (is_array($this->_error)) ? json_encode($this->_error) : $this->_error; ?></span> <!-- border:1px solid #f00; -->
		<?php } else { ?>
			Система не настроена. Настроим? 
		<?php } ?>
	</div>
	<div class="card-body">
		<h5 id="toggler_asterisk_settings" class="card-title">Введите параметры для сервера <strong>"<?=$this->alvhost?>"</strong></h5>
		
		<form id="sms-settings">
			<div class="card-text">
				<input type="hidden" name="save" value="Y">
				<input type="hidden" name="access_token" value="<?=$access_token?>">
				<input type="hidden" name="application_token" value="<?=$application_token?>">
				<input type="hidden" name="refresh_token" value="<?=$refresh_token?>">
				<input type="hidden" name="expires_in" value="<?=$expires_in?>">
				<input type="hidden" name="domain" value="<?=$bxDomain?>">
				<input type="hidden" name="member_id" value="<?=$member_id?>">

				<div class="form-group"> 
					<label class="col-sm-2 col-form-label">Aдрес Битрикс24:</label> 
					<div class="col-sm-10"><input type="text" class="form-control"  value="<?php echo $bxDomain; ?>" disabled> </div>
				</div>
				
				<div class="form-group"> 
					<label class="col-sm-2 col-form-label">Aдрес AMI:</label> 
					<div class="col-sm-10"><input type="text" class="form-control" name="ami_host" id="ami_host" value="127.0.0.1"> </div> 
				</div>
				
				<div class="form-group"> 
					<label class="col-sm-2 col-form-label">Порт AMI:</label>
					<div class="col-sm-10"> <input type="text" class="form-control" name="ami_port" id="ami_port" value="5038"></div>
				</div>
				
				<div class="form-group"> 
					<label class="col-sm-2 col-form-label">Пользователь AMI:</label> 
					<div class="col-sm-10">
						<input type="text" class="form-control" name="ami_user" id="ami_user" value="<?=$ami_user?>"> 
					</div> 
				</div>
				<div class="form-group"> 
					<label class="col-sm-2 col-form-label">Пароль AMI:</label> 
					<div class="col-sm-10">
						<input type="password" class="form-control" name="ami_pass" id="ami_pass" value="<?=$ami_pass?>"> 
					</div> 
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn btn-save">Сохранить</button>
				</div>
				
			</div>
		</form>
		<!--a href="#" class="btn btn-primary">Вернуться в Битрикс24</a-->
	</div>
</div>
<?php } ?>
<?php include("footer.php"); ?>