Added category to logins, added OS and MAC to assets, minor UI updates

This commit is contained in:
johnny@pittpc.com 2020-02-03 13:55:21 -05:00
parent 866aa3fa51
commit 76ed7afa18
23 changed files with 438 additions and 58 deletions

View File

@ -7,25 +7,34 @@
<span aria-hidden="true">&times;</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">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" id="pills-details-tab" data-toggle="pill" href="#pills-details">Details</a>
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-assignment-tab" data-toggle="pill" href="#pills-assignment">Assignment</a>
<a class="nav-link" data-toggle="pill" href="#pills-assignment">Assignment</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-purchase-tab" data-toggle="pill" href="#pills-purchase">Purchase</a>
<a class="nav-link" data-toggle="pill" href="#pills-purchase">Purchase</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-login-tab" data-toggle="pill" href="#pills-login">Login</a>
<a class="nav-link" data-toggle="pill" href="#pills-login">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
</li>
</ul>
<hr>
<div class="tab-content" id="pills-tabContent">
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-details">
@ -65,24 +74,35 @@
</div>
<div class="form-group">
<label>Model <strong class="text-danger">*</strong></label>
<label>Model</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<input type="text" class="form-control" name="model" placeholder="Model Number" required>
<input type="text" class="form-control" name="model" placeholder="Model Number">
</div>
</div>
<div class="form-group">
<label>Serial Number <strong class="text-danger">*</strong></label>
<label>Serial Number</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
</div>
<input type="text" class="form-control" name="serial" placeholder="Serial number" required>
<input type="text" class="form-control" name="serial" placeholder="Serial number">
</div>
</div>
<div class="form-group">
<label>Operating System</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-windows"></i></span>
</div>
<input type="text" class="form-control" name="os" placeholder="ex Windows 10 Pro">
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-assignment">
@ -170,6 +190,16 @@
<input type="text" class="form-control" name="ip" placeholder="IP Address" data-inputmask="'alias': 'ip'">
</div>
</div>
<div class="form-group">
<label>MAC Address</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
</div>
<input type="text" class="form-control" name="mac" placeholder="MAC Address" data-inputmask="'alias': 'mac'">
</div>
</div>
</div>
@ -231,6 +261,7 @@
<input type="text" class="form-control" name="username" placeholder="Username">
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
@ -242,6 +273,15 @@
</div>
</div>
<div class="tab-pane fade" id="pills-notes">
<div class="form-group">
<textarea class="form-control" rows="8" name="notes"></textarea>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">

View File

@ -146,12 +146,12 @@
<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" data-inputmask="'mask': '999-999-9999'" data-mask>
<input type="text" class="form-control" name="contact_phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
</div>
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension">
<input type="text" class="form-control" name="contact_extension" placeholder="Extension">
</div>
</div>
@ -162,7 +162,7 @@
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
</div>
<input type="text" class="form-control" name="mobile" placeholder="Mobile Number" data-inputmask="'mask': '999-999-9999'" data-mask>
<input type="text" class="form-control" name="contact_mobile" placeholder="Mobile Number" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-lock mr-2"></i>New Login</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>New Login</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
@ -33,11 +33,21 @@
<label>Name <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name of Login" required autofocus>
</div>
</div>
<div class="form-group">
<label>Category <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<input type="text" class="form-control" name="category" placeholder="Category" required>
</div>
</div>
<div class="form-group">
<label>Username <strong class="text-danger">*</strong></label>
@ -153,8 +163,7 @@
<div class="tab-pane fade" id="pills-notes">
<div class="form-group">
<label>Notes</label>
<textarea class="form-control" rows="5" name="note"></textarea>
<textarea class="form-control" rows="8" name="note"></textarea>
</div>
</div>

View File

