<?php require_once "lib/Trip.class.php"; require_once "lib/vcomp.datetime.class.php"; $trip_date = new VCOMP_DateTime("trip_date"); $newTrip = new Trip(); $newTrip->setTripDate($trip_date->getTimestamp()); $newTrip->setDuration($_POST["hours"] * 3600 + $_POST["minutes"] * 60 + $_POST["seconds"]); $newTrip->setDistance($_POST["distance"]); $newTrip->setAvgSpeed($_POST["avg_speed"]); $newTrip->setMaxSpeed($_POST["max_speed"]); $newTrip->setOdometer($_POST["odometer"]); $newTrip->setCalories($_POST["calories"]);
<?php require_once "lib/vcomp.datetime.class.php"; $trip_date = new VCOMP_DateTime("trip_date"); $trip_date->isMonthAbbreviated(true); ?> <html> <head> <title>Add new Trip</title> </head> <body> <h1>Add New Trip</h1> <br> <form name="frmNewTrip" action="addTrip.php" method="POST"> <table> <tr> <td>unit</td> <td> <select name="unit"> <option value="m">metric</option> <option value="i">imperial</option> </select> </td> </tr> <tr> <td>Trip date/time</td> <td> <?php echo $trip_date->draw(1, 1, 1, 1, 1); ?>