<?php

session_start();



if (!isset($_SESSION['tulsilogin'])) {

    header('Location: index.php');

    return;

}

if (!isset($_POST['id'])) {

    header('Location: prospect_management.php');

}



include("connect.php");

$name = $_POST['name'] ?? "";

$mobile = $_POST['mobile'] ?? "";

$email = $_POST['email'] ?? "";

$source = $_POST['source'] ?? "";

$city = $_POST['city'] ?? "";

$country = $_POST['country'] ?? "";

$status = $_POST['status'] ?? "new";

$staffID = $_POST['staff'];

$id = $_POST['id'];



$eve = "update res_prospect_management set name='$name',mobile='$mobile',email='$email',source='$source',city='$city',country='$country',status='$status',staffid='$staffID' where id=$id";



if ($conn->query($eve) === TRUE) {

    $_SESSION['msg'] = "Record updated successfully";

} else {

    $_SESSION['msg'] = "Error in record update";

}

header('Location: prospect_management.php');



?>