<?php

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

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