<?php
 include("./commonpages/dbconnect.php");
						session_start();
						$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 | Work and Education</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">
	  
	  <?php
				       
						 $sql_image="SELECT u.cover_pic, u.profile_pic, u.first_name, u.last_name, u.id, w.designation, w.user_id FROM user_registration u, work w WHERE u.id=$id AND w.user_id=$id";
						$data_image=mysqli_query($con,$sql_image);
						if(mysqli_num_rows($data_image)>0)
						{
						$row_image=mysqli_fetch_array($data_image);
				?>
        <div style="background-image:url('images/cover_pic/<?php echo $row_image['cover_pic'];?>'); height:300px"   class="timeline-cover">

          <!--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">
                  <img src="images/profile_pic/<?php echo $row_image['profile_pic'];?>" alt="person" class="img-responsive profile-photo" />
                  <h3><?php echo $row_image['first_name']." ".$row_image['last_name'];?></h3>
                  <p class="text-muted"><?php echo $row_image['designation'];?></p>
                </div>
              </div>
              <div class="col-md-9">
                <ul class="list-inline profile-menu">
                  <li><a href="timeline.php">Timeline</a></li>
                  <li><a href="timeline-about.php" class="active">About</a></li>
                  <li><a href="timeline-album.php">Album</a></li>
                  <li><a href="timeline-friends.php">Friends</a></li>
                </ul>
                <ul class="follow-me list-inline">
                  <li>1,299 people following her</li>
                  <li><button class="btn-primary">Add Friend</button></li>
                </ul>
              </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">
                  <img src="images/profile_pic/<?php echo $row_image['profile_pic'];?>" alt="person" class="img-responsive profile-photo" />
                  <h3><?php echo $row_image['first_name']." ".$row_image['last_name'];?></h3>
                  <p class="text-muted"><?php echo $row_image['designation'];?></p>
                </div>
            <div class="mobile-menu">
              <ul class="list-inline">
                <li><a href="timline.php">Timeline</a></li>
                <li><a href="timeline-about.php" class="active">About</a></li>
                <li><a href="timeline-album.php">Album</a></li>
                <li><a href="timeline-friends.php">Friends</a></li>
              </ul>
              <button class="btn-primary">Add Friend</button>
            </div>
          </div><!--Timeline Menu for Small Screens End-->

        </div>
		<?php
						}
		?>
		
		
        <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 class="active"><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">

              <!-- Edit Work and Education
              ================================================= -->
              <div class="edit-profile-container">
                <div class="block-title">
                  <h4 class="grey"><i class="icon ion-ios-book-outline"></i>My education</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
				     
						//$i=$_SESSION['sid'];
						 $sql="SELECT * FROM education WHERE user_id=$id";
						$data=mysqli_query($con,$sql);
						if(mysqli_num_rows($data)>0)
						{
						$row=mysqli_fetch_array($data);
				?>
                <div class="edit-block">
                  <form name="education" id="education" class="form-inline" action="model/model_edit_profile_work_edu_update.php" method="post">
				  <input type="hidden" value="<?php echo$row['id'];?>" name="id">
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="school">My university</label>
                        <input id="school" class="form-control input-group-lg" type="text" name="school" title="Enter School" placeholder="My School" value="<?php echo$row['university_name'];?>" />
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-6">
                        <label for="date-from">From</label>
                        <input id="date-from" class="form-control input-group-lg" type="text" name="fom" title="Enter a Date" placeholder="from" value="<?php echo$row['year_from'];?>" />
                      </div>
                      <div class="form-group col-xs-6">
                        <label for="date-to" class="">To</label>
                        <input id="date-to" class="form-control input-group-lg" type="text" name="to" title="Enter a Date" placeholder="to" value="<?php echo$row['year_to'];?>" />
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="edu-description">Description</label>
                        <textarea id="edu-description" name="description" class="form-control" placeholder="Some texts about my education" rows="4" cols="400"><?php echo$row['description'];?></textarea>
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="graduate">Graduated:-</label>
						<?php
					     $graduate=$row['graduate'];
					  ?>
                       <label class="radio-inline">
                        <input type="radio" name="optradio" value="yes" <?php if($graduate=="yes"){echo"checked";}?>>YES
                      </label>
                      <label class="radio-inline">
                        <input type="radio" name="optradio" value="no" <?php if($graduate=="no"){echo"checked";}?>>NO
                      </label>
                      </div>
                    </div>
                    <button class="btn btn-primary" name="save">Save Changes</button>
                  </form>
                </div>
				<?php
						}
				
						
				?>
                <div class="block-title">
                  <h4 class="grey"><i class="icon ion-ios-briefcase-outline"></i>Work Experiences</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
				//$i=$_SESSION['sid'];
						 $sql1="SELECT * FROM work WHERE user_id=$id";
						$data1=mysqli_query($con,$sql1);
						if(mysqli_num_rows($data1)>0)
						{
						$row1=mysqli_fetch_array($data1);
				?>
                <div class="edit-block">
                  <form name="work" id="work" class="form-inline" action="model/model_edit_profile_work_edu_update.php" method="post">
				   <input type="hidden" value="<?php echo$row1['id'];?>" name="id">
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="company">Company</label>
                        <input id="company" class="form-control input-group-lg" type="text" name="company" title="Enter Company" placeholder="Company name" value="<?php echo$row1['company_name'];?>" />
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="designation">Designation</label>
                        <input id="designation" class="form-control input-group-lg" type="text" name="designation" title="Enter designation" placeholder="designation name" value="<?php echo$row1['designation'];?>" />
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-6">
                        <label for="from-date">From</label>
                        <input id="from-date" class="form-control input-group-lg" type="text" name="from" title="Enter a Date" placeholder="from" value="<?php echo$row1['year_from'];?>" />
                      </div>
                      <div class="form-group col-xs-6">
                        <label for="to-date" class="">To</label>
                        <input id="to-date" class="form-control input-group-lg" type="text" name="to" title="Enter a Date" placeholder="to"value="<?php echo$row1['year_to'];?>"/>
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="work-city">City/Town</label>
                        <input id="work-city" class="form-control input-group-lg" type="text" name="city" title="Enter city" placeholder="Your city"value="<?php echo$row1['city'];?>"/>
                      </div>
                    </div>
                    <div class="row">
                      <div class="form-group col-xs-12">
                        <label for="work-description">Description</label>
                        <textarea id="work-description" name="description" class="form-control" placeholder="Some texts about my work" rows="4" cols="400"><?php echo$row1['description'];?></textarea>
                      </div>
                    </div>
                    <button class="btn btn-primary" name="save_changes">Save Changes</button>
                  </form>
                </div>
				<?php
						}
				?>
              </div>
            </div>
            <div class="col-md-2 static">
              
              <!--Sticky Timeline Activity Sidebar-->
              <div id="sticky-sidebar">
                <h4 class="grey">Sarah's activity</h4>
                <div class="feed-item">
                  <div class="live-activity">
                    <p><a href="#" class="profile-link">Sarah</a> Commended on a Photo</p>
                    <p class="text-muted">5 mins ago</p>
                  </div>
                </div>
                <div class="feed-item">
                  <div class="live-activity">
                    <p><a href="#" class="profile-link">Sarah</a> Has posted a photo</p>
                    <p class="text-muted">an hour ago</p>
                  </div>
                </div>
                <div class="feed-item">
                  <div class="live-activity">
                    <p><a href="#" class="profile-link">Sarah</a> Liked her friend's post</p>
                    <p class="text-muted">4 hours ago</p>
                  </div>
                </div>
                <div class="feed-item">
                  <div class="live-activity">
                    <p><a href="#" class="profile-link">Sarah</a> has shared an album</p>
                    <p class="text-muted">a day ago</p>
                  </div>
                </div>
              </div>
            </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>
