<?php
session_start();
if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
 header("Location: index.php");
} 
 //include 'logoff.html';
?>
<?php
$link = mysqli_connect("localhost", "comeadve_glory1", "Safari#@2027$", "comeadve_tdmc");

    if($link === false){

        die("ERROR: Could not connect. " . mysqli_connect_error());

}
$acc=$_POST['IDNumber'];
$name=$_POST['Name'];
$phone=$_POST['Phone'];
$id=$_POST['Id'];

$sqlc = "UPDATE tentcrew
        SET IDNumber='$acc', Name='$name', Phone='$phone'
        WHERE Id=$id ";
$restc=mysqli_query($link,$sqlc);	
  
if($restc){
	
	    $msg = "Edited successfully.";
        header("location:edittcrew.php?msg=$msg");
}
else{
        $msg = "Try again";
        header("location:edittcrew.php?msg=$msg");
}

mysqli_close($link);
?>