<title>Input Artikel</title>
<div id="pagetitle">INPUT ARTIKEL</div>
<div id="batascontent" class="clearfix">
	<form action="?m=konten_simpan" method="post" enctype="multipart/form-data">
		<div id="wrapgsetting" class="clearfix">
			<div id="gsettingleft">
				<div id="gsettingtitles">GENERAL</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Judul</div>
					<div id="gsettingedit">
						<input name="konten_judul" type="text" autocomplete="off" required />
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Deskripsi Pendek</div>
					<div id="gsettingedit">
						<textarea name="konten_sdesc" type="text" ></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Deskripsi Selengkapnya</div>
					<div id="gsettingedit">
						<textarea name="konten_desc" id="content"></textarea>
						<script type="text/javascript">
							CKEDITOR_BASEPATH = 'ckeditor';
							var editor = CKEDITOR.replace('content', {});
						</script>
					</div>
				</div>
				<div id="gsetting" class="clearfix" >
					<div id="gsettinglabel">Meta Title</div>
					<div id="gsettingedit">
						<input name="konten_metatitle" type="text" autocomplete="off" />
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Description</div>
					<div id="gsettingedit">
						<textarea name="konten_metadesc" type="text" ></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Keywords</div>
					<div id="gsettingedit">
						<textarea name="konten_metakey" type="text" ></textarea>
					</div>
				</div>
			</div>
			
			<div id="gsettingrite">
				<div id="gsettingtitles">ATTRIBUTE</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Status</div>
					<div id="gsettingedit">
						<select name="konten_status" required>
							<?php $stdb=mysqli_query($koneksi, "SELECT * FROM cmas_status ORDER BY status_id ASC"); while($stdt=mysqli_fetch_array($stdb)) { ?>
								<option value="<?php echo $stdt['status_nama']; ?>"><?php echo $stdt['status_nama']; ?></option>
							<?php } ?>
						</select>
					</div>
				</div>
				<!-- KATEGORI -->
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Kategori</div>
					<div id="gsettinginput">
						<?php
							$id = mysqli_real_escape_string($koneksi, $_GET['id']);
							$db = mysqli_query($koneksi, "SELECT * FROM cmas_kontenkat WHERE kontenkat_id='$id'");
							$dt = mysqli_fetch_array($db);
						?>
						<input name="kontenkat_id" type="hidden" value="<?php echo $dt['kontenkat_id']; ?>">
						<input name="kontenkat_judul" type="hidden" value="<?php echo $dt['kontenkat_judul']; ?>"><?php echo $dt['kontenkat_judul']; ?>
					</div>
				</div>
				<?php if ($id != "2") {} else { ?>	
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Tanggal</div>
						<div id="gsettingedit">
							<input name="konten_date" type="date" autocomplete="off">
						</div>
					</div>
					<div id="gsetting" class="clearfix">
						<div id="gsettinglabel">Sumber</div>
						<div id="gsettingedit">
							<input name="konten_author" type="text" autocomplete="off">
						</div>
					</div>
				<?php } ?>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Upload</div>
					<div id="gsettingedit">
						<input type="file" name="konten_image" />
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettingimgbig">
						<?php if ($dt['konten_imageid'] == 0) { ?>
							<img src="assets/images/noimage.jpg" alt="<?php echo $dt['konten_judul']; ?>" title="<?php echo $dt['konten_judul']; ?>">
						<?php } else { ?>
							<img src="assets/images/konten/<?php echo $dt['konten_image']; ?>" alt="<?php echo $dt['konten_judul']; ?>" title="<?php echo $dt['konten_judul']; ?>">
							
							<a href="?m=konten_hapusfile&id=<?php echo $dt['konten_id']; ?>" onclick="return confirm('DATA AKAN DIHAPUS, ANDA YAKIN?');">
								<span><img src="assets/images/icons/icon_tidak.png" title="Hapus File"></span>
							</a>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
		<div id="tombolsubmit">
			<a href="?m=konten_indexkat&id=<?php echo $_GET['id']; ?>"><input name="button" type="button" value="KEMBALI" class="myButton" /></a>
			<input name="submit" type="submit" value="SIMPAN" class="submitbutton"/>
		</div>
	</form>
</div>	