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 42cf942e..579d82b9 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 edf7edc4..566ccdda 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 9a1885ba..b9ee2c4b 100644
--- a/post/user/asset.php
+++ b/post/user/asset.php
@@ -473,8 +473,18 @@ if (isset($_POST["import_client_assets_csv"])) {
$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 d497b25a..60f839ac 100644
--- a/post/user/client.php
+++ b/post/user/client.php
@@ -387,10 +387,17 @@ if (isset($_POST['export_clients_csv'])) {
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($_POST["import_clients_csv"])) {
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 a537a842..d5fbe7fc 100644
--- a/post/user/contact.php
+++ b/post/user/contact.php
@@ -822,9 +822,17 @@ if (isset($_POST["import_client_contacts_csv"])) {
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 491b3b1a..cce38199 100644
--- a/post/user/credential.php
+++ b/post/user/credential.php
@@ -377,9 +377,17 @@ if (isset($_POST["import_client_logins_csv"])) {
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 6cedd3ed..6df8c008 100644
--- a/post/user/location.php
+++ b/post/user/location.php
@@ -429,9 +429,17 @@ if(isset($_POST["import_client_locations_csv"])){
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');