Added Location to Global View, updated links and fixed password pop over moving you to the top of the page when clicked in asset and conact details

This commit is contained in:
johnnyq
2025-02-20 16:25:07 -05:00
parent 2795b4e15e
commit fc00b5e78f
17 changed files with 106 additions and 56 deletions

View File

@@ -368,23 +368,22 @@ if (isset($_POST['bulk_delete_locations'])) {
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['export_client_locations_csv'])){
$client_id = intval($_POST['client_id']);
//get records from database
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE client_id = $client_id");
$row = mysqli_fetch_array($sql);
$client_name = sanitizeInput($row['client_name']);
if(isset($_POST['export_locations_csv'])){
if (isset($_POST['client_id'])) {
$client_id = intval($_POST['client_id']);
$client_query = "AND location_client_id = $client_id";
} else {
$client_query = '';
}
//Locations
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_archived_at IS NULL $client_query ORDER BY location_name ASC");
$num_rows = mysqli_num_rows($sql);
if($num_rows > 0) {
$delimiter = ",";
$filename = strtoAZaz09($client_name) . "-Locations-" . date('Y-m-d') . ".csv";
$filename = "Locations-" . date('Y-m-d') . ".csv";
//create a file pointer
$f = fopen('php://memory', 'w');
@@ -411,13 +410,13 @@ if(isset($_POST['export_client_locations_csv'])){
}
// Logging
logAction("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file", $client_id);
logAction("Location", "Export", "$session_name exported $num_rows location(s) to a CSV file");
exit;
}
if(isset($_POST["import_client_locations_csv"])){
if(isset($_POST["import_locations_csv"])){
enforceUserPermission('module_client', 2);
@@ -515,17 +514,10 @@ if(isset($_POST["import_client_locations_csv"])){
}
}
if(isset($_GET['download_client_locations_csv_template'])){
$client_id = intval($_GET['download_client_locations_csv_template']);
//get records from database
$sql = mysqli_query($mysqli,"SELECT client_name FROM clients WHERE client_id = $client_id");
$row = mysqli_fetch_array($sql);
$client_name = $row['client_name'];
if(isset($_GET['download_locations_csv_template'])){
$delimiter = ",";
$filename = strtoAZaz09($client_name) . "-Locations-Template.csv";
$filename = "Locations-Template.csv";
//create a file pointer
$f = fopen('php://memory', 'w');