mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
added roundtrip option to add_mileage
This commit is contained in:
5
post.php
5
post.php
@@ -229,10 +229,15 @@ if(isset($_POST['add_mileage'])){
|
||||
$starting_location = strip_tags(mysqli_real_escape_string($mysqli,$_POST['starting_location']));
|
||||
$destination = strip_tags(mysqli_real_escape_string($mysqli,$_POST['destination']));
|
||||
$miles = intval($_POST['miles']);
|
||||
$roundtrip = intval($_POST['roundtrip']);
|
||||
$purpose = strip_tags(mysqli_real_escape_string($mysqli,$_POST['purpose']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO mileage SET mileage_date = '$date', mileage_starting_location = '$starting_location', mileage_destination = '$destination', mileage_miles = $miles, mileage_purpose = '$purpose'");
|
||||
|
||||
if($roundtrip == 1){
|
||||
mysqli_query($mysqli,"INSERT INTO mileage SET mileage_date = '$date', mileage_starting_location = '$destination', mileage_destination = '$starting_location', mileage_miles = $miles, mileage_purpose = '$purpose'");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Mileage added";
|
||||
|
||||
header("Location: mileage.php");
|
||||
|
||||
Reference in New Issue
Block a user