	<?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/announcements/add')?>" class="btn btn-success" style="margin-bottom:20px;">Yeni Duyuru 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%">Duyuru Başlığı</th>
							<th>Yayın Tarihi</th>
							<th>Duyuru İcon</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<?php foreach($duyuru as $row): ?>
							<tr>
								<td><?=$row["duyuru_title"]?></td>
								<td><?=str_date($row["duyuru_date"])?></td>
								<td><i class="<?=$row["duyuru_icon"]?>"></i></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/announcements/edit/'. $row["id"])?>">Düzenle</a></li>
											<li><a href="#" onclick="delete_duyuru(<?=$row["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_duyuru" onsubmit="return false;" data-reset="1">
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Duyuru Başlığı</b></span>
							<input type="text" name="duyuru_title" class="form-control">
						</div>
					</div>
					<div class="form-group">
                  <label>Duyuru ICON</label>
                  <div class="input-group iconpicker-container">
                     <input name="duyuru_icon" class="form-control icp icp-auto-ekle iconpicker-element iconpicker-input" value="far fa-star" type="text">
                     <span class="input-group-addon"></span>
                  </div>
               </div>
               <div class="form-group">
                  <label>ICON Rengi</label>
                  <input name="duyuru_icon_color" class="form-control" data-jscolor="{}" value=" " type="text">
               </div>
               <div class="form-group">
                  <label>ICON Daire Rengi</label>
                  <input name="duyuru_daire_color" class="form-control" data-jscolor="{}" value=" " type="text">
               </div>
					<div class="form-group">
						<textarea type="text" name="duyuru_content" class="form-control" id="editor"></textarea>
					</div>
					<div class="form-group text-right">
						<a href="<?=admin_url('appearence/announcements')?>" class="btn btn-warning">Duyurulara Geri Dön</a>
						<button type="submit" class="btn btn-success">Duyuru Oluştur</button>
					</div>
				</form>
			</div>
		</div>

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

		<div class="panel panel-default">
			<div class="panel-body">
				<form id="update_duyuru" onsubmit="return false;" data-reset="1">
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><b>Duyuru Başlığı</b></span>
							<input type="text" name="duyuru_title" class="form-control" value="<?=$duyuru['duyuru_title']?>">
						</div>
					</div>
					<div class="form-group">
                  <label>Duyuru ICON</label>
                  <div class="input-group iconpicker-container">
                     <input name="duyuru_icon" class="form-control icp icp-auto-ekle iconpicker-element iconpicker-input" value="<?=$duyuru['duyuru_icon']?>" type="text">
                     <span class="input-group-addon"></span>
                  </div>
               </div>
               <div class="form-group">
                  <label>ICON Rengi</label>
                  <input name="duyuru_icon_color" class="form-control" data-jscolor="{}" value=" " type="text">
               </div>
               <div class="form-group">
                  <label>ICON Daire Rengi</label>
                  <input name="duyuru_daire_color" class="form-control" data-jscolor="{}" value=" " type="text">
               </div>
					<div class="form-group">
						<textarea type="text" name="duyuru_content" class="form-control" id="editor"><?=$duyuru['duyuru_content']?></textarea>
					</div>
					<input type="text" name="id" value="<?=$duyuru['id']?>" style="display: none;">
					<div class="form-group text-right">
						<a href="<?=admin_url('appearence/announcements')?>" class="btn btn-warning">Duyurulara Geri Dön</a>
						<button type="submit" class="btn btn-success">Güncelle</button>
					</div>
				</form>
			</div>
		</div>

	<?php endif; ?>