Added Client Asset Status functionality need to work on the names

This commit is contained in:
johnnyq
2022-05-25 16:09:20 -04:00
parent 5052a92f8e
commit 93e45dc7c4
6 changed files with 57 additions and 3 deletions

View File

@@ -4993,6 +4993,7 @@ if(isset($_POST['add_asset'])){
$os = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['os'])));
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['ip'])));
$mac = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['mac'])));
$status = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['status'])));
$location = intval($_POST['location']);
$vendor = intval($_POST['vendor']);
$contact = intval($_POST['contact']);
@@ -5011,7 +5012,7 @@ if(isset($_POST['add_asset'])){
}
$notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes'])));
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network, asset_client_id = $client_id, company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network, asset_client_id = $client_id, company_id = $session_company_id");
if(!empty($_POST['username'])) {
$asset_id = mysqli_insert_id($mysqli);
@@ -5046,6 +5047,7 @@ if(isset($_POST['edit_asset'])){
$os = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['os'])));
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['ip'])));
$mac = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['mac'])));
$status = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['status'])));
$location = intval($_POST['location']);
$vendor = intval($_POST['vendor']);
$contact = intval($_POST['contact']);
@@ -5066,7 +5068,7 @@ if(isset($_POST['edit_asset'])){
$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 assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network WHERE asset_id = $asset_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network WHERE asset_id = $asset_id AND company_id = $session_company_id");
//If login exists then update the login
if($login_id > 0){