diff --git a/add_contact_modal.php b/add_contact_modal.php index 6928e138..5a4d01cf 100644 --- a/add_contact_modal.php +++ b/add_contact_modal.php @@ -31,22 +31,32 @@
- +
- +
- + +
+
+ +
+ +
+
+ +
+
- +
diff --git a/client_contacts.php b/client_contacts.php index 84f31a4f..4e9584d2 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -87,6 +87,10 @@ $total_pages = ceil($total_found_rows / 10); if(strlen($contact_phone)>2){ $contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4); } + $contact_mobile = $row['contact_mobile']; + if(strlen($contact_phone)>2){ + $contact_mobile = substr($row['contact_mobile'],0,3)."-".substr($row['contact_mobile'],3,3)."-".substr($row['contact_mobile'],6,4); + } $contact_email = $row['contact_email']; $contact_photo = $row['contact_photo']; $contact_initials = initials($contact_name); @@ -114,7 +118,7 @@ $total_pages = ceil($total_found_rows / 10); - +

- +
- +
- + +
+
+ +
+ +
+
+ +
+
- +
diff --git a/edit_trip_modal.php b/edit_trip_modal.php index c0ae816a..95ee14cf 100644 --- a/edit_trip_modal.php +++ b/edit_trip_modal.php @@ -74,6 +74,11 @@
+
+ class="custom-control-input" id="customControlAutosizing" name="roundtrip" value="1" > + +
+
diff --git a/post.php b/post.php index 20979487..6f90481a 100644 --- a/post.php +++ b/post.php @@ -563,11 +563,7 @@ if(isset($_POST['add_trip'])){ $location_id = intval($_POST['location']); $vendor_id = intval($_POST['vendor']); - mysqli_query($mysqli,"INSERT INTO trips SET trip_date = '$date', trip_starting_location = '$starting_location', trip_destination = '$destination', trip_miles = $miles, trip_purpose = '$purpose', trip_created_at = NOW(), client_id = $client_id, invoice_id = $invoice_id, location_id = $location_id, vendor_id = $vendor_id"); - - if($roundtrip == 1){ - mysqli_query($mysqli,"INSERT INTO trips SET trip_date = '$date', trip_starting_location = '$destination', trip_destination = '$starting_location', trip_miles = $miles, trip_purpose = '$purpose', trip_created_at = NOW(), client_id = $client_id, invoice_id = $invoice_id, location_id = $location_id, vendor_id = $vendor_id"); - } + mysqli_query($mysqli,"INSERT INTO trips SET trip_date = '$date', trip_starting_location = '$starting_location', trip_destination = '$destination', trip_miles = $miles, round_trip = $round_trip, trip_purpose = '$purpose', trip_created_at = NOW(), client_id = $client_id, invoice_id = $invoice_id, location_id = $location_id, vendor_id = $vendor_id"); $_SESSION['alert_message'] = "Trip added"; @@ -582,13 +578,14 @@ if(isset($_POST['edit_trip'])){ $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'])); $client_id = intval($_POST['client']); $invoice_id = intval($_POST['invoice']); $location_id = intval($_POST['location']); $vendor_id = intval($_POST['vendor']); - mysqli_query($mysqli,"UPDATE trips SET trip_date = '$date', trip_starting_location = '$starting_location', trip_destination = '$destination', trip_miles = $miles, trip_purpose = '$purpose', trip_updated_at = NOW(), client_id = $client_id, invoice_id = $invoice_id, location_id = $location_id, vendor_id = $vendor_id WHERE trip_id = $trip_id"); + mysqli_query($mysqli,"UPDATE trips SET trip_date = '$date', trip_starting_location = '$starting_location', trip_destination = '$destination', trip_miles = $miles, trip_purpose = '$purpose', round_trip = $round_trip, trip_updated_at = NOW(), client_id = $client_id, invoice_id = $invoice_id, location_id = $location_id, vendor_id = $vendor_id WHERE trip_id = $trip_id"); $_SESSION['alert_message'] = "Trip modified"; @@ -2259,6 +2256,8 @@ if(isset($_POST['add_contact'])){ $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title'])); $phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone'])); $phone = preg_replace("/[^0-9]/", '',$phone); + $mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile'])); + $mobile = preg_replace("/[^0-9]/", '',$mobile); $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); if($_FILES['file']['tmp_name']!='') { @@ -2268,7 +2267,7 @@ if(isset($_POST['add_contact'])){ move_uploaded_file($_FILES['file']['tmp_name'], $path); } - mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id"); + mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id"); $_SESSION['alert_message'] = "Contact added"; @@ -2284,6 +2283,8 @@ if(isset($_POST['edit_contact'])){ $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title'])); $phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone'])); $phone = preg_replace("/[^0-9]/", '',$phone); + $mobile = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mobile'])); + $mobile = preg_replace("/[^0-9]/", '',$mobile); $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); $path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path'])); @@ -2295,7 +2296,7 @@ if(isset($_POST['edit_contact'])){ move_uploaded_file($_FILES['file']['tmp_name'], $path); } - mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email', contact_photo = '$path', contact_updated_at = NOW() WHERE contact_id = $contact_id"); + mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_mobile = '$mobile', contact_email = '$email', contact_photo = '$path', contact_updated_at = NOW() WHERE contact_id = $contact_id"); $_SESSION['alert_message'] = "Contact updated"; diff --git a/trips.php b/trips.php index b1f7a9b4..bb88dfce 100644 --- a/trips.php +++ b/trips.php @@ -86,18 +86,23 @@ $trip_starting_location = $row['trip_starting_location']; $trip_destination = $row['trip_destination']; $trip_miles = $row['trip_miles']; + $round_trip = $row['round_trip']; $client_id = $row['client_id']; $invoice_id = $row['invoice_id']; $location_id = $row['location_id']; $vendor_id = $row['vendor_id']; + if($round_trip == 1){ + $round_tip_display = ""; + } + ?> - +