Esempio n. 1
0
if (!isset($_SESSION['username']) || !isset($_SESSION['password'])) {
    header("Location: login.php");
}
include "inc/functions.php";
include "inc/pigdet.php";
$pig = new pigdet_functions();
$db = new phpork_functions();
if (isset($_POST['ed_birth'])) {
    $newbirth = $_POST['ed_birth'];
    $newweight = $_POST['ed_weight'];
    $newuser = "******";
    $prevbirth = $pig->getBirthDate($_GET['pig']);
    $prevweight = $pig->getWeight($_GET['pig']);
    $prevuser = $pig->getUserEdited($_GET['pig']);
    $db->updatePigDetails($_GET['pig'], $newbirth, $newweight, $newuser);
    $db->insertEditHistory($prevbirth, $prevweight, $prevuser, $_GET['pig']);
}
?>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Pork Traceability System</title>
        <link rel="stylesheet" href="css/bootstrap.css">
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/bootstrap-theme.css">
        <link rel="stylesheet" href="css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="css/style2.css">
        <script src="js/jquery.js"></script>
    </head>
    <body>