mirror of https://github.com/itflow-org/itflow
More general code cleanup/formatting
This commit is contained in:
parent
6892e6f9f1
commit
cfa4b1dcb5
|
|
@ -62,7 +62,7 @@ $key = bin2hex(random_bytes(78));
|
|||
<option value="0"> ALL CLIENTS </option>
|
||||
<?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)) {
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
|
|
@ -84,4 +84,4 @@ $key = bin2hex(random_bytes(78));
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
146
base32static.php
146
base32static.php
|
|
@ -1,28 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* Encode in Base32 based on RFC 4648.
|
||||
* Requires 20% more space than base64
|
||||
* Requires 20% more space than base64
|
||||
* Great for case-insensitive filesystems like Windows and URL's (except for = char which can be excluded using the pad option for urls)
|
||||
*
|
||||
* @package default
|
||||
* @author Bryan Ruiz
|
||||
**/
|
||||
class Base32Static {
|
||||
private static $map = array(
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
|
||||
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
|
||||
'=' // padding character
|
||||
private static $map = array(
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
|
||||
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
|
||||
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
|
||||
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
|
||||
'=' // padding character
|
||||
);
|
||||
|
||||
private static $flippedMap = array(
|
||||
'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
|
||||
'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
|
||||
'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
|
||||
'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
|
||||
|
||||
private static $flippedMap = array(
|
||||
'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
|
||||
'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
|
||||
'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
|
||||
'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Use padding false when encoding for urls
|
||||
*
|
||||
|
|
@ -30,67 +30,67 @@ class Base32Static {
|
|||
* @author Bryan Ruiz
|
||||
**/
|
||||
public static function encode($input, $padding = true) {
|
||||
if(empty($input)) return "";
|
||||
|
||||
$input = str_split($input);
|
||||
$binaryString = "";
|
||||
|
||||
for($i = 0; $i < count($input); $i++) {
|
||||
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$fiveBitBinaryArray = str_split($binaryString, 5);
|
||||
$base32 = "";
|
||||
$i=0;
|
||||
|
||||
while($i < count($fiveBitBinaryArray)) {
|
||||
$base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($padding && ($x = strlen($binaryString) % 40) != 0) {
|
||||
if($x == 8) $base32 .= str_repeat(self::$map[32], 6);
|
||||
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 == 32) $base32 .= self::$map[32];
|
||||
}
|
||||
|
||||
return $base32;
|
||||
if (empty($input)) return "";
|
||||
|
||||
$input = str_split($input);
|
||||
$binaryString = "";
|
||||
|
||||
for ($i = 0; $i < count($input); $i++) {
|
||||
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$fiveBitBinaryArray = str_split($binaryString, 5);
|
||||
$base32 = "";
|
||||
$i=0;
|
||||
|
||||
while($i < count($fiveBitBinaryArray)) {
|
||||
$base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($padding && ($x = strlen($binaryString) % 40) != 0) {
|
||||
if ($x == 8) $base32 .= str_repeat(self::$map[32], 6);
|
||||
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 == 32) $base32 .= self::$map[32];
|
||||
}
|
||||
|
||||
return $base32;
|
||||
}
|
||||
|
||||
|
||||
public static function decode($input) {
|
||||
if(empty($input)) return;
|
||||
|
||||
$paddingCharCount = substr_count($input, self::$map[32]);
|
||||
$allowedValues = array(6,4,3,1,0);
|
||||
|
||||
if(!in_array($paddingCharCount, $allowedValues)) return false;
|
||||
|
||||
for($i=0; $i<4; $i++){
|
||||
if($paddingCharCount == $allowedValues[$i] &&
|
||||
substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
|
||||
}
|
||||
|
||||
$input = str_replace('=','', $input);
|
||||
$input = str_split($input);
|
||||
$binaryString = "";
|
||||
|
||||
for($i=0; $i < count($input); $i = $i+8) {
|
||||
$x = "";
|
||||
|
||||
if(!in_array($input[$i], self::$map)) return false;
|
||||
|
||||
for($j=0; $j < 8; $j++) {
|
||||
$x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
||||
if (empty($input)) return;
|
||||
|
||||
$paddingCharCount = substr_count($input, self::$map[32]);
|
||||
$allowedValues = array(6,4,3,1,0);
|
||||
|
||||
if (!in_array($paddingCharCount, $allowedValues)) return false;
|
||||
|
||||
for ($i=0; $i<4; $i++){
|
||||
if ($paddingCharCount == $allowedValues[$i] &&
|
||||
substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
|
||||
}
|
||||
|
||||
$eightBits = str_split($x, 8);
|
||||
|
||||
for($z = 0; $z < count($eightBits); $z++) {
|
||||
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
|
||||
|
||||
$input = str_replace('=','', $input);
|
||||
$input = str_split($input);
|
||||
$binaryString = "";
|
||||
|
||||
for ($i=0; $i < count($input); $i = $i+8) {
|
||||
$x = "";
|
||||
|
||||
if (!in_array($input[$i], self::$map)) return false;
|
||||
|
||||
for ($j=0; $j < 8; $j++) {
|
||||
$x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$eightBits = str_split($x, 8);
|
||||
|
||||
for ($z = 0; $z < count($eightBits); $z++) {
|
||||
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $binaryString;
|
||||
|
||||
return $binaryString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<input type="hidden" name="type" value="<?php echo $category; ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
|
||||
|
|
@ -21,11 +21,11 @@
|
|||
<div class="form-row">
|
||||
|
||||
<?php
|
||||
|
||||
foreach($colors_diff as $color) {
|
||||
|
||||
|
||||
foreach ($colors_diff as $color) {
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="color" value="<?php echo $color; ?>">
|
||||
|
|
@ -34,10 +34,10 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
@ -46,4 +46,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,62 +1,60 @@
|
|||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
<?php include("inc_all_client.php");
|
||||
|
||||
//Get Asset Counts
|
||||
//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'];
|
||||
//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"));
|
||||
$workstation_count = $row['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"));
|
||||
$server_count = $row['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"));
|
||||
$virtual_count = $row['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"));
|
||||
$network_count = $row['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"));
|
||||
$other_count = $row['count'];
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
$sb = "asset_name";
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
} else {
|
||||
$sb = "asset_name";
|
||||
}
|
||||
|
||||
//Asset Type from GET
|
||||
if (isset($_GET['type']) && ($_GET['type']) == 'workstation') {
|
||||
$type_query = "asset_type = 'desktop' OR asset_type = 'laptop'";
|
||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'server') {
|
||||
$type_query = "asset_type = 'server'";
|
||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'virtual') {
|
||||
$type_query = "asset_type = 'Virtual Machine'";
|
||||
}elseif (isset($_GET['type']) && ($_GET['type']) == 'network') {
|
||||
$type_query = "asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point'";
|
||||
}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'";
|
||||
}else{
|
||||
$type_query = "asset_type LIKE '%'";
|
||||
$_GET['type'] = '';
|
||||
$type_query = "asset_type = 'desktop' OR asset_type = 'laptop'";
|
||||
} elseif (isset($_GET['type']) && ($_GET['type']) == 'server') {
|
||||
$type_query = "asset_type = 'server'";
|
||||
} elseif (isset($_GET['type']) && ($_GET['type']) == 'virtual') {
|
||||
$type_query = "asset_type = 'Virtual Machine'";
|
||||
} elseif (isset($_GET['type']) && ($_GET['type']) == 'network') {
|
||||
$type_query = "asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point'";
|
||||
} 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'";
|
||||
} else {
|
||||
$type_query = "asset_type LIKE '%'";
|
||||
$_GET['type'] = '';
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$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 locations ON asset_location_id = location_id
|
||||
LEFT JOIN logins ON login_asset_id = asset_id
|
||||
|
|
@ -67,304 +65,304 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets
|
|||
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-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetModal"><i class="fas fa-fw fa-plus"></i> New <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="type" value="<?php echo strip_tags(htmlentities($_GET['type'])); ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?>s">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetModal"><i class="fas fa-fw fa-plus"></i> New <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="btn-group btn-group-lg">
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=" class="btn <?php if ($_GET['type'] == 'all' || empty($_GET['type'])) { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All Assets <span class="right badge badge-light"><?php echo $all_count; ?></span></a>
|
||||
<?php
|
||||
if ($workstation_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=workstation" class="btn <?php if ($_GET['type'] == 'workstation') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-desktop"></i> Workstations <span class="right badge badge-light"><?php echo $workstation_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($server_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=server" class="btn <?php if ($_GET['type'] == 'server') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-server"></i> Servers <span class="right badge badge-light"><?php echo $server_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($virtual_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=virtual" class="btn <?php if ($_GET['type'] == 'virtual') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-cloud"></i> Virtual <span class="right badge badge-light"><?php echo $virtual_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=network" class="btn <?php if ($_GET['type'] == 'network') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-network-wired"></i> Network <span class="right badge badge-light"><?php echo $network_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=other" class="btn <?php if ($_GET['type'] == 'other') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-tag"></i> Other <span class="right badge badge-light"><?php echo $other_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_assets_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importAssetModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="type" value="<?php echo strip_tags(htmlentities($_GET['type'])); ?>">
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table border table-hover">
|
||||
<thead class="thead-light <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<?php if ($_GET['type'] !== 'virtual' && $_GET['type'] !== 'servers') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_make&o=<?php echo $disp; ?>">Make/Model</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_serial&o=<?php echo $disp; ?>">Serial Number</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_os&o=<?php echo $disp; ?>">Operating System</a></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_install_date&o=<?php echo $disp; ?>">Install Date</a></th>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'servers' && $_GET['type'] !== 'other') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Assigned To</a></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_type = htmlentities($row['asset_type']);
|
||||
$asset_name = htmlentities($row['asset_name']);
|
||||
$asset_make = htmlentities($row['asset_make']);
|
||||
$asset_model = htmlentities($row['asset_model']);
|
||||
$asset_serial = htmlentities($row['asset_serial']);
|
||||
if (empty($asset_serial)) {
|
||||
$asset_serial_display = "-";
|
||||
}else{
|
||||
$asset_serial_display = $asset_serial;
|
||||
}
|
||||
$asset_os = htmlentities($row['asset_os']);
|
||||
if (empty($asset_os)) {
|
||||
$asset_os_display = "-";
|
||||
}else{
|
||||
$asset_os_display = $asset_os;
|
||||
}
|
||||
$asset_ip = htmlentities($row['asset_ip']);
|
||||
if (empty($asset_ip)) {
|
||||
$asset_ip_display = "-";
|
||||
}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_mac = htmlentities($row['asset_mac']);
|
||||
$asset_status = htmlentities($row['asset_status']);
|
||||
$asset_purchase_date = $row['asset_purchase_date'];
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
$asset_install_date = $row['asset_install_date'];
|
||||
if (empty($asset_install_date)) {
|
||||
$asset_install_date_display = "-";
|
||||
}else{
|
||||
$asset_install_date_display = $asset_install_date;
|
||||
}
|
||||
$asset_notes = htmlentities($row['asset_notes']);
|
||||
$asset_created_at = $row['asset_created_at'];
|
||||
$asset_vendor_id = $row['asset_vendor_id'];
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_contact_id = $row['asset_contact_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
}elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
}elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
}elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
}elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
}elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
}elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
}elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
}elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
}elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
}elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
}elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
}else{
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
$contact_name = $row['contact_name'];
|
||||
if (empty($contact_name)) {
|
||||
$contact_name = "-";
|
||||
}
|
||||
|
||||
$location_name = $row['location_name'];
|
||||
if (empty($location_name)) {
|
||||
$location_name = "-";
|
||||
}
|
||||
|
||||
$login_id = $row['login_id'];
|
||||
$login_username = htmlentities($row['login_username']);
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
|
||||
// Related tickets
|
||||
$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);
|
||||
|
||||
// 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");
|
||||
$document_count = mysqli_num_rows($sql_related_documents);
|
||||
|
||||
|
||||
// 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");
|
||||
$file_count = mysqli_num_rows($sql_related_files);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i>
|
||||
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>"><?php echo $asset_name; ?></a>
|
||||
<?php
|
||||
if ($login_id > 0) {
|
||||
?>
|
||||
<button type="button" class="btn btn-link btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key text-dark"></i></button>
|
||||
|
||||
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $asset_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?>s">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="btn-group btn-group-lg">
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=" class="btn <?php if ($_GET['type'] == 'all' || empty($_GET['type'])) { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All Assets <span class="right badge badge-light"><?php echo $all_count; ?></span></a>
|
||||
<?php
|
||||
if ($workstation_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=workstation" class="btn <?php if ($_GET['type'] == 'workstation') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-desktop"></i> Workstations <span class="right badge badge-light"><?php echo $workstation_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($server_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=server" class="btn <?php if ($_GET['type'] == 'server') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-server"></i> Servers <span class="right badge badge-light"><?php echo $server_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($virtual_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=virtual" class="btn <?php if ($_GET['type'] == 'virtual') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-cloud"></i> Virtual <span class="right badge badge-light"><?php echo $virtual_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=network" class="btn <?php if ($_GET['type'] == 'network') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-network-wired"></i> Network <span class="right badge badge-light"><?php echo $network_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=other" class="btn <?php if ($_GET['type'] == 'other') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-tag"></i> Other <span class="right badge badge-light"><?php echo $other_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</th>
|
||||
<?php if ($_GET['type'] !== 'virtual' && $_GET['type'] !== 'servers') { ?>
|
||||
<td><?php echo $asset_type; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<td><?php echo "$asset_make $asset_model"; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<td><?php echo $asset_serial_display; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<td><?php echo $asset_os_display; ?></td>
|
||||
<?php } ?>
|
||||
<td><?php echo $asset_install_date_display; ?></td>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other' && $_GET['type'] !== 'servers') { ?>
|
||||
<td><?php echo $contact_name; ?></td>
|
||||
<?php } ?>
|
||||
<td><?php echo $location_name; ?></td>
|
||||
<td><?php echo $asset_status; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addAssetInterfaceModal<?php echo $asset_id; ?>">Interfaces</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#copyAssetModal<?php echo $asset_id; ?>">Copy</a>
|
||||
<?php if ($document_count > 0) { ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#assetDocumentsModal<?php echo $asset_id; ?>">Documents (<?php echo $document_count; ?>)</a>
|
||||
<?php } ?>
|
||||
<?php if ($ticket_count > 0) { ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#assetTicketsModal<?php echo $asset_id; ?>">Tickets (<?php echo $ticket_count; ?>)</a>
|
||||
<?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_asset=<?php echo $asset_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_copy_modal.php");
|
||||
include("client_asset_tickets_modal.php");
|
||||
include("client_asset_interface_add_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="col-md-2">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_assets_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importAssetModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table border table-hover">
|
||||
<thead class="thead-light <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<?php if ($_GET['type'] !== 'virtual' && $_GET['type'] !== 'servers') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_make&o=<?php echo $disp; ?>">Make/Model</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_serial&o=<?php echo $disp; ?>">Serial Number</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_os&o=<?php echo $disp; ?>">Operating System</a></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_install_date&o=<?php echo $disp; ?>">Install Date</a></th>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'servers' && $_GET['type'] !== 'other') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Assigned To</a></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_type = htmlentities($row['asset_type']);
|
||||
$asset_name = htmlentities($row['asset_name']);
|
||||
$asset_make = htmlentities($row['asset_make']);
|
||||
$asset_model = htmlentities($row['asset_model']);
|
||||
$asset_serial = htmlentities($row['asset_serial']);
|
||||
if (empty($asset_serial)) {
|
||||
$asset_serial_display = "-";
|
||||
}else{
|
||||
$asset_serial_display = $asset_serial;
|
||||
}
|
||||
$asset_os = htmlentities($row['asset_os']);
|
||||
if (empty($asset_os)) {
|
||||
$asset_os_display = "-";
|
||||
}else{
|
||||
$asset_os_display = $asset_os;
|
||||
}
|
||||
$asset_ip = htmlentities($row['asset_ip']);
|
||||
if (empty($asset_ip)) {
|
||||
$asset_ip_display = "-";
|
||||
}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_mac = htmlentities($row['asset_mac']);
|
||||
$asset_status = htmlentities($row['asset_status']);
|
||||
$asset_purchase_date = $row['asset_purchase_date'];
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
$asset_install_date = $row['asset_install_date'];
|
||||
if (empty($asset_install_date)) {
|
||||
$asset_install_date_display = "-";
|
||||
}else{
|
||||
$asset_install_date_display = $asset_install_date;
|
||||
}
|
||||
$asset_notes = htmlentities($row['asset_notes']);
|
||||
$asset_created_at = $row['asset_created_at'];
|
||||
$asset_vendor_id = $row['asset_vendor_id'];
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_contact_id = $row['asset_contact_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
}elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
}elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
}elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
}elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
}elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
}elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
}elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
}elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
}elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
}elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
}elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
}else{
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
$contact_name = $row['contact_name'];
|
||||
if (empty($contact_name)) {
|
||||
$contact_name = "-";
|
||||
}
|
||||
|
||||
$location_name = $row['location_name'];
|
||||
if (empty($location_name)) {
|
||||
$location_name = "-";
|
||||
}
|
||||
|
||||
$login_id = $row['login_id'];
|
||||
$login_username = htmlentities($row['login_username']);
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
|
||||
// Related tickets
|
||||
$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);
|
||||
|
||||
// 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");
|
||||
$document_count = mysqli_num_rows($sql_related_documents);
|
||||
|
||||
|
||||
// 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");
|
||||
$file_count = mysqli_num_rows($sql_related_files);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i>
|
||||
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>"><?php echo $asset_name; ?></a>
|
||||
<?php
|
||||
if ($login_id > 0) {
|
||||
?>
|
||||
<button type="button" class="btn btn-link btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key text-dark"></i></button>
|
||||
|
||||
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $asset_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body bg-white">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</th>
|
||||
<?php if ($_GET['type'] !== 'virtual' && $_GET['type'] !== 'servers') { ?>
|
||||
<td><?php echo $asset_type; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<td><?php echo "$asset_make $asset_model"; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<td><?php echo $asset_serial_display; ?></td>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<td><?php echo $asset_os_display; ?></td>
|
||||
<?php } ?>
|
||||
<td><?php echo $asset_install_date_display; ?></td>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other' && $_GET['type'] !== 'servers') { ?>
|
||||
<td><?php echo $contact_name; ?></td>
|
||||
<?php } ?>
|
||||
<td><?php echo $location_name; ?></td>
|
||||
<td><?php echo $asset_status; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addAssetInterfaceModal<?php echo $asset_id; ?>">Interfaces</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#copyAssetModal<?php echo $asset_id; ?>">Copy</a>
|
||||
<?php if ($document_count > 0) { ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#assetDocumentsModal<?php echo $asset_id; ?>">Documents (<?php echo $document_count; ?>)</a>
|
||||
<?php } ?>
|
||||
<?php if ($ticket_count > 0) { ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#assetTicketsModal<?php echo $asset_id; ?>">Tickets (<?php echo $ticket_count; ?>)</a>
|
||||
<?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_asset=<?php echo $asset_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_copy_modal.php");
|
||||
include("client_asset_tickets_modal.php");
|
||||
include("client_asset_interface_add_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("client_asset_add_modal.php");
|
||||
include("client_asset_import_modal.php");
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php include("footer.php"); ?>
|
||||
|
|
|
|||
|
|
@ -1,370 +1,368 @@
|
|||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
<?php include("inc_all_client.php");
|
||||
|
||||
if (isset($_GET['contact_id'])) {
|
||||
$contact_id = intval($_GET['contact_id']);
|
||||
$contact_id = intval($_GET['contact_id']);
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM contacts
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM contacts
|
||||
LEFT JOIN locations ON location_id = contact_location_id
|
||||
WHERE contact_id = $contact_id
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_department =htmlentities($row['contact_department']);
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$contact_photo = htmlentities($row['contact_photo']);
|
||||
$contact_initials = initials($contact_name);
|
||||
$contact_notes = htmlentities($row['contact_notes']);
|
||||
$contact_important = intval($row['contact_important']);
|
||||
$contact_created_at = $row['contact_created_at'];
|
||||
if ($contact_id == $primary_contact) {
|
||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||
}else{
|
||||
$primary_contact_display = FALSE;
|
||||
}
|
||||
$contact_location_id = $row['contact_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
}else{
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_department =htmlentities($row['contact_department']);
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$contact_photo = htmlentities($row['contact_photo']);
|
||||
$contact_initials = initials($contact_name);
|
||||
$contact_notes = htmlentities($row['contact_notes']);
|
||||
$contact_important = intval($row['contact_important']);
|
||||
$contact_created_at = $row['contact_created_at'];
|
||||
if ($contact_id == $primary_contact) {
|
||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||
} else {
|
||||
$primary_contact_display = FALSE;
|
||||
}
|
||||
$contact_location_id = $row['contact_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_name DESC");
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_name DESC");
|
||||
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
|
||||
// Related Logins Query
|
||||
$sql_related_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_contact_id = $contact_id AND company_id = $session_company_id ORDER BY login_name DESC");
|
||||
$login_count = mysqli_num_rows($sql_related_logins);
|
||||
// Related Logins Query
|
||||
$sql_related_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_contact_id = $contact_id AND company_id = $session_company_id ORDER BY login_name DESC");
|
||||
$login_count = mysqli_num_rows($sql_related_logins);
|
||||
|
||||
// Related Software Query
|
||||
$sql_related_software = mysqli_query($mysqli,"SELECT * FROM software, software_contacts WHERE software.software_id = software_contacts.software_id AND software_contacts.contact_id = $contact_id AND software.company_id = $session_company_id ORDER BY software.software_id DESC");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
// Related Software Query
|
||||
$sql_related_software = mysqli_query($mysqli,"SELECT * FROM software, software_contacts WHERE software.software_id = software_contacts.software_id AND software_contacts.contact_id = $contact_id AND software.company_id = $session_company_id ORDER BY software.software_id DESC");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
|
||||
// Related Tickets Query
|
||||
$sql_related_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_contact_id = $contact_id AND company_id = $session_company_id ORDER BY ticket_id DESC");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
// Related Tickets Query
|
||||
$sql_related_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_contact_id = $contact_id AND company_id = $session_company_id ORDER BY ticket_id DESC");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
<?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"; ?>">
|
||||
<?php }else{ ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<div class="text-center">
|
||||
<?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"; ?>">
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<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>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<hr>
|
||||
<h3><?php echo $contact_name; ?></h3>
|
||||
<?php if (!empty($contact_title)) { ?>
|
||||
<div class="mb-3 text-secondary"><?php echo $contact_title; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_title)) { ?>
|
||||
<div class="mb-1"><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_email)) { ?>
|
||||
<div><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_phone)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo "$contact_phone $contact_phone_extention"; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_mobile)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo $contact_mobile; ?></div>
|
||||
<?php } ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-clock text-secondary mr-3"></i><?php echo date('Y-m-d',strtotime($contact_created_at)); ?></div>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
|
||||
<i class="fas fa-fw fa-user-edit"></i> Edit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="invoices.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Clients</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_contacts.php?client_id=<?php echo $client_id; ?>">Contacts</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><?php echo "$contact_name"; ?></li>
|
||||
</ol>
|
||||
|
||||
|
||||
<div class="card card-dark <?php if ($asset_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Make/Model</th>
|
||||
<th>Serial Number</th>
|
||||
<th>Operating System</th>
|
||||
<th>Install Date</th>
|
||||
<th>Status</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_assets)) {
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_type = htmlentities($row['asset_type']);
|
||||
$asset_name = htmlentities($row['asset_name']);
|
||||
$asset_make = htmlentities($row['asset_make']);
|
||||
$asset_model = htmlentities($row['asset_model']);
|
||||
$asset_serial = htmlentities($row['asset_serial']);
|
||||
if (empty($asset_serial)) {
|
||||
$asset_serial_display = "-";
|
||||
}else{
|
||||
$asset_serial_display = $asset_serial;
|
||||
}
|
||||
$asset_os = htmlentities($row['asset_os']);
|
||||
if (empty($asset_os)) {
|
||||
$asset_os_display = "-";
|
||||
}else{
|
||||
$asset_os_display = $asset_os;
|
||||
}
|
||||
$asset_ip = htmlentities($row['asset_ip']);
|
||||
if (empty($asset_ip)) {
|
||||
$asset_ip_display = "-";
|
||||
}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_mac = htmlentities($row['asset_mac']);
|
||||
$asset_status = htmlentities($row['asset_status']);
|
||||
$asset_purchase_date = $row['asset_purchase_date'];
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
$asset_install_date = $row['asset_install_date'];
|
||||
if (empty($asset_install_date)) {
|
||||
$asset_install_date_display = "-";
|
||||
}else{
|
||||
$asset_install_date_display = $asset_install_date;
|
||||
}
|
||||
$asset_notes = htmlentities($row['asset_notes']);
|
||||
$asset_created_at = $row['asset_created_at'];
|
||||
$asset_vendor_id = $row['asset_vendor_id'];
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
}elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
}elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
}elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
}elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
}elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
}elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
}elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
}elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
}elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
}elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
}elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
}else{
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i><?php echo $asset_name; ?>
|
||||
</th>
|
||||
<td><?php echo $asset_type; ?></td>
|
||||
<td><?php echo "$asset_make $asset_model"; ?></td>
|
||||
<td><?php echo $asset_serial_display; ?></td>
|
||||
<td><?php echo $asset_os_display; ?></td>
|
||||
<td><?php echo $asset_install_date_display; ?></td>
|
||||
<td><?php echo $asset_status; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addAssetInterfaceModal<?php echo $asset_id; ?>">Interfaces</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#copyAssetModal<?php echo $asset_id; ?>">Copy</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_asset=<?php echo $asset_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_copy_modal.php");
|
||||
//include("client_asset_tickets_modal.php");
|
||||
include("client_asset_interface_add_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card card-dark <?php if ($login_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-key"></i> Passwords</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
<th>OTP</th>
|
||||
<th>URI</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_logins)) {
|
||||
$login_id = $row['login_id'];
|
||||
$login_name = htmlentities($row['login_name']);
|
||||
$login_uri = htmlentities($row['login_uri']);
|
||||
if (empty($login_uri)) {
|
||||
$login_uri_display = "-";
|
||||
}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_username = htmlentities($row['login_username']);
|
||||
if (empty($login_username)) {
|
||||
$login_username_display = "-";
|
||||
}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_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
$login_otp_secret = htmlentities($row['login_otp_secret']);
|
||||
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
||||
if (empty($login_otp_secret)) {
|
||||
$otp_display = "-";
|
||||
}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>";
|
||||
}
|
||||
$login_note = htmlentities($row['login_note']);
|
||||
$login_contact_id = $row['login_contact_id'];
|
||||
$login_vendor_id = $row['login_vendor_id'];
|
||||
$login_asset_id = $row['login_asset_id'];
|
||||
$login_software_id = $row['login_software_id'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-key text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">
|
||||
<?php echo $login_name; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'Login', $login_id"; ?>)">Share</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
|
||||
<hr>
|
||||
<h3><?php echo $contact_name; ?></h3>
|
||||
<?php if (!empty($contact_title)) { ?>
|
||||
<div class="mb-3 text-secondary"><?php echo $contact_title; ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if (!empty($contact_title)) { ?>
|
||||
<div class="mb-1"><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_email)) { ?>
|
||||
<div><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_phone)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo "$contact_phone $contact_phone_extention"; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_mobile)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo $contact_mobile; ?></div>
|
||||
<?php } ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-clock text-secondary mr-3"></i><?php echo date('Y-m-d',strtotime($contact_created_at)); ?></div>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
|
||||
<i class="fas fa-fw fa-user-edit"></i> Edit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
</div>
|
||||
|
||||
include("client_login_edit_modal.php");
|
||||
}
|
||||
<div class="col-md-9">
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="invoices.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Clients</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_contacts.php?client_id=<?php echo $client_id; ?>">Contacts</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><?php echo "$contact_name"; ?></li>
|
||||
</ol>
|
||||
|
||||
|
||||
<div class="card card-dark <?php if ($asset_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Make/Model</th>
|
||||
<th>Serial Number</th>
|
||||
<th>Operating System</th>
|
||||
<th>Install Date</th>
|
||||
<th>Status</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_assets)) {
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_type = htmlentities($row['asset_type']);
|
||||
$asset_name = htmlentities($row['asset_name']);
|
||||
$asset_make = htmlentities($row['asset_make']);
|
||||
$asset_model = htmlentities($row['asset_model']);
|
||||
$asset_serial = htmlentities($row['asset_serial']);
|
||||
if (empty($asset_serial)) {
|
||||
$asset_serial_display = "-";
|
||||
} else {
|
||||
$asset_serial_display = $asset_serial;
|
||||
}
|
||||
$asset_os = htmlentities($row['asset_os']);
|
||||
if (empty($asset_os)) {
|
||||
$asset_os_display = "-";
|
||||
} else {
|
||||
$asset_os_display = $asset_os;
|
||||
}
|
||||
$asset_ip = htmlentities($row['asset_ip']);
|
||||
if (empty($asset_ip)) {
|
||||
$asset_ip_display = "-";
|
||||
} 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_mac = htmlentities($row['asset_mac']);
|
||||
$asset_status = htmlentities($row['asset_status']);
|
||||
$asset_purchase_date = $row['asset_purchase_date'];
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
$asset_install_date = $row['asset_install_date'];
|
||||
if (empty($asset_install_date)) {
|
||||
$asset_install_date_display = "-";
|
||||
} else {
|
||||
$asset_install_date_display = $asset_install_date;
|
||||
}
|
||||
$asset_notes = htmlentities($row['asset_notes']);
|
||||
$asset_created_at = $row['asset_created_at'];
|
||||
$asset_vendor_id = $row['asset_vendor_id'];
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
} elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
} elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
} elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
} elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
} elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
} elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
} elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
} elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
} elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
} elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
} else {
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i><?php echo $asset_name; ?>
|
||||
</th>
|
||||
<td><?php echo $asset_type; ?></td>
|
||||
<td><?php echo "$asset_make $asset_model"; ?></td>
|
||||
<td><?php echo $asset_serial_display; ?></td>
|
||||
<td><?php echo $asset_os_display; ?></td>
|
||||
<td><?php echo $asset_install_date_display; ?></td>
|
||||
<td><?php echo $asset_status; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown"><i class="fas fa-ellipsis-h"></i></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addAssetInterfaceModal<?php echo $asset_id; ?>">Interfaces</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#copyAssetModal<?php echo $asset_id; ?>">Copy</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_asset=<?php echo $asset_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_copy_modal.php");
|
||||
//include("client_asset_tickets_modal.php");
|
||||
include("client_asset_interface_add_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card card-dark <?php if ($login_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-key"></i> Passwords</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
<th>OTP</th>
|
||||
<th>URI</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_related_logins)) {
|
||||
$login_id = $row['login_id'];
|
||||
$login_name = htmlentities($row['login_name']);
|
||||
$login_uri = htmlentities($row['login_uri']);
|
||||
if (empty($login_uri)) {
|
||||
$login_uri_display = "-";
|
||||
} 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_username = htmlentities($row['login_username']);
|
||||
if (empty($login_username)) {
|
||||
$login_username_display = "-";
|
||||
} 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_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
$login_otp_secret = htmlentities($row['login_otp_secret']);
|
||||
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
||||
if (empty($login_otp_secret)) {
|
||||
$otp_display = "-";
|
||||
} 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>";
|
||||
}
|
||||
$login_note = htmlentities($row['login_note']);
|
||||
$login_contact_id = $row['login_contact_id'];
|
||||
$login_vendor_id = $row['login_vendor_id'];
|
||||
$login_asset_id = $row['login_asset_id'];
|
||||
$login_software_id = $row['login_software_id'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-key text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">
|
||||
<?php echo $login_name; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'Login', $login_id"; ?>)">Share</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_login_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
</div>
|
||||
include("client_contact_edit_modal.php");
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_contact_edit_modal.php");
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php include("footer.php"); ?>
|
||||
|
|
|
|||
|
|
@ -1,52 +1,52 @@
|
|||
<div class="modal" id="addDocumentModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt"></i> New Document</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Name" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control summernote" name="content"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="folder">
|
||||
<option value="0">/</option>
|
||||
<?php
|
||||
$sql_folders = mysqli_query($mysqli,"SELECT * FROM folders WHERE folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_folders)) {
|
||||
$folder_id = $row['folder_id'];
|
||||
$folder_name = htmlentities($row['folder_name']);
|
||||
|
||||
?>
|
||||
<option <?php if ($_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt"></i> New Document</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Name" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control summernote" name="content"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="folder">
|
||||
<option value="0">/</option>
|
||||
<?php
|
||||
$sql_folders = mysqli_query($mysqli,"SELECT * FROM folders WHERE folder_client_id = $client_id ORDER BY folder_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_folders)) {
|
||||
$folder_id = $row['folder_id'];
|
||||
$folder_name = htmlentities($row['folder_name']);
|
||||
|
||||
?>
|
||||
<option <?php if ($_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="add_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Create</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="add_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Create</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>File name</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="form-group">
|
||||
<input type="file" class="form-control-file" name="file" accept=".jpg, .jpeg, .gif, .png, .webp, .pdf, .txt, .doc, .docx, .csv, .xls, .xlsx, .zip, .tar, .gz">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
@ -33,4 +33,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
</button>
|
||||
</div>
|
||||
<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">
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<input type="text" class="form-control" name="name" placeholder="Vendor Name" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="pills-support">
|
||||
|
||||
<label>Support Phone</label>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
<input type="text" class="form-control" name="hours" placeholder="Support Hours">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Support Email</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
<input type="email" class="form-control" name="email" placeholder="Support Email">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Support Website URL</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
<input type="text" class="form-control" name="code" placeholder="Access Code or Pin">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>SLA</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -141,11 +141,11 @@
|
|||
<input type="text" class="form-control" name="sla" placeholder="SLA Response Time">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"></textarea>
|
||||
</div>
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
</button>
|
||||
</div>
|
||||
<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">
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<input type="text" class="form-control" name="name" placeholder="Vendor Name" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="pills-support">
|
||||
|
||||
<label>Support Phone</label>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
|
||||
<input type="text" class="form-control" name="phone" placeholder="Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
<input type="text" class="form-control" name="hours" placeholder="Support Hours">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Support Email</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
<input type="email" class="form-control" name="email" placeholder="Support Email">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>Support Website URL</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
<input type="text" class="form-control" name="code" placeholder="Access Code or Pin">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>SLA</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -141,11 +141,11 @@
|
|||
<input type="text" class="form-control" name="sla" placeholder="SLA Response Time">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"></textarea>
|
||||
</div>
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue