diff --git a/client_contacts.php b/client_contacts.php
index a8f4ec48..9f5d5efd 100644
--- a/client_contacts.php
+++ b/client_contacts.php
@@ -25,7 +25,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts
LEFT JOIN locations ON location_id = contact_location_id
WHERE contact_archived_at IS NULL
- AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR department_name LIKE '%$q%' OR contact_phone LIKE '%$n%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$n%')
+ AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$n%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$n%')
AND contact_client_id = $client_id ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
diff --git a/client_department_add_modal.php b/client_department_add_modal.php
deleted file mode 100644
index b4d34297..00000000
--- a/client_department_add_modal.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
New Department
-
-
-
-
-
-
\ No newline at end of file
diff --git a/client_department_edit_modal.php b/client_department_edit_modal.php
deleted file mode 100644
index 021bb681..00000000
--- a/client_department_edit_modal.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/client_departments.php b/client_departments.php
deleted file mode 100644
index 80386750..00000000
--- a/client_departments.php
+++ /dev/null
@@ -1,99 +0,0 @@
- $sb, 'o' => $o)));
-
-$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM departments
- WHERE department_client_id = $client_id
- AND (department_name LIKE '%$q%')
- ORDER BY $sb $o LIMIT $record_from, $record_to");
-
-$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
-
-?>
-
-
-
-
\ No newline at end of file
diff --git a/client_overview.php b/client_overview.php
index 072af445..92bd8d50 100644
--- a/client_overview.php
+++ b/client_overview.php
@@ -1,6 +1,6 @@
diff --git a/database_updates.php b/database_updates.php
index b5ceb37d..19c21507 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -177,7 +177,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
if(CURRENT_DATABASE_VERSION == '0.0.6'){
// Insert queries here required to update to DB version 0.0.7
- mysqli_query($mysqli, "ALTER TABLE contacts ADD contact_department VARCHAR(200) NULL AFTER contact_department_id");
+ mysqli_query($mysqli, "ALTER TABLE contacts ADD contact_department VARCHAR(200) NULL AFTER contact_title");
mysqli_query($mysqli, "DROP TABLE departments");
mysqli_query($mysqli, "ALTER TABLE contacts DROP contact_department_id");
diff --git a/global_search.php b/global_search.php
index 4d012d43..d32b060a 100644
--- a/global_search.php
+++ b/global_search.php
@@ -12,7 +12,7 @@ if(isset($_GET['query'])){
}
$sql_clients = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN locations ON clients.client_id = locations.location_client_id WHERE client_name LIKE '%$query%' AND clients.company_id = $session_company_id ORDER BY client_id DESC LIMIT 5");
- $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN clients ON client_id = contact_client_id LEFT JOIN departments ON contact_department_id = department_id WHERE (contact_name LIKE '%$query%' OR contact_title LIKE '%$query%' OR contact_email LIKE '%$query%' OR contact_phone LIKE '%$phone_query%' OR contact_mobile LIKE '%$phone_query%') AND contacts.company_id = $session_company_id ORDER BY contact_id DESC LIMIT 5");
+ $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN clients ON client_id = contact_client_id WHERE (contact_name LIKE '%$query%' OR contact_title LIKE '%$query%' OR contact_email LIKE '%$query%' OR contact_phone LIKE '%$phone_query%' OR contact_mobile LIKE '%$phone_query%') AND contacts.company_id = $session_company_id ORDER BY contact_id DESC LIMIT 5");
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE (vendor_name LIKE '%$query%' OR vendor_phone LIKE '%$phone_query%') AND company_id = $session_company_id ORDER BY vendor_id DESC LIMIT 5");
$sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' AND company_id = $session_company_id ORDER BY product_id DESC LIMIT 5");
$sql_documents = mysqli_query($mysqli, "SELECT * FROM documents LEFT JOIN clients on document_client_id = clients.client_id WHERE MATCH(document_content_raw) AGAINST ('$query') AND documents.company_id = $session_company_id ORDER BY document_id DESC LIMIT 5");
@@ -102,7 +102,7 @@ if(isset($_GET['query'])){
$contact_email = $row['contact_email'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
- $department_name = $row['department_name'];
+ $contact_department = $row['contact_department'];
?>
diff --git a/post.php b/post.php
index f3a985c9..5f36bc08 100644
--- a/post.php
+++ b/post.php
@@ -4408,7 +4408,7 @@ if(isset($_GET['export_client_contacts_csv'])){
$client_name = $row['client_name'];
//Contacts
- $sql = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departments ON contact_department_id = department_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
+ $sql = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
if($sql->num_rows > 0){
$delimiter = ",";
$filename = $client_name . "-Contacts-" . date('Y-m-d') . ".csv";
@@ -4422,7 +4422,7 @@ if(isset($_GET['export_client_contacts_csv'])){
//output each row of the data, format line as csv and write to file pointer
while($row = $sql->fetch_assoc()){
- $lineData = array($row['contact_name'], $row['contact_title'], $row['department_name'], $row['contact_email'], formatPhoneNumber($row['contact_phone']), $row['contact_extension'], formatPhoneNumber($row['contact_mobile']), $row['contact_notes']);
+ $lineData = array($row['contact_name'], $row['contact_title'], $row['contact_department'], $row['contact_email'], formatPhoneNumber($row['contact_phone']), $row['contact_extension'], formatPhoneNumber($row['contact_mobile']), $row['contact_notes']);
fputcsv($f, $lineData, $delimiter);
}
@@ -7433,7 +7433,7 @@ if(isset($_GET['export_client_pdf'])){
$contact_email = $row['contact_email'];
$client_website = $row['client_website'];
- $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts LEFT JOIN departments ON contact_department_id = department_id WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
+ $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id ORDER BY contact_name ASC");
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id ORDER BY location_name ASC");
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id ORDER BY vendor_name ASC");
if(isset($_GET['passwords'])){
@@ -7588,7 +7588,7 @@ if(isset($_GET['export_client_pdf'])){
}
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
$contact_email = $row['contact_email'];
- $department_name = $row['department_name'];
+ $contact_department = $row['contact_department'];
?>
[
@@ -7601,7 +7601,7 @@ if(isset($_GET['export_client_pdf'])){
style: 'item'
},
{
- text: ,
+ text: ,
style: 'item'
},
{