diff --git a/client_software.php b/client_software.php
index 183a4be7..83b4207c 100644
--- a/client_software.php
+++ b/client_software.php
@@ -41,7 +41,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 software LEFT JOIN logins ON login_software_id = software_id
WHERE software_client_id = $client_id
- AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_license LIKE '%$q%')
+ AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
@@ -85,7 +85,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
-
+ $software_version "; ?>
-
+
+
0){
diff --git a/client_software_add_modal.php b/client_software_add_modal.php
index d0e4c93e..f90e7042 100644
--- a/client_software_add_modal.php
+++ b/client_software_add_modal.php
@@ -75,12 +75,42 @@
+
+
+
+
+
+
diff --git a/client_software_edit_modal.php b/client_software_edit_modal.php
index c50c1fd4..63942c77 100644
--- a/client_software_edit_modal.php
+++ b/client_software_edit_modal.php
@@ -73,14 +73,44 @@
+
+
+
+
+
+
diff --git a/db.sql b/db.sql
index 3d1520d4..ad7f974e 100644
--- a/db.sql
+++ b/db.sql
@@ -1106,7 +1106,10 @@ CREATE TABLE `software` (
`software_version` varchar(200) DEFAULT NULL,
`software_type` varchar(200) NOT NULL,
`software_license_type` varchar(200) DEFAULT NULL,
- `software_license` varchar(200) DEFAULT NULL,
+ `software_key` varchar(200) DEFAULT NULL,
+ `software_seats` int(11) DEFAULT NULL,
+ `software_purchase` date DEFAULT NULL,
+ `software_expire` date DEFAULT NULL,
`software_notes` text DEFAULT NULL,
`software_created_at` datetime NOT NULL,
`software_updated_at` datetime DEFAULT NULL,
@@ -1398,4 +1401,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2022-02-18 0:26:14
+-- Dump completed on 2022-02-18 1:08:36
diff --git a/post.php b/post.php
index 383ea048..1439c00e 100644
--- a/post.php
+++ b/post.php
@@ -4601,11 +4601,20 @@ if(isset($_POST['add_software'])){
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
$version = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['version'])));
$type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['type'])));
- $license = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['license'])));
+ $key = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['key'])));
$license_type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['license_type'])));
+ $seats = intval($_POST['seats']);
+ $purchase = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['purchase'])));
+ if(empty($purchase)){
+ $purchase = "0000-00-00";
+ }
+ $expire = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire'])));
+ if(empty($expire)){
+ $expire = "0000-00-00";
+ }
$notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes'])));
- mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_version = '$version', software_type = '$type', software_license = '$license', software_license_type = '$license_type', software_notes = '$notes', software_created_at = NOW(), software_client_id = $client_id, company_id = $session_company_id");
+ mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_version = '$version', software_type = '$type', software_key = '$key', software_license_type = '$license_type', software_seats = '$seats', software_purchase = '$purchase', software_expire = '$expire', software_notes = '$notes', software_created_at = NOW(), software_client_id = $client_id, company_id = $session_company_id");
if(!empty($_POST['username'])) {
$software_id = mysqli_insert_id($mysqli);
@@ -4632,13 +4641,22 @@ if(isset($_POST['edit_software'])){
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
$version = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['version'])));
$type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['type'])));
- $license = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['license'])));
+ $key = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['key'])));
$license_type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['license_type'])));
+ $seats = intval($_POST['seats']);
+ $purchase = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['purchase'])));
+ if(empty($purchase)){
+ $purchase = "0000-00-00";
+ }
+ $expire = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire'])));
+ if(empty($expire)){
+ $expire = "0000-00-00";
+ }
$notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes'])));
$username = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['username'])));
$password = trim(mysqli_real_escape_string($mysqli,encryptLoginEntry($_POST['password'])));
- mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_version = '$version', software_type = '$type', software_license = '$license', software_license_type = '$license_type', software_notes = '$notes', software_updated_at = NOW() WHERE software_id = $software_id AND company_id = $session_company_id");
+ mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_version = '$version', software_type = '$type', software_key = '$key', software_license_type = '$license_type', software_seats = $seats, software_purchase = '$purchase', software_expire = '$expire', software_notes = '$notes', software_updated_at = NOW() WHERE software_id = $software_id AND company_id = $session_company_id");
//If login exists then update the login
if($login_id > 0){