Format csv file with headings & data:
Client Name, Industry, Referral, Website, Location Name, Location Phone, Location Address, City, State, Postal Code, Country, Contact Name, Title, Contact Phone, Extension, Contact Mobile, Contact Email, Hourly Rate, Currency, Payment Terms, Tax ID, Abbreviation
-
+
diff --git a/client_location_import_modal.php b/client_location_import_modal.php
index 42cf942e8..579d82b9f 100644
--- a/client_location_import_modal.php
+++ b/client_location_import_modal.php
@@ -13,7 +13,7 @@
Format csv file with headings & data:
Name, Description, Address, City, State, Postal Code, Phone, Hours
-
+
diff --git a/client_login_import_modal.php b/client_login_import_modal.php
index edf7edc48..566ccdda0 100644
--- a/client_login_import_modal.php
+++ b/client_login_import_modal.php
@@ -13,7 +13,7 @@
Format csv file with headings & data:
Name, Description, Username, Password, URL
-
+
diff --git a/post/user/asset.php b/post/user/asset.php
index 9a1885bac..b9ee2c4b6 100644
--- a/post/user/asset.php
+++ b/post/user/asset.php
@@ -473,8 +473,18 @@
$client_id = intval($_POST['client_id']);
$file_name = $_FILES["file"]["tmp_name"];
+
$error = false;
+ if (!empty($_FILES["file"]["tmp_name"])) {
+ $file_name = $_FILES["file"]["tmp_name"];
+ } else {
+ $_SESSION['alert_message'] = "Please select a file to upload.";
+ $_SESSION['alert_type'] = "error";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
//Check file is CSV
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
$allowed_file_extensions = array('csv');
diff --git a/post/user/client.php b/post/user/client.php
index d497b25a8..60f839ac4 100644
--- a/post/user/client.php
+++ b/post/user/client.php
@@ -387,10 +387,17 @@
if (isset($_POST["import_clients_csv"])) {
enforceUserPermission('module_client', 2);
-
- $file_name = $_FILES["file"]["tmp_name"];
$error = false;
+ if (!empty($_FILES["file"]["tmp_name"])) {
+ $file_name = $_FILES["file"]["tmp_name"];
+ } else {
+ $_SESSION['alert_message'] = "Please select a file to upload.";
+ $_SESSION['alert_type'] = "error";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
//Check file is CSV
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
$allowed_file_extensions = array('csv');
@@ -589,7 +596,7 @@
if (isset($_GET['download_clients_csv_template'])) {
$delimiter = ",";
- $filename = strtoAZaz09($client_name) . "-Clients-Template.csv";
+ $filename = "Clients-Template.csv";
//create a file pointer
$f = fopen('php://memory', 'w');
diff --git a/post/user/contact.php b/post/user/contact.php
index a537a842b..d5fbe7fcf 100644
--- a/post/user/contact.php
+++ b/post/user/contact.php
@@ -822,9 +822,17 @@
enforceUserPermission('module_client', 2);
$client_id = intval($_POST['client_id']);
- $file_name = $_FILES["file"]["tmp_name"];
$error = false;
+ if (!empty($_FILES["file"]["tmp_name"])) {
+ $file_name = $_FILES["file"]["tmp_name"];
+ } else {
+ $_SESSION['alert_message'] = "Please select a file to upload.";
+ $_SESSION['alert_type'] = "error";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
//Check file is CSV
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
$allowed_file_extensions = array('csv');
diff --git a/post/user/credential.php b/post/user/credential.php
index 491b3b1a0..cce38199c 100644
--- a/post/user/credential.php
+++ b/post/user/credential.php
@@ -377,9 +377,17 @@
enforceUserPermission('module_credential', 2);
$client_id = intval($_POST['client_id']);
- $file_name = $_FILES["file"]["tmp_name"];
$error = false;
+ if (!empty($_FILES["file"]["tmp_name"])) {
+ $file_name = $_FILES["file"]["tmp_name"];
+ } else {
+ $_SESSION['alert_message'] = "Please select a file to upload.";
+ $_SESSION['alert_type'] = "error";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
//Check file is CSV
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
$allowed_file_extensions = array('csv');
diff --git a/post/user/location.php b/post/user/location.php
index 6cedd3ede..6df8c008a 100644
--- a/post/user/location.php
+++ b/post/user/location.php
@@ -429,9 +429,17 @@
enforceUserPermission('module_client', 2);
$client_id = intval($_POST['client_id']);
- $file_name = $_FILES["file"]["tmp_name"];
$error = false;
+ if (!empty($_FILES["file"]["tmp_name"])) {
+ $file_name = $_FILES["file"]["tmp_name"];
+ } else {
+ $_SESSION['alert_message'] = "Please select a file to upload.";
+ $_SESSION['alert_type'] = "error";
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+ exit();
+ }
+
//Check file is CSV
$file_extension = strtolower(end(explode('.',$_FILES['file']['name'])));
$allowed_file_extensions = array('csv');