	<?php if(@$error): ?>
		<div class="alert alert-dismissible alert-danger">
			<button type="button" class="close" data-dismiss="alert">×</button>
			<strong>Hata!</strong> <?=$errorText?>
		</div>
	<?php endif; ?>
	<?php if(@$success): ?>
		<div class="alert alert-dismissible alert-success">
			<button type="button" class="close" data-dismiss="alert">×</button>
			<strong>Başarılı!</strong> <?=$success?>
		</div>
	<?php endif; ?>
	<style type="text/css">.form-group {margin-bottom: unset!important;}</style>
	<div class="panel panel-default">
		<div class="panel-body">
			<form id="update_links" onsubmit="return false;">
				<div class="row">
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Hesabım</b></span>
							<input type="text" name="links[account][url]" class="form-control" value="<?=$siteLinks['account']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Bakiye Ekle</b></span>
							<input type="text" name="links[add-funds][url]" class="form-control" value="<?=$siteLinks['add-funds']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Child Panel</b></span>
							<input type="text" name="links[child][url]" class="form-control" value="<?=$siteLinks['child']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Otomatik Sipariş Oluşturma</b></span>
							<input type="text" name="links[auto][url]" class="form-control" value="<?=$siteLinks['auto']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Otomatik Siparişler</b></span>
							<input type="text" name="links[autos][url]" class="form-control" value="<?=$siteLinks['autos']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Tekil Sayfa</b></span>
							<input type="text" name="links[page][url]" class="form-control" value="<?=$siteLinks['page']['url']?>">
						</div>
						<hr>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Blog</b></span>
							<input type="text" name="links[blog][url]" class="form-control" value="<?=$siteLinks['blog']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[blog][status]">
								<option value="1" <?= ($siteLinks['blog']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['blog']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['blog']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12"><hr></div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>İletişim</b></span>
							<input type="text" name="links[contact][url]" class="form-control" value="<?=$siteLinks['contact']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[contact][status]">
								<option value="1" <?= ($siteLinks['contact']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['contact']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['contact']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12 form-group">
						<hr>
						<div class="input-group">
							<span class="input-group-addon"><b>Süreli Siparişler</b></span>
							<input type="text" name="links[drips][url]" class="form-control" value="<?=$siteLinks['drips']['url']?>">
						</div>
						<hr>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sıkça Sorulan Sorular</b></span>
							<input type="text" name="links[faq][url]" class="form-control" value="<?=$siteLinks['faq']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[faq][status]">
								<option value="1" <?= ($siteLinks['faq']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['faq']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['faq']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12 form-group">
						<hr>
						<div class="input-group">
							<span class="input-group-addon"><b>Şifremi Unuttum</b></span>
							<input type="text" name="links[forgot][url]" class="form-control" value="<?=$siteLinks['forgot']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Siparişler</b></span>
							<input type="text" name="links[orders][url]" class="form-control" value="<?=$siteLinks['orders']['url']?>">
						</div>
						<hr>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Referans Sistemi</b></span>
							<input type="text" name="links[reff][url]" class="form-control" value="<?=$siteLinks['reff']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[reff][status]">
								<option value="1" <?= ($siteLinks['reff']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['reff']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['reff']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12 form-group">
						<hr>
						<div class="input-group">
							<span class="input-group-addon"><b>Kayıt Ol</b></span>
							<input type="text" name="links[register][url]" class="form-control" value="<?=$siteLinks['register']['url']?>">
						</div>
						<hr>
					</div>
					<div class="col-md-12 form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Şifre Değiştirme</b></span>
							<input type="text" name="links[reset][url]" class="form-control" value="<?=$siteLinks['reset']['url']?>">
						</div>
						<hr>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Servisler</b></span>
							<input type="text" name="links[services][url]" class="form-control" value="<?=$siteLinks['services']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[services][status]">
								<option value="1" <?= ($siteLinks['services']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['services']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['services']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12"><hr></div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sözleşmeler</b></span>
							<input type="text" name="links[terms][url]" class="form-control" value="<?=$siteLinks['terms']['url']?>">
						</div>
					</div>
					<div class="form-group col-md-6">
						<div class="input-group">
							<span class="input-group-addon"><b>Sayfa Görünürlüğü</b></span>
							<select class="form-control" name="links[terms][status]">
								<option value="1" <?= ($siteLinks['terms']['status'] == 1) ? "selected" : null ?> >Herkese Açık</option>
								<option value="2" <?= ($siteLinks['terms']['status'] == 2) ? "selected" : null ?> >Sadece Üyeler</option>
								<option value="3" <?= ($siteLinks['terms']['status'] == 3) ? "selected" : null ?> >Herkese Kapalı</option>
							</select>
						</div>
					</div>
					<div class="col-md-12 form-group">
						<hr>
						<div class="input-group">
							<span class="input-group-addon"><b>Destek</b></span>
							<input type="text" name="links[tickets][url]" class="form-control" value="<?=$siteLinks['tickets']['url']?>">
						</div>
					</div>
					<div class="col-md-12 form-group">
						<hr>
						<button type="submit" class="btn btn-success pull-right">Bilgileri Güncelle</button>
					</div>
				</div>
			</form>
		</div>
	</div>

	<script src="<?=admin_public_url('assets/js/jquery.min.js')?>?v=<?=time()?>"></script>
	<script>

		$("#seo_title").change(function(){
			var seo_title 	= document.getElementById("seo_title");
			$('#google_preview_title').html(seo_title.value);
		});

		$("#blog_url").change(function(){
			var blog_url 	= document.getElementById("blog_url");
			$('#google_preview_url').html(blog_url.value);
		});

		$("#seo_desc").change(function(){
			var seo_desc 	= document.getElementById("seo_desc");
			$('#google_preview_desc').html(seo_desc.value);
		});

		function createSEOLink (link) {
			var trMap = {
				'çÇ':'c',
				'ğĞ':'g',
				'şŞ':'s',
				'üÜ':'u',
				'ıİ':'i',
				'öÖ':'o'
			};

			for(var key in trMap) {
				link = link.replace(new RegExp('['+key+']','g'), trMap[key]);
			}
			return  link.replace(/[^-a-zA-Z0-9\s]+/ig, '')
			.replace(/\s/gi, "-")
			.replace(/[-]+/gi, "-")
			.toLowerCase();
		}

		$("#blog_title").change(function(){
			var blog_title 	= document.getElementById("blog_title");
			$('#blog_url').val(createSEOLink(blog_title.value));
			$('#google_preview_url').html(createSEOLink(blog_title.value));
		});

	</script>