<?php
require 'config/db_conn.php';

$id       = intval($_POST['id']);
$uid      = $_POST['uid'];
$passport = $_POST['passport'];
$name     = $_POST['name'];
$father   = $_POST['father'];
$mother   = $_POST['mother'];
$start    = $_POST['start'];
$end      = $_POST['end'];
$birth    = $_POST['birth'];

$sql = "UPDATE users SET
        uid=?,
        passport=?,
        name=?,
        father=?,
        mother=?,
        start=?,
        end=?,
        birth=?
        WHERE id=?";

$stmt = $conn->prepare($sql);
$stmt->bind_param(
    "ssssssssi",
    $uid, $passport, $name, $father, $mother,
    $start, $end, $birth, $id
);

$stmt->execute();

header("Location: data.php");
exit;
