<title>Input Tag</title>
<div id="pagetitle">INPUT TAG</div>
<div id="batascontent">
	<form action="?m=kontentag_simpan" method="post" enctype="multipart/form-data">
		<?php
			$udb = mysqli_query($koneksi, "SELECT * FROM cmas_admin WHERE admin_username='$admin_username'");
			$udt = mysqli_fetch_array($udb);
		?>
		<input name="posted_id" type="hidden" value="<?php echo $udt['admin_id']; ?>">
		
		<?php
			$id = mysqli_real_escape_string($koneksi, $_GET['id']);
			$db = mysqli_query($koneksi, "SELECT * FROM cmas_konten WHERE konten_id='$id'");
			$dt = mysqli_fetch_array($db);
		?>
		<input name="konten_id" type="hidden" value="<?php echo $dt['konten_id']; ?>">
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsetting" class="clearfix">
				<div id="gsettingeditfull">
					<input name="kontentag_title" type="text" placeholder="Masukkan Article Tag / Kata Kunci" required />
				</div>
			</div>
		
			<div id="gsetting" class="clearfix">
				<div id="gsettinglabel"></div>
				<div id="gsettinginputfull">
					<a href="?m=konten_indexkat&id=<?php echo $dt['kontenkat_id']; ?>"><input name="Button" type="button" value="KEMBALI" class="myButton"/></a>
					<input name="submit" type="submit" value="SIMPAN" class="submitbutton" />
				</div>
			</div>
		
			<div id="gsetting" class="clearfix">
				<div id="gsettinginputfull">
					<div id="tagsbot" class="clearfix">
						<?php
							$tgdb = mysqli_query($koneksi, "SELECT * FROM cmas_kontentag WHERE konten_id='$dt[konten_id]' ORDER BY kontentag_id DESC");
							$find = mysqli_num_rows($tgdb);
							
							if ($find == 0) {
								echo "No Tag";
							} else {
								while($tgdt = mysqli_fetch_array($tgdb)) {
						?>
								<div id="tagsrows" class="clearfix">
									<div id="tagsleft">
										<?php echo $tgdt['kontentag_title']; ?>
									</div>
									<div id="tagsrite">
										<a href="?m=kontentag_hapus&id=<?php echo $tgdt['kontentag_id']; ?>" class="erasetags">x</a>
									</div>
								</div>
							<?php } ?>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
