<?php include ("connection/conn.php");

$select="SELECT * from Manage_Member where id='".$_REQUEST['id']."'";
$query=mysqli_query($link,$select);
$fetchdata=mysqli_fetch_array($query);



if(isset($_POST['submit']))
{
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Mobile=$_POST['Mobile'];
$Address=$_POST['Address'];
$qualification=$_POST['qualification'];
$date=date('Y-m-d');


  if($_FILES['Images']['name']!=="")
  {
$filename=$_FILES['Images']['name'];
$tempname=$_FILES['Images']['tmp_name'];
$folder="../members_img/".$filename;
move_uploaded_file($tempname,$folder);
  }
  else
  {
	$filename=$fetchdata['Images']; 
  }
$update="UPDATE Manage_Member set Name='$Name',Email='$Email',Mobile='$Mobile',Address='$Address',qualification='$qualification',Images='$filename'where id='".$_REQUEST['id']."'";
mysqli_query($link,$update);
header("location:manage-member.php");
}
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Administrator | Global Waste Solution</title>
		<link href="css/bootstrap.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
	</head>
	
	<body>
		<div id="wrapper">
			<?php
				include("top-header.php");
				include("right-sec.php");
			?>
			<div id="page-wrapper" >
				<div id="page-inner">
					<div class="row">
						<div class="col-md-12">
							<h3 class="page-header">
								Add Gallery<small></small>
							</h3>
							<div class="table-sec">
								<div class="srch_box">
									<form  Name="member" method="post" action="#"  enctype="multipart/form-data">
										<div class="row">
											<div class="col-md-12 col-xs-12">
												<div class="enq_box">
													<div class="col-md-6 col-xs-6">	
														<div class="form-group form-select">
															<label>Name <span>*</span></label>
															<input class="form-control" type="text" name="Name" value="<?php echo $fetchdata['Name']?>">
														</div>		
													</div>
													
													<div class="col-md-6 col-xs-6">	
														<div class="form-group form-select">
															<label>Email <span>*</span></label>
															<input class="form-control" type="text" name="Email" value="<?php echo $fetchdata['Email']?>">
														</div>		
													</div>
													
													<div class="col-md-6 col-xs-6">	
														<div class="form-group form-select">
															<label>Mobile <span>*</span></label>
															<input class="form-control" type="text" name="Mobile" value="<?php echo $fetchdata['Mobile']?>">
														</div>		
													</div>
														<div class="col-md-6 col-xs-6">	
														<div class="form-group form-select">
															<label>Qualification</label>
															<input class="form-control" type="text" name="qualification">
														</div>		
													</div>
													
													
													
													<div class="col-md-6 col-xs-6">		
														<div class="form-group form-select">
															<label>Upload Image<span>*</span></label>
															<input class="form-control" type="file"  name="Images" value="<?php echo $fetchdata['Images']?>" >> <img src="https://aryansinstitute.com/members_img/<?php echo $fetchdata['Images']?>" style="width:80px; height:80px"></
														</div>		
													</div>
													
													<div class="col-md-6 col-xs-6">	
														<div class="form-group form-select">
															<label>Address <span>*</span></label>
														<textarea name="Address"value="<?php echo $fetchdata['Address']?>"> <?php echo $fetchdata['Address']?></textarea>
														</div>		
													</div>
													
													
												</div>
												
											</div>	
											
										</div>
										<div class="row">
											<div class="col-md-4 col-xs-4">	
												<div class="btn_sec">
													<input type="submit" name="submit" value="Submit" />
												</div>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div> 
				</div>
			</div>
			<footer class="footer-sec">
				<div class="container">
					<div class="row">
						<div class="col-md-12">
							<p class="text-center">All right reserved. Template Design by: <a href="">Anshul Chittouria</a></p>
						</div>
					</div>
				</div>
			</footer>
		</div>
		
		
		<!-- jQuery Js -->
		<script src="js/jquery-1.10.2.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/jquery.metisMenu.js"></script>
		<script src="js/custom-scripts.js"></script>
	</body>
</html>