@ -35,6 +35,8 @@ if(isset($_GET['client_id'])){
if($client_net_terms == 0){
$client_net_terms = $config_default_net_terms;
}
$client_company_size = $row['client_company_size'];
$client_notes = $row['client_notes'];
//Add up all the payments for the invoice and get the total amount paid to the invoice
$sql_invoice_amounts = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled'");

View File

@ -89,9 +89,12 @@ $total_pages = ceil($total_found_rows / 10);
$asset_make = $row['asset_make'];
$asset_model = $row['asset_model'];
$asset_serial = $row['asset_serial'];
$asset_os = $row['asset_os'];
$asset_ip = $row['asset_ip'];
$asset_mac = $row['asset_mac'];
$asset_purchase_date = $row['asset_purchase_date'];
$asset_warranty_expire = $row['asset_warranty_expire'];
$asset_notes = $row['asset_notes'];
$vendor_id = $row['vendor_id'];
$location_id = $row['location_id'];
$contact_id = $row['contact_id'];
@ -134,11 +137,11 @@ $total_pages = ceil($total_found_rows / 10);
?>
<tr>
<td>
<th>
<a class="text-dark" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">
<i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-2"></i><?php echo $asset_type; ?>
</a>
</td>
</th>
<td>
<?php
if($asset_id == $asset_id_relation){
@ -151,7 +154,7 @@ $total_pages = ceil($total_found_rows / 10);
<div class="modal-header text-white">
<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 aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div>
<div class="modal-body bg-white">
@ -187,10 +190,10 @@ $total_pages = ceil($total_found_rows / 10);
<td><?php echo $asset_serial; ?></td>
<td>
<div class="dropdown dropleft text-center">
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
<a class="dropdown-item" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
</div>

View File

@ -99,7 +99,7 @@ $total_pages = ceil($total_found_rows / 10);
?>
<tr>
<td class="text-center">
<th class="text-center">
<a class="text-dark" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
<?php if(!empty($contact_photo)){ ?>
@ -114,9 +114,9 @@ $total_pages = ceil($total_found_rows / 10);
<br>
<?php } ?>
<div class="text-secondary"><?php echo $contact_name; ?></div>
<div class="text-dark"><?php echo $contact_name; ?></div>
</a>
</td>
</th>
<td><?php echo $contact_title; ?></td>
<td><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a></td>

View File

@ -103,7 +103,10 @@ $total_pages = ceil($total_found_rows / 10);
?>
<tr>
<td><i class="fa fa-fw fa-map-marker-alt text-secondary"></i> <a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a></td>
<th>
<i class="fa fa-fw fa-map-marker-alt text-secondary"></i>
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a>
</th>
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?></a></td>
<td><?php echo $location_phone; ?></td>
<td><?php echo $location_hours; ?></td>

View File

@ -42,7 +42,7 @@ if(isset($_GET['o'])){
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS *, AES_DECRYPT(login_password, '$config_aes_key') AS login_password FROM logins
WHERE client_id = $client_id
AND (login_name LIKE '%$q%' OR login_username LIKE '%$q%')
AND (login_name LIKE '%$q%' OR login_username LIKE '%$q%' OR login_category LIKE '%$q%' OR login_uri LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
@ -73,6 +73,7 @@ $total_pages = ceil($total_found_rows / 10);
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<tr>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_category&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_username&o=<?php echo $disp; ?>">Username</a></th>
<th>Password</th>
<th class="text-center">Action</th>
@ -84,6 +85,7 @@ $total_pages = ceil($total_found_rows / 10);
while($row = mysqli_fetch_array($sql)){
$login_id = $row['login_id'];
$login_name = $row['login_name'];
$login_category = $row['login_category'];
$login_uri = $row['login_uri'];
$login_username = $row['login_username'];
$login_password = $row['login_password'];
@ -101,6 +103,7 @@ $total_pages = ceil($total_found_rows / 10);
<small class="text-secondary"><?php echo $login_uri; ?></small>
</td>
<td><?php echo $login_category; ?></td>
<td><?php echo $login_username; ?></td>
<td><?php echo $login_password; ?></td>
<td>

View File

@ -93,7 +93,9 @@ $total_pages = ceil($total_found_rows / 10);
?>
<tr>
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editNetworkModal<?php echo $network_id; ?>"><?php echo $network_name; ?></a></td>
<th>
<i class="fa fa-fw fa-network-wired text-secondary"></i>
<a class="text-dark" href="#" data-toggle="modal" data-target="#editNetworkModal<?php echo $network_id; ?>"><?php echo $network_name; ?></a></th>
<td><?php echo $network_vlan; ?></td>
<td><?php echo $network; ?></td>
<td><?php echo $network_gateway; ?></td>

View File

@ -68,6 +68,7 @@ $total_pages = ceil($total_found_rows / 10);
</div>
</form>
<hr>
<?php echo $_SESSION['bean']; ?>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">

View File

@ -108,7 +108,7 @@ $total_pages = ceil($total_found_rows / 10);
?>
<tr>
<td>
<th>
<i class="fa fa-fw fa-building text-secondary"></i>
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
<?php
@ -119,7 +119,7 @@ $total_pages = ceil($total_found_rows / 10);
<?php
}
?>
</td>
</th>
<td><?php echo $vendor_description; ?></td>
<td>
<?php

33
db.sql
View File

@ -64,13 +64,15 @@ CREATE TABLE `assets` (
`asset_type` varchar(200) NOT NULL,
`asset_name` varchar(200) NOT NULL,
`asset_make` varchar(200) NOT NULL,
`asset_model` varchar(200) NOT NULL,
`asset_serial` varchar(200) NOT NULL,
`asset_model` varchar(200) DEFAULT NULL,
`asset_serial` varchar(200) DEFAULT NULL,
`asset_os` varchar(200) DEFAULT NULL,
`asset_ip` varchar(20) DEFAULT NULL,
`asset_mac` varchar(200) DEFAULT NULL,
`asset_purchase_date` date DEFAULT NULL,
`asset_warranty_expire` date DEFAULT NULL,
`asset_reciept` varchar(200) DEFAULT NULL,
`asset_note` varchar(200) DEFAULT NULL,
`asset_notes` text DEFAULT NULL,
`asset_created_at` datetime NOT NULL,
`asset_updated_at` datetime DEFAULT NULL,
`login_id` int(11) DEFAULT NULL,
@ -396,6 +398,7 @@ DROP TABLE IF EXISTS `logins`;
CREATE TABLE `logins` (
`login_id` int(11) NOT NULL AUTO_INCREMENT,
`login_name` varchar(200) NOT NULL,
`login_category` varchar(200) DEFAULT NULL,
`login_uri` varchar(200) DEFAULT NULL,
`login_username` varchar(200) NOT NULL,
`login_password` varbinary(200) DEFAULT NULL,
@ -444,6 +447,7 @@ DROP TABLE IF EXISTS `networks`;
CREATE TABLE `networks` (
`network_id` int(11) NOT NULL AUTO_INCREMENT,
`network_name` varchar(200) NOT NULL,
`network_vlan` int(11) DEFAULT NULL,
`network` varchar(200) NOT NULL,
`network_gateway` varchar(200) NOT NULL,
`network_dhcp_range` varchar(200) DEFAULT NULL,
@ -543,6 +547,27 @@ CREATE TABLE `quotes` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `records`
--
DROP TABLE IF EXISTS `records`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `records` (
`record_id` int(11) NOT NULL AUTO_INCREMENT,
`record_type` varchar(200) NOT NULL,
`record` varchar(200) NOT NULL,
`record_value` varchar(200) NOT NULL,
`record_priority` int(11) DEFAULT NULL,
`record_created_at` datetime NOT NULL,
`record_updated_at` datetime NOT NULL,
`domain_id` int(11) NOT NULL,
`company_id` int(11) NOT NULL,
PRIMARY KEY (`record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `recurring`
--
@ -830,4 +855,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-02-02 1:06:01
-- Dump completed on 2020-02-03 13:54:11

View File

@ -14,18 +14,21 @@
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $asset_id; ?>">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" id="pills-details-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-details<?php echo $asset_id; ?>" >Details</a>
<a class="nav-link active" data-toggle="pill" href="#pills-details<?php echo $asset_id; ?>">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-assignment-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-assignment<?php echo $asset_id; ?>" role="tab" aria-controls="pills-assignment<?php echo $asset_id; ?>" aria-selected="false">Assignment</a>
<a class="nav-link" data-toggle="pill" href="#pills-assignment<?php echo $asset_id; ?>">Assignment</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-purchase-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-purchase<?php echo $asset_id; ?>" role="tab" aria-controls="pills-purchase<?php echo $asset_id; ?>" aria-selected="false">Purchase</a>
<a class="nav-link" data-toggle="pill" href="#pills-purchase<?php echo $asset_id; ?>">Purchase</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-login-tab<?php echo $asset_id; ?>" data-toggle="pill" href="#pills-login<?php echo $asset_id; ?>" role="tab" aria-controls="pills-login<?php echo $asset_id; ?>" aria-selected="false">Login</a>
<a class="nav-link" data-toggle="pill" href="#pills-login<?php echo $asset_id; ?>">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-notes<?php echo $asset_id; ?>">Notes</a>
</li>
</ul>
@ -70,22 +73,32 @@
</div>
<div class="form-group">
<label>Model <strong class="text-danger">*</strong></label>
<label>Model</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
</div>
<input type="text" class="form-control" name="model" placeholder="Model Number" value="<?php echo $asset_model; ?>" required>
<input type="text" class="form-control" name="model" placeholder="Model Number" value="<?php echo $asset_model; ?>">
</div>
</div>
<div class="form-group">
<label>Serial Number <strong class="text-danger">*</strong></label>
<label>Serial Number</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
</div>
<input type="text" class="form-control" name="serial" placeholder="Serial number" value="<?php echo $asset_serial; ?>" required>
<input type="text" class="form-control" name="serial" placeholder="Serial number" value="<?php echo $asset_serial; ?>">
</div>
</div>
<div class="form-group">
<label>Operating System</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fab fa-fw fa-windows"></i></span>
</div>
<input type="text" class="form-control" name="os" placeholder="ex Windows 10 Pro" value="<?php echo $asset_os; ?>">
</div>
</div>
@ -176,6 +189,16 @@
<input type="text" class="form-control" name="ip" value="<?php echo $asset_ip; ?>" placeholder="IP Address" data-inputmask="'alias': 'ip'">
</div>
</div>
<div class="form-group">
<label>MAC Address</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-ethernet"></i></span>
</div>
<input type="text" class="form-control" name="mac" value="<?php echo $asset_mac; ?>" placeholder="MAC Address" data-inputmask="'alias': 'mac'">
</div>
</div>
</div>
@ -227,7 +250,8 @@
</div>
<div class="tab-pane fade" id="pills-login<?php echo $asset_id; ?>" role="tabpanel" aria-labelledby="pills-login-tab<?php echo $asset_id; ?>">
<div class="tab-pane fade" id="pills-login<?php echo $asset_id; ?>">
<div class="form-group">
<label>Username</label>
<div class="input-group">
@ -237,6 +261,7 @@
<input type="text" class="form-control" name="username" placeholder="Username" value="<?php echo $login_username; ?>">
</div>
</div>
<div class="form-group">
<label>Password</label>
<div class="input-group">
@ -249,6 +274,14 @@
</div>
<div class="tab-pane fade" id="pills-notes<?php echo $asset_id; ?>">
<div class="form-group">
<textarea class="form-control" rows="8" name="notes"><?php echo $asset_notes; ?></textarea>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-white">

View File

@ -146,12 +146,12 @@
<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" value="<?php echo $client_phone; ?>" data-inputmask="'mask': '999-999-9999'" data-mask>
<input type="text" class="form-control" name="contact_phone" placeholder="Phone Number" value="<?php echo $client_phone; ?>" data-inputmask="'mask': '999-999-9999'" data-mask>
</div>
</div>
</div>
<div class="col-4">
<input type="text" class="form-control" name="extension" placeholder="Extension" value="<?php echo $client_extension; ?>">
<input type="text" class="form-control" name="contact_extension" placeholder="Extension" value="<?php echo $client_extension; ?>">
</div>
</div>

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-lock mr-2"></i><?php echo $login_name; ?></h5>
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i><?php echo $login_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
@ -33,11 +33,21 @@
<label>Name <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name of Login" value="<?php echo $login_name; ?>" required>
</div>
</div>
<div class="form-group">
<label>Category <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div>
<input type="text" class="form-control" name="category" placeholder="Category" value="<?php echo $login_category; ?>" required>
</div>
</div>
<div class="form-group">
<label>Username <strong class="text-danger">*</strong></label>
@ -162,8 +172,7 @@
<div class="tab-pane fade" id="pills-notes<?php echo $login_id; ?>">
<div class="form-group">
<label>Notes</label>
<textarea class="form-control" rows="5" name="note"><?php echo $login_note; ?></textarea>
<textarea class="form-control" rows="8" name="note"><?php echo $login_note; ?></textarea>
</div>
</div>

View File

@ -13,6 +13,7 @@
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Custom js-->
<script src="plugins/toastr/toastr.min.js"></script>
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/chart.js/Chart.min.js"></script>
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>

View File

@ -21,6 +21,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
@ -36,6 +37,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<link href='plugins/fullcalendar-bootstrap/main.min.css' rel='stylesheet' />
<link href='plugins/daterangepicker/daterangepicker.css' rel='stylesheet' />
<link href="plugins/summernote/summernote-bs4.css" rel="stylesheet">
<link href="plugins/toastr/toastr.min.css" rel="stylesheet">
</head>
<body class="hold-transition sidebar-mini">

228
plugins/toastr/toastr.css Normal file
View File

@ -0,0 +1,228 @@
.toast-title {
font-weight: bold;
}
.toast-message {
-ms-word-wrap: break-word;
word-wrap: break-word;
}
.toast-message a,
.toast-message label {
color: #FFFFFF;
}
.toast-message a:hover {
color: #CCCCCC;
text-decoration: none;
}
.toast-close-button {
position: relative;
right: -0.3em;
top: -0.3em;
float: right;
font-size: 20px;
font-weight: bold;
color: #FFFFFF;
-webkit-text-shadow: 0 1px 0 #ffffff;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
filter: alpha(opacity=80);
line-height: 1;
}
.toast-close-button:hover,
.toast-close-button:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.4;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
filter: alpha(opacity=40);
}
.rtl .toast-close-button {
left: -0.3em;
float: left;
right: 0.3em;
}
/*Additional properties for button version
iOS requires the button element instead of an anchor tag.
If you want the anchor version, it requires `href="#"`.*/
button.toast-close-button {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.toast-top-center {
top: 0;
right: 0;
width: 100%;
}
.toast-bottom-center {
bottom: 0;
right: 0;
width: 100%;
}
.toast-top-full-width {
top: 0;
right: 0;
width: 100%;
}
.toast-bottom-full-width {
bottom: 0;
right: 0;
width: 100%;
}
.toast-top-left {
top: 12px;
left: 12px;
}
.toast-top-right {
top: 12px;
right: 12px;
}
.toast-bottom-right {
right: 12px;
bottom: 12px;
}
.toast-bottom-left {
bottom: 12px;
left: 12px;
}
#toast-container {
position: fixed;
z-index: 999999;
pointer-events: none;
/*overrides*/
}
#toast-container * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
#toast-container > div {
position: relative;
pointer-events: auto;
overflow: hidden;
margin: 0 0 6px;
padding: 15px 15px 15px 50px;
width: 300px;
-moz-border-radius: 3px 3px 3px 3px;
-webkit-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
background-position: 15px center;
background-repeat: no-repeat;
-moz-box-shadow: 0 0 12px #999999;
-webkit-box-shadow: 0 0 12px #999999;
box-shadow: 0 0 12px #999999;
color: #FFFFFF;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
filter: alpha(opacity=80);
}
#toast-container > div.rtl {
direction: rtl;
padding: 15px 50px 15px 15px;
background-position: right 15px center;
}
#toast-container > div:hover {
-moz-box-shadow: 0 0 12px #000000;
-webkit-box-shadow: 0 0 12px #000000;
box-shadow: 0 0 12px #000000;
opacity: 1;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
filter: alpha(opacity=100);
cursor: pointer;
}
#toast-container > .toast-info {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important;
}
#toast-container > .toast-error {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important;
}
#toast-container > .toast-success {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important;
}
#toast-container > .toast-warning {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important;
}
#toast-container.toast-top-center > div,
#toast-container.toast-bottom-center > div {
width: 300px;
margin-left: auto;
margin-right: auto;
}
#toast-container.toast-top-full-width > div,
#toast-container.toast-bottom-full-width > div {
width: 96%;
margin-left: auto;
margin-right: auto;
}
.toast {
background-color: #030303;
}
.toast-success {
background-color: #51A351;
}
.toast-error {
background-color: #BD362F;
}
.toast-info {
background-color: #2F96B4;
}
.toast-warning {
background-color: #F89406;
}
.toast-progress {
position: absolute;
left: 0;
bottom: 0;
height: 4px;
background-color: #000000;
opacity: 0.4;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
filter: alpha(opacity=40);
}
/*Responsive Design*/
@media all and (max-width: 240px) {
#toast-container > div {
padding: 8px 8px 8px 50px;
width: 11em;
}
#toast-container > div.rtl {
padding: 8px 50px 8px 8px;
}
#toast-container .toast-close-button {
right: -0.2em;
top: -0.2em;
}
#toast-container .rtl .toast-close-button {
left: -0.2em;
right: 0.2em;
}
}
@media all and (min-width: 241px) and (max-width: 480px) {
#toast-container > div {
padding: 8px 8px 8px 50px;
width: 18em;
}
#toast-container > div.rtl {
padding: 8px 50px 8px 8px;
}
#toast-container .toast-close-button {
right: -0.2em;
top: -0.2em;
}
#toast-container .rtl .toast-close-button {
left: -0.2em;
right: 0.2em;
}
}
@media all and (min-width: 481px) and (max-width: 768px) {
#toast-container > div {
padding: 15px 15px 15px 50px;
width: 25em;
}
#toast-container > div.rtl {
padding: 15px 50px 15px 15px;
}
}

File diff suppressed because one or more lines are too long

1
plugins/toastr/toastr.min.css vendored Normal file

File diff suppressed because one or more lines are too long

2
plugins/toastr/toastr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -2969,7 +2969,9 @@ if(isset($_POST['add_asset'])){
$make = strip_tags(mysqli_real_escape_string($mysqli,$_POST['make']));
$model = strip_tags(mysqli_real_escape_string($mysqli,$_POST['model']));
$serial = strip_tags(mysqli_real_escape_string($mysqli,$_POST['serial']));
$os = strip_tags(mysqli_real_escape_string($mysqli,$_POST['os']));
$ip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['ip']));
$mac = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mac']));
$location = intval($_POST['location']);
$vendor = intval($_POST['vendor']);
$contact = intval($_POST['contact']);
@ -2982,9 +2984,9 @@ if(isset($_POST['add_asset'])){
if(empty($warranty_expire)){
$warranty_expire = "0000-00-00";
}
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_ip = '$ip', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note', asset_created_at = NOW(), network_id = $network, client_id = $client_id, company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_notes = '$notes', asset_created_at = NOW(), network_id = $network, client_id = $client_id, company_id = $session_company_id");
if(!empty($_POST['username'])) {
$asset_id = mysqli_insert_id($mysqli);
@ -3014,7 +3016,9 @@ if(isset($_POST['edit_asset'])){
$make = strip_tags(mysqli_real_escape_string($mysqli,$_POST['make']));
$model = strip_tags(mysqli_real_escape_string($mysqli,$_POST['model']));
$serial = strip_tags(mysqli_real_escape_string($mysqli,$_POST['serial']));
$os = strip_tags(mysqli_real_escape_string($mysqli,$_POST['os']));
$ip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['ip']));
$mac = strip_tags(mysqli_real_escape_string($mysqli,$_POST['mac']));
$location = intval($_POST['location']);
$vendor = intval($_POST['vendor']);
$contact = intval($_POST['contact']);
@ -3027,11 +3031,11 @@ if(isset($_POST['edit_asset'])){
if(empty($warranty_expire)){
$warranty_expire = "0000-00-00";
}
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
$username = strip_tags(mysqli_real_escape_string($mysqli,$_POST['username']));
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_ip = '$ip', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note', asset_updated_at = NOW(), network_id = $network WHERE asset_id = $asset_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_notes = '$notes', asset_updated_at = NOW(), network_id = $network WHERE asset_id = $asset_id AND company_id = $session_company_id");
//If login exists then update the login
if($login_id > 0){
@ -3072,6 +3076,7 @@ if(isset($_POST['add_login'])){
$client_id = intval($_POST['client_id']);
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
$category = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['category'])));
$uri = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['uri'])));
$username = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['username'])));
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
@ -3080,7 +3085,7 @@ if(isset($_POST['add_login'])){
$asset_id = intval($_POST['asset']);
$software_id = intval($_POST['software']);
mysqli_query($mysqli,"INSERT INTO logins SET login_name = '$name', login_uri = '$uri', login_username = '$username', login_password = AES_ENCRYPT('$password','$config_aes_key'), login_note = '$note', login_created_at = NOW(), vendor_id = $vendor_id, asset_id = $asset_id, software_id = $software_id, client_id = $client_id, company_id = $session_company_id");
mysqli_query($mysqli,"INSERT INTO logins SET login_name = '$name', login_category = '$category', login_uri = '$uri', login_username = '$username', login_password = AES_ENCRYPT('$password','$config_aes_key'), login_note = '$note', login_created_at = NOW(), vendor_id = $vendor_id, asset_id = $asset_id, software_id = $software_id, client_id = $client_id, company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Login', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
@ -3095,6 +3100,7 @@ if(isset($_POST['edit_login'])){
$login_id = intval($_POST['login_id']);
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$category = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['category'])));
$uri = strip_tags(mysqli_real_escape_string($mysqli,$_POST['uri']));
$username = strip_tags(mysqli_real_escape_string($mysqli,$_POST['username']));
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
@ -3103,7 +3109,7 @@ if(isset($_POST['edit_login'])){
$asset_id = intval($_POST['asset']);
$software_id = intval($_POST['software']);
mysqli_query($mysqli,"UPDATE logins SET login_name = '$name', login_uri = '$uri', login_username = '$username', login_password = AES_ENCRYPT('$password','$config_aes_key'), login_note = '$note', login_updated_at = NOW(), vendor_id = $vendor_id, asset_id = $asset_id, software_id = $software_id WHERE login_id = $login_id AND company_id = $session_company_id");
mysqli_query($mysqli,"UPDATE logins SET login_name = '$name', login_category = '$category', login_uri = '$uri', login_username = '$username', login_password = AES_ENCRYPT('$password','$config_aes_key'), login_note = '$note', login_updated_at = NOW(), vendor_id = $vendor_id, asset_id = $asset_id, software_id = $software_id WHERE login_id = $login_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Login', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
@ -3188,7 +3194,16 @@ if(isset($_POST['add_note'])){
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Note', log_action = 'Created', log_description = '$subject', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
$_SESSION['alert_message'] = "Note added";
//$_SESSION['alert_message'] = "Note added";
$_SESSION['bean'] = "
<div class='toast'>
<div class='toast-body'>
Hello, world! This is a toast message.
</div>
</div>
";
header("Location: " . $_SERVER["HTTP_REFERER"]);

View File

@ -4,7 +4,7 @@
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
<a class="nav-link" data-widget="pushmenu" data-enable-remember="TRUE" href="#"><i class="fas fa-bars"></i></a>
</li>
</ul>