Example #1
0
if (isset($_POST["Category"])) {
    $TrCategory = $_POST["Category"];
} else {
    $TrCategory = "None";
}
if (isset($_POST["SubCategory"])) {
    $TrSubCategory = $_POST["SubCategory"];
} else {
    $TrSubCategory = "None";
}
$TrAmount = $_POST["Amount"];
$TrNotes = $_POST["Notes"];
#Execute common insert
db_function::category_insert_single($TrCategory, $TrSubCategory);
db_function::payee_insert_single($TrPayee, $TrCategory, $TrSubCategory);
db_function::payee_update_single($TrPayee, $TrCategory, $TrSubCategory);
if (isset($_POST["TrEditedNr"])) {
    $TrEditedNr = $_POST["TrEditedNr"];
    # Update
    db_function::transaction_update($TrEditedNr, $TrDate, $TrStatus, $TrType, $TrAccount, $TrToAccount, $TrPayee, $TrCategory, $TrSubCategory, $TrAmount, $TrNotes);
    echo "<script type='text/javascript'>";
    echo "location.href='show.php'";
    echo "</script>";
} else {
    $TrEditedNr = db_function::transaction_insert($TrDate, $TrStatus, $TrType, $TrAccount, $TrToAccount, $TrPayee, $TrCategory, $TrSubCategory, $TrAmount, $TrNotes);
}
attachments::rename_zero($TrEditedNr);
?>
        
        <div class="container text_align_center">
            <br />