	<?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; ?>

	<?php if(!route(3)): ?>

		<a href="<?=admin_url('appearence/fields/add')?>" class="btn btn-success" style="margin-bottom:20px;">Yeni Özel Alan Oluştur</a>
		<div class="panel panel-default">
			<div class="panel-body" style="padding:0;">
				<table class="table" style="margin-bottom:0;">
					<thead>
						<tr>
							<th class="p-l" width="45%">Özel Alan Kodu</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<?php foreach($fields as $row): ?>
							<tr>
								<td>&#123;<?=$row["announcement_area"]?>&#125;</td>
								<td>
									<div class="dropdown pull-right">
										<button class="btn btn-xs btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">İşlemler<span class="caret"></span></button>
										<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
											<li><a href="<?=admin_url('appearence/fields/edit/'. $row["announcement_id"])?>">Düzenle</a></li>
											<li><a href="#" onclick="delete_announcement(<?=$row["announcement_id"];?>)">Sil</a></li>
										</ul>
									</div>
								</td>
							</tr>
						<?php endforeach; ?>
					</tbody>
				</table>
			</div>
		</div>

	<?php elseif(route(3) == "add"): ?>

		<div class="panel panel-default">
			<div class="panel-body">
				<form id="add_announcement" onsubmit="return false;" data-reset="1">
					<div class="form-group">
						<?php foreach($langs as $lang): ?>
							<div class="form-group">
								<label><?=$lang["lang_name"];?></label>
								<div id="lang_<?=$lang["lang_id"];?>">
									<textarea name="content[<?=$lang["lang_id"];?>]" class="form-control" id="editor"></textarea>
								</div>
							</div>
						<?php endforeach; ?>
					</div>
					<div class="form-group text-right">
						<a href="<?=admin_url('appearence/fields')?>" class="btn btn-warning">Özel Alanlara Geri Dön</a>
						<button type="submit" class="btn btn-success">Özel Alan Oluştur</button>
					</div>
				</form>
			</div>
		</div>

	<?php elseif(route(3) == "edit"): ?>

		<div class="panel panel-default">
			<div class="panel-body">
				<form id="update_announcement" onsubmit="return false;" data-reset="1">
					<?php foreach($langs as $lang): ?>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b><?=$lang["lang_name"];?></b></span>
							<div id="lang_<?=$lang["lang_id"];?>">
								<textarea name="content[<?=$lang["lang_id"];?>]" class="form-control"><?=$languages[$lang["lang_id"]]?></textarea>
							</div>
						</div>
					</div>
					<?php endforeach; ?>
					<input type="text" name="id" value="<?=$fields['announcement_id']?>" style="display: none;">
					<div class="form-group text-right">
						<a href="<?=admin_url('appearence/fields')?>" class="btn btn-warning">Özel Alanlara Geri Dön</a>
						<button type="submit" class="btn btn-success">Güncelle</button>
					</div>
				</form>
			</div>
		</div>

	<?php endif; ?>