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

$img_name = date("Ymdis");
if($_SESSION['driverid']>0)
$photo=($_FILES["photo"]["name"]!="")?"drivers/driver_".$img_name.".".pathinfo($_FILES['photo']['name'], PATHINFO_EXTENSION):"";
else
$photo=($_FILES["photo"]["name"]!="")?"customers/customer_".$img_name.".".pathinfo($_FILES['photo']['name'], PATHINFO_EXTENSION):"";

if($_FILES["photo"]["name"]!="")
{
    move_uploaded_file($_FILES["photo"]["tmp_name"],"../../admin/".$photo);
	$imgsql = "Image='$photo',";
}

mysqli_query($connect, "UPDATE app_users SET $imgsql Name = '$name' WHERE Id='$id'");
$_SESSION["email"] = $email;
$_SESSION["name"] = $name;
$_SESSION["image"] = $imgsql;

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

?>