<?php include("../cn.php");
$id = $_REQUEST["id"];
$email = $_REQUEST["email"];
$name = $_REQUEST["fullname"];

$img_name = date("Ymdis");

$photo=($_FILES["photo"]["name"]!="")?"profiles/admin_".$img_name.".".pathinfo($_FILES['photo']['name'], PATHINFO_EXTENSION):"";
if($_FILES["photo"]["name"]!="")
{
    move_uploaded_file($_FILES["photo"]["tmp_name"],"../".$photo);
	$imgsql = "Image='$photo',";

}


mysqli_query($connect, "update users set $imgsql FullName = '$name' where Id='$id'");
$_SESSION["email"] = $email;
$_SESSION["name"] = $name;
$_SESSION["image"] = $imgsql;

header("location:../profile-settings.php");

?>