More general code cleanup/formatting
This commit is contained in:
@@ -62,7 +62,7 @@ $key = bin2hex(random_bytes(78));
|
|||||||
<option value="0"> ALL CLIENTS </option>
|
<option value="0"> ALL CLIENTS </option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $session_company_id ORDER BY client_name ASC");
|
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE company_id = $session_company_id ORDER BY client_name ASC");
|
||||||
while ($row = mysqli_fetch_array($sql)) {
|
while ($row = mysqli_fetch_array($sql)) {
|
||||||
$client_id = $row['client_id'];
|
$client_id = $row['client_id'];
|
||||||
$client_name = htmlentities($row['client_name']);
|
$client_name = htmlentities($row['client_name']);
|
||||||
|
|||||||
+15
-15
@@ -30,12 +30,12 @@ class Base32Static {
|
|||||||
* @author Bryan Ruiz
|
* @author Bryan Ruiz
|
||||||
**/
|
**/
|
||||||
public static function encode($input, $padding = true) {
|
public static function encode($input, $padding = true) {
|
||||||
if(empty($input)) return "";
|
if (empty($input)) return "";
|
||||||
|
|
||||||
$input = str_split($input);
|
$input = str_split($input);
|
||||||
$binaryString = "";
|
$binaryString = "";
|
||||||
|
|
||||||
for($i = 0; $i < count($input); $i++) {
|
for ($i = 0; $i < count($input); $i++) {
|
||||||
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
|
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,26 +48,26 @@ class Base32Static {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($padding && ($x = strlen($binaryString) % 40) != 0) {
|
if ($padding && ($x = strlen($binaryString) % 40) != 0) {
|
||||||
if($x == 8) $base32 .= str_repeat(self::$map[32], 6);
|
if ($x == 8) $base32 .= str_repeat(self::$map[32], 6);
|
||||||
else if($x == 16) $base32 .= str_repeat(self::$map[32], 4);
|
else if ($x == 16) $base32 .= str_repeat(self::$map[32], 4);
|
||||||
else if($x == 24) $base32 .= str_repeat(self::$map[32], 3);
|
else if ($x == 24) $base32 .= str_repeat(self::$map[32], 3);
|
||||||
else if($x == 32) $base32 .= self::$map[32];
|
else if ($x == 32) $base32 .= self::$map[32];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $base32;
|
return $base32;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function decode($input) {
|
public static function decode($input) {
|
||||||
if(empty($input)) return;
|
if (empty($input)) return;
|
||||||
|
|
||||||
$paddingCharCount = substr_count($input, self::$map[32]);
|
$paddingCharCount = substr_count($input, self::$map[32]);
|
||||||
$allowedValues = array(6,4,3,1,0);
|
$allowedValues = array(6,4,3,1,0);
|
||||||
|
|
||||||
if(!in_array($paddingCharCount, $allowedValues)) return false;
|
if (!in_array($paddingCharCount, $allowedValues)) return false;
|
||||||
|
|
||||||
for($i=0; $i<4; $i++){
|
for ($i=0; $i<4; $i++){
|
||||||
if($paddingCharCount == $allowedValues[$i] &&
|
if ($paddingCharCount == $allowedValues[$i] &&
|
||||||
substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
|
substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,18 +75,18 @@ class Base32Static {
|
|||||||
$input = str_split($input);
|
$input = str_split($input);
|
||||||
$binaryString = "";
|
$binaryString = "";
|
||||||
|
|
||||||
for($i=0; $i < count($input); $i = $i+8) {
|
for ($i=0; $i < count($input); $i = $i+8) {
|
||||||
$x = "";
|
$x = "";
|
||||||
|
|
||||||
if(!in_array($input[$i], self::$map)) return false;
|
if (!in_array($input[$i], self::$map)) return false;
|
||||||
|
|
||||||
for($j=0; $j < 8; $j++) {
|
for ($j=0; $j < 8; $j++) {
|
||||||
$x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
$x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
$eightBits = str_split($x, 8);
|
$eightBits = str_split($x, 8);
|
||||||
|
|
||||||
for($z = 0; $z < count($eightBits); $z++) {
|
for ($z = 0; $z < count($eightBits); $z++) {
|
||||||
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
|
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach($colors_diff as $color) {
|
foreach ($colors_diff as $color) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
+20
-22
@@ -1,54 +1,52 @@
|
|||||||
<?php include("inc_all_client.php"); ?>
|
<?php include("inc_all_client.php");
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
//Get Asset Counts
|
//Get Asset Counts
|
||||||
//All Asset Count
|
//All Asset Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$all_count = $row['count'];
|
$all_count = $row['count'];
|
||||||
//Workstation Count
|
//Workstation Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'laptop' OR asset_type = 'desktop')
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'laptop' OR asset_type = 'desktop')
|
||||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$workstation_count = $row['count'];
|
$workstation_count = $row['count'];
|
||||||
|
|
||||||
//Server Count
|
//Server Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'server')
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'server')
|
||||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$server_count = $row['count'];
|
$server_count = $row['count'];
|
||||||
|
|
||||||
//Virtual Server Count
|
//Virtual Server Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'virtual machine')
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'virtual machine')
|
||||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$virtual_count = $row['count'];
|
$virtual_count = $row['count'];
|
||||||
|
|
||||||
//Network Device Count
|
//Network Device Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'Firewall/Router' OR asset_type = 'switch' OR asset_type = 'access point')
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE (asset_type = 'Firewall/Router' OR asset_type = 'switch' OR asset_type = 'access point')
|
||||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$network_count = $row['count'];
|
$network_count = $row['count'];
|
||||||
|
|
||||||
//Other Count
|
//Other Count
|
||||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS count FROM assets WHERE (asset_type NOT LIKE 'laptop' AND asset_type NOT LIKE 'desktop' AND asset_type NOT LIKE 'server' AND asset_type NOT LIKE 'virtual machine' AND asset_type NOT LIKE 'firewall/router' AND asset_type NOT LIKE 'switch' AND asset_type NOT LIKE 'access point')
|
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(*) AS count FROM assets WHERE (asset_type NOT LIKE 'laptop' AND asset_type NOT LIKE 'desktop' AND asset_type NOT LIKE 'server' AND asset_type NOT LIKE 'virtual machine' AND asset_type NOT LIKE 'firewall/router' AND asset_type NOT LIKE 'switch' AND asset_type NOT LIKE 'access point')
|
||||||
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
AND asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||||
$other_count = $row['count'];
|
$other_count = $row['count'];
|
||||||
|
|
||||||
if (!empty($_GET['sb'])) {
|
if (!empty($_GET['sb'])) {
|
||||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||||
}else{
|
} else {
|
||||||
$sb = "asset_name";
|
$sb = "asset_name";
|
||||||
}
|
}
|
||||||
|
|
||||||
//Asset Type from GET
|
//Asset Type from GET
|
||||||
if (isset($_GET['type']) && ($_GET['type']) == 'workstation') {
|
if (isset($_GET['type']) && ($_GET['type']) == 'workstation') {
|
||||||
$type_query = "asset_type = 'desktop' OR asset_type = 'laptop'";
|
$type_query = "asset_type = 'desktop' OR asset_type = 'laptop'";
|
||||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'server') {
|
} elseif (isset($_GET['type']) && ($_GET['type']) == 'server') {
|
||||||
$type_query = "asset_type = 'server'";
|
$type_query = "asset_type = 'server'";
|
||||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'virtual') {
|
} elseif (isset($_GET['type']) && ($_GET['type']) == 'virtual') {
|
||||||
$type_query = "asset_type = 'Virtual Machine'";
|
$type_query = "asset_type = 'Virtual Machine'";
|
||||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'network') {
|
} elseif (isset($_GET['type']) && ($_GET['type']) == 'network') {
|
||||||
$type_query = "asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point'";
|
$type_query = "asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point'";
|
||||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'other') {
|
} elseif (isset($_GET['type']) && ($_GET['type']) == 'other') {
|
||||||
$type_query = "asset_type NOT LIKE 'laptop' AND asset_type NOT LIKE 'desktop' AND asset_type NOT LIKE 'server' AND asset_type NOT LIKE 'virtual machine' AND asset_type NOT LIKE 'firewall/router' AND asset_type NOT LIKE 'switch' AND asset_type NOT LIKE 'access point'";
|
$type_query = "asset_type NOT LIKE 'laptop' AND asset_type NOT LIKE 'desktop' AND asset_type NOT LIKE 'server' AND asset_type NOT LIKE 'virtual machine' AND asset_type NOT LIKE 'firewall/router' AND asset_type NOT LIKE 'switch' AND asset_type NOT LIKE 'access point'";
|
||||||
}else{
|
} else {
|
||||||
$type_query = "asset_type LIKE '%'";
|
$type_query = "asset_type LIKE '%'";
|
||||||
$_GET['type'] = '';
|
$_GET['type'] = '';
|
||||||
}
|
}
|
||||||
@@ -56,7 +54,7 @@ if (isset($_GET['type']) && ($_GET['type']) == 'workstation') {
|
|||||||
//Rebuild URL
|
//Rebuild URL
|
||||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets
|
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM assets
|
||||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||||
LEFT JOIN locations ON asset_location_id = location_id
|
LEFT JOIN locations ON asset_location_id = location_id
|
||||||
LEFT JOIN logins ON login_asset_id = asset_id
|
LEFT JOIN logins ON login_asset_id = asset_id
|
||||||
@@ -67,11 +65,11 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets
|
|||||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||||
);
|
);
|
||||||
|
|
||||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="card card-dark">
|
<div class="card card-dark">
|
||||||
<div class="card-header py-2">
|
<div class="card-header py-2">
|
||||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
@@ -246,16 +244,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||||
|
|
||||||
// Related tickets
|
// Related tickets
|
||||||
$sql_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_asset_id = $asset_id ORDER BY ticket_number DESC");
|
$sql_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_asset_id = $asset_id ORDER BY ticket_number DESC");
|
||||||
$ticket_count = mysqli_num_rows($sql_tickets);
|
$ticket_count = mysqli_num_rows($sql_tickets);
|
||||||
|
|
||||||
// Related Documents
|
// Related Documents
|
||||||
$sql_related_documents = mysqli_query($mysqli,"SELECT * FROM documents, asset_documents WHERE documents.document_id = asset_documents.document_id AND document_archived_at IS NULL AND asset_documents.asset_id = $asset_id ORDER BY documents.document_name DESC");
|
$sql_related_documents = mysqli_query($mysqli, "SELECT * FROM documents, asset_documents WHERE documents.document_id = asset_documents.document_id AND document_archived_at IS NULL AND asset_documents.asset_id = $asset_id ORDER BY documents.document_name DESC");
|
||||||
$document_count = mysqli_num_rows($sql_related_documents);
|
$document_count = mysqli_num_rows($sql_related_documents);
|
||||||
|
|
||||||
|
|
||||||
// Related File
|
// Related File
|
||||||
$sql_related_files = mysqli_query($mysqli,"SELECT * FROM files, asset_files WHERE files.file_id = asset_files.file_id AND asset_files.asset_id = $asset_id ORDER BY files.file_name DESC");
|
$sql_related_files = mysqli_query($mysqli, "SELECT * FROM files, asset_files WHERE files.file_id = asset_files.file_id AND asset_files.asset_id = $asset_id ORDER BY files.file_name DESC");
|
||||||
$file_count = mysqli_num_rows($sql_related_files);
|
$file_count = mysqli_num_rows($sql_related_files);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -360,7 +358,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
<?php include("pagination.php"); ?>
|
<?php include("pagination.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include("client_asset_add_modal.php");
|
include("client_asset_add_modal.php");
|
||||||
|
|||||||
+29
-31
@@ -1,6 +1,4 @@
|
|||||||
<?php include("inc_all_client.php"); ?>
|
<?php include("inc_all_client.php");
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if (isset($_GET['contact_id'])) {
|
if (isset($_GET['contact_id'])) {
|
||||||
$contact_id = intval($_GET['contact_id']);
|
$contact_id = intval($_GET['contact_id']);
|
||||||
@@ -26,14 +24,14 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$contact_created_at = $row['contact_created_at'];
|
$contact_created_at = $row['contact_created_at'];
|
||||||
if ($contact_id == $primary_contact) {
|
if ($contact_id == $primary_contact) {
|
||||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||||
}else{
|
} else {
|
||||||
$primary_contact_display = FALSE;
|
$primary_contact_display = FALSE;
|
||||||
}
|
}
|
||||||
$contact_location_id = $row['contact_location_id'];
|
$contact_location_id = $row['contact_location_id'];
|
||||||
$location_name = htmlentities($row['location_name']);
|
$location_name = htmlentities($row['location_name']);
|
||||||
if (empty($location_name)) {
|
if (empty($location_name)) {
|
||||||
$location_name_display = "-";
|
$location_name_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$location_name_display = $location_name;
|
$location_name_display = $location_name;
|
||||||
}
|
}
|
||||||
$auth_method = htmlentities($row['contact_auth_method']);
|
$auth_method = htmlentities($row['contact_auth_method']);
|
||||||
@@ -56,9 +54,9 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ if (isset($_GET['contact_id'])) {
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<?php if (!empty($contact_photo)) { ?>
|
<?php if (!empty($contact_photo)) { ?>
|
||||||
<img class="img-fluid img-circle p-3" alt="contact_photo" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
<img class="img-fluid img-circle p-3" alt="contact_photo" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||||
<?php }else{ ?>
|
<?php } else { ?>
|
||||||
<span class="fa-stack fa-4x">
|
<span class="fa-stack fa-4x">
|
||||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||||
@@ -153,19 +151,19 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$asset_serial = htmlentities($row['asset_serial']);
|
$asset_serial = htmlentities($row['asset_serial']);
|
||||||
if (empty($asset_serial)) {
|
if (empty($asset_serial)) {
|
||||||
$asset_serial_display = "-";
|
$asset_serial_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$asset_serial_display = $asset_serial;
|
$asset_serial_display = $asset_serial;
|
||||||
}
|
}
|
||||||
$asset_os = htmlentities($row['asset_os']);
|
$asset_os = htmlentities($row['asset_os']);
|
||||||
if (empty($asset_os)) {
|
if (empty($asset_os)) {
|
||||||
$asset_os_display = "-";
|
$asset_os_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$asset_os_display = $asset_os;
|
$asset_os_display = $asset_os;
|
||||||
}
|
}
|
||||||
$asset_ip = htmlentities($row['asset_ip']);
|
$asset_ip = htmlentities($row['asset_ip']);
|
||||||
if (empty($asset_ip)) {
|
if (empty($asset_ip)) {
|
||||||
$asset_ip_display = "-";
|
$asset_ip_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$asset_ip_display = "$asset_ip<button class='btn btn-sm' data-clipboard-text='$asset_ip'><i class='far fa-copy text-secondary'></i></button>";
|
$asset_ip_display = "$asset_ip<button class='btn btn-sm' data-clipboard-text='$asset_ip'><i class='far fa-copy text-secondary'></i></button>";
|
||||||
}
|
}
|
||||||
$asset_mac = htmlentities($row['asset_mac']);
|
$asset_mac = htmlentities($row['asset_mac']);
|
||||||
@@ -175,7 +173,7 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$asset_install_date = $row['asset_install_date'];
|
$asset_install_date = $row['asset_install_date'];
|
||||||
if (empty($asset_install_date)) {
|
if (empty($asset_install_date)) {
|
||||||
$asset_install_date_display = "-";
|
$asset_install_date_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$asset_install_date_display = $asset_install_date;
|
$asset_install_date_display = $asset_install_date;
|
||||||
}
|
}
|
||||||
$asset_notes = htmlentities($row['asset_notes']);
|
$asset_notes = htmlentities($row['asset_notes']);
|
||||||
@@ -186,29 +184,29 @@ if (isset($_GET['contact_id'])) {
|
|||||||
|
|
||||||
if ($asset_type == 'Laptop') {
|
if ($asset_type == 'Laptop') {
|
||||||
$device_icon = "laptop";
|
$device_icon = "laptop";
|
||||||
}elseif ($asset_type == 'Desktop') {
|
} elseif ($asset_type == 'Desktop') {
|
||||||
$device_icon = "desktop";
|
$device_icon = "desktop";
|
||||||
}elseif ($asset_type == 'Server') {
|
} elseif ($asset_type == 'Server') {
|
||||||
$device_icon = "server";
|
$device_icon = "server";
|
||||||
}elseif ($asset_type == 'Printer') {
|
} elseif ($asset_type == 'Printer') {
|
||||||
$device_icon = "print";
|
$device_icon = "print";
|
||||||
}elseif ($asset_type == 'Camera') {
|
} elseif ($asset_type == 'Camera') {
|
||||||
$device_icon = "video";
|
$device_icon = "video";
|
||||||
}elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||||
$device_icon = "network-wired";
|
$device_icon = "network-wired";
|
||||||
}elseif ($asset_type == 'Access Point') {
|
} elseif ($asset_type == 'Access Point') {
|
||||||
$device_icon = "wifi";
|
$device_icon = "wifi";
|
||||||
}elseif ($asset_type == 'Phone') {
|
} elseif ($asset_type == 'Phone') {
|
||||||
$device_icon = "phone";
|
$device_icon = "phone";
|
||||||
}elseif ($asset_type == 'Mobile Phone') {
|
} elseif ($asset_type == 'Mobile Phone') {
|
||||||
$device_icon = "mobile-alt";
|
$device_icon = "mobile-alt";
|
||||||
}elseif ($asset_type == 'Tablet') {
|
} elseif ($asset_type == 'Tablet') {
|
||||||
$device_icon = "tablet-alt";
|
$device_icon = "tablet-alt";
|
||||||
}elseif ($asset_type == 'TV') {
|
} elseif ($asset_type == 'TV') {
|
||||||
$device_icon = "tv";
|
$device_icon = "tv";
|
||||||
}elseif ($asset_type == 'Virtual Machine') {
|
} elseif ($asset_type == 'Virtual Machine') {
|
||||||
$device_icon = "cloud";
|
$device_icon = "cloud";
|
||||||
}else{
|
} else {
|
||||||
$device_icon = "tag";
|
$device_icon = "tag";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,13 +284,13 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$login_uri = htmlentities($row['login_uri']);
|
$login_uri = htmlentities($row['login_uri']);
|
||||||
if (empty($login_uri)) {
|
if (empty($login_uri)) {
|
||||||
$login_uri_display = "-";
|
$login_uri_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$login_uri_display = "$login_uri<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_uri'><i class='far fa-copy text-secondary'></i></button><a href='https://$login_uri' target='_blank'><i class='fa fa-external-link-alt text-secondary'></i></a>";
|
$login_uri_display = "$login_uri<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_uri'><i class='far fa-copy text-secondary'></i></button><a href='https://$login_uri' target='_blank'><i class='fa fa-external-link-alt text-secondary'></i></a>";
|
||||||
}
|
}
|
||||||
$login_username = htmlentities($row['login_username']);
|
$login_username = htmlentities($row['login_username']);
|
||||||
if (empty($login_username)) {
|
if (empty($login_username)) {
|
||||||
$login_username_display = "-";
|
$login_username_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$login_username_display = "$login_username<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_username'><i class='far fa-copy text-secondary'></i></button>";
|
$login_username_display = "$login_username<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_username'><i class='far fa-copy text-secondary'></i></button>";
|
||||||
}
|
}
|
||||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||||
@@ -300,7 +298,7 @@ if (isset($_GET['contact_id'])) {
|
|||||||
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
||||||
if (empty($login_otp_secret)) {
|
if (empty($login_otp_secret)) {
|
||||||
$otp_display = "-";
|
$otp_display = "-";
|
||||||
}else{
|
} else {
|
||||||
$otp_display = "<span onmouseenter='showOTP($login_id_with_secret)'><i class='far fa-clock'></i> <span id='otp_$login_id'><i>Hover..</i></span></span>";
|
$otp_display = "<span onmouseenter='showOTP($login_id_with_secret)'><i class='far fa-clock'></i> <span id='otp_$login_id'><i>Hover..</i></span></span>";
|
||||||
}
|
}
|
||||||
$login_note = htmlentities($row['login_note']);
|
$login_note = htmlentities($row['login_note']);
|
||||||
@@ -357,13 +355,13 @@ if (isset($_GET['contact_id'])) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include("client_contact_edit_modal.php");
|
include("client_contact_edit_modal.php");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; }else{ echo 0; } ?>">
|
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; } else { echo 0; } ?>">
|
||||||
|
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; }else{ echo 0; } ?>">
|
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; } else { echo 0; } ?>">
|
||||||
|
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user