<?php

include $_SERVER['DOCUMENT_ROOT'] . "/classes/autoload.php";

$client_id = $db->query("stock", "UPDATE `payments` SET `invoice_id`='" . $_POST['invoice_id'] . "', `amount`='" . $function->number_to_save($_POST['amount']) . "', `date_time`='" . $_POST['date'] . "', `user_id`='" . $_SESSION['user_id'] . "', `pyament_type`='" . $_POST['pyament_type'] . "' WHERE `record_id`='" . $_POST['record_id'] . "'");
if ($client_id > 0) {
    header("location: home.php");
}