<?php
/*
* @ServerMon v1.1
* @Developed by Maksa988
* @www.Server-Mon.ru
* @Copyright (C) 2014
*/
 if(!defined('SMON'))
	die('Hacking attempt!');
	
	function keygen($domain){
		$key[0] = strtoupper(md5($domain));
		$key[1] = substr($key[0], 0, 5);
		$key[2] = substr($key[0], 5, 5);
		$key[3] = substr($key[0], 10, 5);
		$key[4] = substr($key[0], 15, 5);
		$key[5] = substr($key[0], 20, 5);
		
		return $key[1].'-'.$key[2].'-'.$key[3].'-'.$key[4].'-'.$key[5];
	}
?>
<div id="content">
	<div class="breadcrumb"><i class="fa fa-angle-right"></i> <?=$navbarName?></div>
	<div class="page">
		<form class="form-horizontal" role="form" method="POST" action="" style="width: 400px;">
		  <div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-sm-7">
			  <input type="domain" class="form-control" id="" placeholder="Домен вашего сайта" name="domain" value="<?=$license['license_domain']?>" style="width: 300px;">
			<br>
			<small>
				Домен сайта не должен содержать лишних знаков (http://, /)
				<br>Пример: <b>domain.com</b>
			</small>
			</div>
		  </div>
		  <?if($license['license_status'] == '1'):?>
		  <div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-sm-7">
			  <input type="key" class="form-control" id="" placeholder="Ключ вашей лицензии" name="key" value="<?=keygen($license['license_domain'])?>" style="width: 300px;" disabled>
			</div>
		  </div>
		  <?endif;?>
		  <br>
		  <input type="hidden" name="edit_license" value="true">
		  <div class="form-group">
			<div class="col-sm-offset-2 col-sm-7 btn-group">
			  <button type="submit" class="btn btn-default">Сохранить</button>
			</div>
		  </div>
		</form>
	</div>
	<div class="blocks">
		<div class="block">
			<div class="block-header"><i class="fa fa-th"></i> Навигация</div>
			<div class="block-body">
			<ul class="block-nav">
				<li><a href="#">Проверка лицензии</a></li>
				<li><a href="#">Партнеры</a></li>
				<li><a href="#">ServerMon Web API</a></li>
			</ul>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
