<?php require_once 'common/init.php'; $inventory = new inventory(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_inventory'])) { // Update old record if (isset($ID)) { $results = $inventory->inv_update($_POST, $ID); } else { // Insert new $results = $inventory->inv_insert($_POST); } if ($results) { echo 'Success'; } else { echo 'Error'; } } if (isset($ID)) { $inventory_result = $inventory->inv_get($ID); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Add Inventroy</title> </head> <body>