<?php
	admin :: access(array('a'=>1));

	$level = admin :: getLevel($d);
	$R = (isset($_GET['r']) ? intval($_GET['r']) : 1);
	if(isset($_POST['cfms'])) {
		if(isset($_POST['access']) && $_POST['access'] == ACCESS) {
			$copy = $_POST['copy'];
			$sys_id = intval($_POST['id_sys']);
			$time_online = intval($_POST['time_online']);
			$meta_generator = $_POST['meta_generator'];
			$meta_keywords = $_POST['meta_keywords'];
			$meta_description = $_POST['meta_description'];
			$meta_author = $_POST['meta_author'];
			$meta_reply_to = $_POST['meta_reply_to'];
			$meta_copyright = $_POST['meta_copyright'];
			$version = $_POST['version'];
			$lange = $_POST['lange'];
			$admin = $_POST['admin'];
			$proger = $_POST['proger'];
			$data = array(
					'SYS_ID'			=>	$sys_id,
					'TIME_ONLINE'		=>	$time_online,
					'SITE_COPY'			=>	$copy,
					'META_GENERATOR'	=>	$meta_generator,
					'META_KEYWORDS'		=>	$meta_keywords,
					'META_DESCRIPTION'	=>	$meta_description,
					'META_AUTHOR'		=>	$meta_author,
					'META_REPLY_TO'		=>	$meta_reply_to,
					'META_COPYRIGHT'	=>	$meta_copyright,
					'VERSION'	        =>	$version,
					'LANGE'	            =>	$lange,
					'ADMIN'	            =>	$admin,
					'PROGER'            =>  $proger
					);			

			file_put_contents(CONFIG_FILE, json_encode($data));
			system :: redirect("Настройки успешно применены!", "{$thisLink}?act=site/config");
		}
	}

	$title = $l = "Панель управления - Конфигурация сайта";
	require (CORE."head.php");
	
	?>
	<form method="post" action="">
<div class="app-block">
		<div class="list">
			<div>
				<label class="_gray _dbl">Копирайт: </label>
				<input type="text" class="main-input _w-100" name="copy" value="<?=$config['SITE_COPY']?>" />
			</div>
			<div>
				<label class="_gray _dbl">ID системы: </label>
				<input type="text" class="main-input _w-100" name="id_sys" value="<?=$config['SYS_ID']?>" />
			</div>
			<div>
				<label class="_gray _dbl">Время онлайн(секунды): </label>
				<input type="text" class="main-input _w-100" name="time_online" value="<?=$config['TIME_ONLINE']?>" />
			</div>
		</div>
		
			<div class="list"><div class="_gray _bold _font-s">VINETI CMS</div>
			<div>
				<label class="_gray _dbl">Версия: </label>
				<input type="text" class="main-input _w-100" name="version" value="<?=$config['VERSION']?>" />
			</div>
			<div>
				<label class="_gray _dbl">Мультиязычность: </label>
				<input type="text" class="main-input _w-100" name="lange" value="<?=$config['LANGE']?>" />
			</div>
			<div>
				<label class="_gray _dbl">Администратор проекта: </label>
				<input type="text" class="main-input _w-100" name="admin" value="<?=$config['ADMIN']?>" />
			</div>
				<div>
				<label class="_gray _dbl">Программист: </label>
				<input type="text" class="main-input _w-100" name="proger" value="<?=$config['PROGER']?>" />
			</div>
			
		</div>
		
		
		
		
		
		<div class="list">
			<div class="_gray _bold _font-s">Мета-теги</div>
			<div>
				<label class="_gray _dbl">Generator: </label>
				<textarea class="main-input _w-100" name="meta_generator"><?=$config['META_GENERATOR']?></textarea>
			</div>
			<div>
				<label class="_gray _dbl">Keywords: </label>
				<textarea class="main-input _w-100" name="meta_keywords"><?=$config['META_KEYWORDS']?></textarea>
			</div>
			<div>
				<label class="_gray _dbl">Description: </label>
				<textarea class="main-input _w-100" name="meta_description"><?=$config['META_DESCRIPTION']?></textarea>
			</div>
			<div>
				<label class="_gray _dbl">Author: </label>
				<input type="text" class="main-input _w-100" name="meta_author" value="<?=$config['META_AUTHOR']?>" />
			</div>
			
			<div>
				<label class="_gray _dbl">Reply-to: </label>
				<input type="text" class="main-input _w-100" name="meta_reply_to" value="<?=$config['META_REPLY_TO']?>" />
			</div>
			<div>
				<label class="_gray _dbl">Copyright: </label>
				<input type="text" class="main-input _w-100" name="meta_copyright" value="<?=$config['META_COPYRIGHT']?>" />
			</div>
		</div>
		<input type="hidden" name="access" value="<?=ACCESS?>">
		<div class="_center list">
			<input type="submit" class="main-btn _w-100" name="cfms" value="Сохранить">
		</div>
	</form>
	<?php
	echo system :: back($thisPage,"Панель управления");
	require (CORE."foot.php");