<?php 
	require_once('Connections/conn_ama.php');

	if(!isset($_SESSION)){
		session_start();
		$colname = -1;
		if(isset($_POST['ah']))
		{
			$colname = $_POST['ah'];
		}
    } 

		//Retrieve Galleries
		$query_rsGalleries = "SELECT galleryID, ah, gallerytitle, gallerydesc, dateAdded  FROM galleries WHERE ah = '".$colname."'";
		$rsGalleries = mysqli_query($conn_ama, $query_rsGalleries ) or die(mysqli_error($conn_ama));
		$row_rsGalleries = mysqli_fetch_assoc($rsGalleries);
		$totalRows_rsGalleries = mysqli_num_rows($rsGalleries);/**/
 ?>

<!-- <div class="col-md-9 data-area"> -->

	<div class="data-area-wrap">
		<div class="form-wrapper">
			<form id="update-gallery" method="post">
			  	<fieldset>
			  	<legend>Edit Gallery</legend>
			  		
				  	<div class="form-group">
					    <label for="gallerytitle">Gallery</label>
					    <input type="text" name="gallerytitle" class="form-control" id="gallerytitle" value="<?php echo $row_rsGalleries['gallerytitle']; ?>" >
				  	</div>

				  	<div class="form-group">
					    <label for="elm1">Description</label>
					  	<textarea name="gallerydesc" class="form-control" cols="" rows="3" id="emlm1"><?php echo $row_rsGalleries['gallerydesc']; ?></textarea>
				  	</div>
			  	</fieldset>
				<hr>
			  <button type="submit" id="update-new-gallery" class="btn btn-success">Submit</button>
			  <input type="hidden" name="MM_galleryID" value="<?php echo $row_rsGalleries['galleryID']; ?>" >
			  <input type="hidden" name="MM_update" value="save-gallery-update" >
			  <div class="error_msg"></div>
			</form>
		</div><!-- End .form-wrapper-->
	</div><!-- End .data-area-wrap-->	
<!-- </div>    End .data-area -->