<?php
	require_once("koneksi.php");
    include 'header.php';
?>

	<!-- breadcrumbs -->
		<div class="breadcrumbs">
			<div class="container">
				<ol class="breadcrumb breadcrumb1">
					<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
					<li class="active">Form Kelola Artikel</li>
				</ol>
			</div>
		</div>
	<!-- //breadcrumbs -->
	<!-- register -->
		<div class="register">
			<div class="container">
				<h2>Edit Data Artikel</h2>
				<div class="login-form-grids1">
					<center><h1>Data Artikel</h1S></center>
					<?php
						$id_article = mysqli_real_escape_string($koneksi, $_GET['id']);
						$cari 		= mysqli_query($koneksi, "SELECT * FROM t_artikel WHERE id_artikel='$id_article'")or die(mysqli_error());
						while($data = mysqli_fetch_array($cari)){
					?>	
					<form  action="editarticle_process.php" method="POST" enctype="multipart/form-data">
						<input type="hidden" name="id" placeholder="id_artikel" value="<?php echo $data['id_artikel'] ?>" >
						<b> Judul Artikel 	: </b>
						<input type="text" name="judul_artikel" style="width:100%"	 placeholder="Judul Artikel" value="<?php echo $data['judul_artikel'] ?>" required/><br>
						<b> Isi Artikel 	: </b>
						<textarea name="isi_artikel" style="width:100%; height:450px" placeholder="<?php echo $data['isi_artikel'] ?>" value="<?php echo $data['isi_artikel'] ?>"required></textarea><br>
						<b> File Gambar 	: <br></b>
						<div class="col-md-3 agileinfo_single">
							<img src="<?php echo $data['gambar_artikel']; ?>" class="img-responsive" required/>
						</div><br><br><br><br><br><br><br><br><br>
						<input type="file" name="gambar_artikel" value="<?php echo $data['gambar_artikel']; ?>" required/>
							<input type="submit" name="edit" value="edit">
					</form>
				</div>
					<?php 
						}
					?>
					<div class="register-home">
						<a href="processarticle.php">BATAL</a>
					</div>
			</div>
		</div>
	<!-- //register -->
	
<?php
	include 'footer.php';
?>