<?php
include("../commonpages/dbconnect.php");
//$id = $_SESSION['sid'];
//echo "hiiiii";
if(isset($_POST['save'])){
 $university=addslashes($_POST['school']);	
 $from=addslashes($_POST['fom']);	
 $to=addslashes($_POST['to']);		
 $desc=addslashes($_POST['description']);	
 $graduate=$_POST['optradio'];	
 $id=$_POST['id'];	


  $sql="UPDATE education SET university_name='$university', year_from='$from', year_to='$to', description='$desc', graduate='$graduate' WHERE id=$id";
mysqli_query($con,$sql);
header("Location:../edit-profile-work-edu.php");
}


if(isset($_POST['save_changes'])){
 $company=addslashes($_POST['company']);	
 $designation=addslashes($_POST['designation']);	
 $from=addslashes($_POST['from']);		
 $to=addslashes($_POST['to']);	
 $city=addslashes($_POST['city']);	
 $description=addslashes($_POST['description']);	
 $id=$_POST['id'];	


  $sql="UPDATE work SET company_name='$company', designation='$designation', year_from='$from', year_to='$to', city='$city', description='$description' WHERE id=$id";
mysqli_query($con,$sql);
header("Location:../edit-profile-work-edu.php");
}

?>