<?php
 include("./commonpages/dbconnect.php");
						session_start();
						$id = $_SESSION['sid'];
						$id = $_SESSION['sid'];
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="This is social network html5 template available in themeforest......" />
		<meta name="keywords" content="Social Network, Social Media, Make Friends, Newsfeed, Profile Page" />
		<meta name="robots" content="index, follow" />
		<title>Edit Profile | Edit Profile Page</title>

    <!-- Stylesheets
    ================================================= -->
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/ionicons.min.css" />
    <link rel="stylesheet" href="css/font-awesome.min.css" />
    
    <!--Google Font-->
    <link href="https://fonts.googleapis.com/css?family=Lato:300,400,400i,700,700i" rel="stylesheet">
    
    <!--Favicon-->
    <link rel="shortcut icon" type="image/png" href="images/fav.png"/>
	</head>
  <body>

    <!-- Header
    ================================================= -->
		<?php include("commonpages/header.php");?>
    <!--Header End-->

    <div class="container">

      <!-- Timeline
      ================================================= -->
      <div class="timeline">
          <!--Timeline Menu for Large Screens-->
          <div class="timeline-nav-bar hidden-sm hidden-xs">
            <div class="row">
              <div class="col-md-3">

                <div class="profile-info">              
                  <h3></h3>
                  <p class="text-muted">Creative Director</p>
                   <a href="image_upload.php?profile"><button class="btn-primary">Profile Pic</button></a>
                  &nbsp;&nbsp;&nbsp;
                   <a href="image_upload.php?cover"><button class="btn-primary">Cover Pic</button></a>
                </div>
              </div>      
            </div>
          </div><!--Timeline Menu for Large Screens End-->

          <!--Timeline Menu for Small Screens-->
          <div class="navbar-mobile hidden-lg hidden-md">
            <div class="profile-info">
              <h4>Sarah Cruiz</h4>
              <p class="text-muted">Creative Director</p>
                   <button class="btn-primary">Profile Pic</button>
                  &nbsp;&nbsp;&nbsp;
                  <button class="btn-primary">Cover Pic</button>
            </div>
            
          </div><!--Timeline Menu for Small Screens End-->

        </div>
        <div id="page-contents">
          <div class="row">
            <div class="col-md-3">
              
              <!--Edit Profile Menu-->
              <ul class="edit-menu">
              	
				<li><i class="icon ion-ios-information-outline"></i><a href="edit-profile-basic.php">Basic Information</a></li>
              	<li><i class="icon ion-ios-briefcase-outline"></i><a href="edit-profile-work-edu.php">Education and Work</a></li>
              	<li><i class="icon ion-ios-heart-outline"></i><a href="edit-profile-interests.php">My Interests</a></li>
                <li><i class="icon ion-ios-settings"></i><a href="edit-profile-settings.php">Account Settings</a></li>
              	<li><i class="icon ion-ios-locked-outline"></i><a href="edit-profile-password.php">Change Password</a></li>
              </ul>
            </div>
            <div class="col-md-7">

              <!-- Basic Information
              ================================================= -->
              <div class="edit-profile-container">
                <div class="block-title">
                  <h4 class="grey"><i class="icon ion-android-checkmark-circle"></i>Edit Image</h4>
                  <div class="line"></div>
                  <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate</p>
                  <div class="line"></div>
                </div>
				<?php
				        include("./commonpages/dbconnect.php");
						
						 $action=$_GET['action'];
						 $sql="SELECT * FROM user_registration WHERE id=$id";
						$data=mysqli_query($con,$sql);
						if(mysqli_num_rows($data)>0)
						{
						$row=mysqli_fetch_array($data);
				?>
				
                <div class="edit-block">
                  <form name="basic-info" id="basic-info" class="form-inline" action="model/model_image_update.php" method="post" enctype="multipart/form-data">
				  <input type="hidden" value="<?php echo$row['id'];?>" name="id">
                    
                    <div class="form-group  col-md-12">
						<div class="form-group" style="margin-left:150px">
							<label>Present Image</label><br>
							<?php if($action=="profile"){?>
							<input type="hidden"  name="oldimage" value="<?php echo $row['profile_pic']; ?>" >		
							<img src='./images/profile_pic/<?php echo $row['profile_pic']; ?>' width="300px" height="200px" >
							<?php }
							else{
							?>
							<input type="hidden"  name="oldimage" value="<?php echo $row['cover_pic']; ?>" >									
							<img src='./images/cover_pic/<?php echo $row['cover_pic']; ?>' width="300px" height="200px" >
							<?php } ?>
						</div>
					</div>

					<div class="form-group " style="margin-left:150px">
						<div class="form-group col-md-12">
							<label>Upload New  Image </label><br>
										
							<input type="hidden"  name="image_action" value="<?php echo $action; ?>" >						
							<input type="file" name="image" class="form-control" style="width:500px">	
                          						
						</div>
						 <input type="submit" class="btn btn-primary" name="save" style=" width:300px" value="Update Image">	
					</div>	
             
                  </form>
                </div>
				<?php
						}
				?>
              </div>
            </div>
            <div class="col-md-2 static">
              
              <!--Sticky Timeline Activity Sidebar-->
            </div>
          </div>
        </div>
      </div>
    </div>


    <!-- Footer
    ================================================= -->
   <?php include("commonpages/footer.php");?>
    
    <!--preloader-->
    <div id="spinner-wrapper">
      <div class="spinner"></div>
    </div>

    <!-- Scripts
    ================================================= -->
    <script src="js/jquery-3.1.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.sticky-kit.min.js"></script>
    <script src="js/jquery.scrollbar.min.js"></script>
    <script src="js/script.js"></script>
    
  </body>
</html>
