<?php
    include("config.php");
    $id = $_GET['id'];
    
    $select_pro = $conn->prepare("SELECT * FROM product WHERE product_id=?");
    $select_pro->bind_param("s", $id);
    $select_pro->execute();
    $pro_result = $select_pro->get_result();
    $pro_fetch = $pro_result->fetch_assoc();
    $product_title = $pro_fetch['product_title'];
    $product_amount = $pro_fetch['product_amount'];
    $product_desc = $pro_fetch['product_desc'];
    
?>
	<?php include("inc/header.php") ?>

		<body data-spy="scroll" data-target="#navSection" data-offset="100">
			<?php include("inc/sidebar.php") ?>
				<!-- sidebar -->
				<div class="content">
					<div class="header">
						<div class="header-left"> <a href="#" class="burger-menu"><i data-feather="menu"></i></a> </div>
						<!-- header-left -->
						<div class="header-right"> 
						
							<div class="dropdown dropdown-loggeduser">
								<a href="#" class="dropdown-link" data-toggle="dropdown">
									<div class="avatar avatar-sm"> <img src="https://cdn.iconscout.com/icon/free/png-256/laptop-user-1-1179329.png" class="rounded-circle" alt=""> </div>
									<!-- avatar -->
								</a>
								<div class="dropdown-menu dropdown-menu-right">
									<div class="dropdown-menu-header">
										<div class="media align-items-center">
											
											<!-- avatar -->
											<div class="media-body mg-l-10">
												<h6>MACHINES
</h6> <span>Administrator</span> </div>
										</div>
										<!-- media -->
									</div>
									<div class="dropdown-menu-body"> <a href="changepwd.php" class="dropdown-item"><i data-feather="user"></i> 
									View Profile</a> <a href="../" class="dropdown-item"><i data-feather="log-out"></i> Sign Out</a> </div>
								</div>
								<!-- dropdown-menu -->
							</div>
						</div>
						<!-- header-right -->
					</div>
					<!-- header -->
					<div class="content-header">
						<div>
							<h4 class="content-title">Dashboard</h4> </div>
					</div>
					<!-- content-header -->
					<div class="content-body">
					    
					    <div class="row" style="margin-top:10px;">
                            <div class="col-md-12">
                                
                                    <form method="post" action="product_edit.php" enctype="multipart/form-data">
                                        
                                        <input type="hidden" name="id" value="<?php echo $id; ?>">
											<label>Edit Product Title</label><br>
                        <input type="text" class="form-control" name="product_title" id="title" placeholder="<?php echo $product_title; ?>"required/><br>
											<span class="focus-input100" data-placeholder="&#xf207;"></span>
											<label>Edit Product Amount</label><br>
                        <input type="text" class="form-control" name="product_amount" id="money" placeholder="<?php echo $product_amount; ?>"required/><br>
											<span class="focus-input100" data-placeholder="&#xf207;"></span>
											<label>Edit Product Description</label><br>
                        <textarea  rows="10" cols="150" name="product_desc"required></textarea><br>
											
									<span class="focus-input100" data-placeholder="&#xf207;"></span>
										<input type="submit" id="form_submit" class="btn btn-success" value="Edit Product" />
								</form>
								
                                	</div>
                    
                            </div>
					    </div>
					</div>
				</div>
				<!-- content-body -->
				<script src="lib/jquery/jquery.min.js"></script>
				<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
				<script src="lib/feather-icons/feather.min.js"></script>
				<script src="lib/perfect-scrollbar/perfect-scrollbar.min.js"></script>
				<script src="lib/prismjs/prism.js"></script>
				<script src="lib/js-cookie/js.cookie.js"></script>
				<script src="assets/js/cassie.js"></script>
				<script>
				$(function() {
					'use strict'
				})
				</script>
				<script>
				$(function() {
					'use strict'
					$('#modal6').on('show.bs.modal', function(event) {
							var animation = $(event.relatedTarget).data('animation');
							$(this).addClass(animation);
						})
						// hide modal with effect
					$('#modal6').on('hidden.bs.modal', function(e) {
						$(this).removeClass(function(index, className) {
							return(className.match(/(^|\s)effect-\S+/g) || []).join(' ');
						});
					});
				})
				</script>
		</body>

		</html>