Skip to content

Commit 534096f

Browse files
committed
Software Licenese / Template Enhancements: Fixed create Software from template, added description, user media css for licenses and templates, reworked the add edit modal, Removed Software Login
1 parent 845e168 commit 534096f

7 files changed

Lines changed: 105 additions & 168 deletions

‎admin_software_template_add_modal.php‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="modal-dialog">
33
<div class="modal-content bg-dark">
44
<div class="modal-header">
5-
<h5 class="modal-title"><i class="fa fa-fw fa-rocket mr-2"></i>New License Template</h5>
5+
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>New License Template</h5>
66
<button type="button" class="close text-white" data-dismiss="modal">
77
<span>&times;</span>
88
</button>
@@ -30,6 +30,16 @@
3030
</div>
3131
</div>
3232

33+
<div class="form-group">
34+
<label>Description</label>
35+
<div class="input-group">
36+
<div class="input-group-prepend">
37+
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
38+
</div>
39+
<input type="text" class="form-control" name="description" placeholder="Short description">
40+
</div>
41+
</div>
42+
3343
<div class="form-group">
3444
<label>Type <strong class="text-danger">*</strong></label>
3545
<div class="input-group">
@@ -64,7 +74,7 @@
6474

6575
</div>
6676
<div class="modal-footer bg-white">
67-
<button type="submit" name="add_software_template" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create Template</button>
77+
<button type="submit" name="add_software_template" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Create</button>
6878
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
6979
</div>
7080
</form>

‎admin_software_template_edit_modal.php‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="modal-dialog">
33
<div class="modal-content bg-dark">
44
<div class="modal-header">
5-
<h5 class="modal-title"><i class="fa fa-fw fa-rocket mr-2"></i>Editing template: <strong><?php echo $software_name; ?></strong></h5>
5+
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>Editing template: <strong><?php echo $software_name; ?></strong></h5>
66
<button type="button" class="close text-white" data-dismiss="modal">
77
<span>&times;</span>
88
</button>
@@ -31,6 +31,16 @@
3131
</div>
3232
</div>
3333

34+
<div class="form-group">
35+
<label>Description</label>
36+
<div class="input-group">
37+
<div class="input-group-prepend">
38+
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
39+
</div>
40+
<input type="text" class="form-control" name="description" placeholder="Short description" value="<?php echo $software_description; ?>">
41+
</div>
42+
</div>
43+
3444
<div class="form-group">
3545
<label>Type <strong class="text-danger">*</strong></label>
3646
<div class="input-group">
@@ -64,7 +74,7 @@
6474

6575
</div>
6676
<div class="modal-footer bg-white">
67-
<button type="submit" name="edit_software_template" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save Template</button>
77+
<button type="submit" name="edit_software_template" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
6878
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
6979
</div>
7080
</form>

‎admin_software_templates.php‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
$sql = mysqli_query(
1414
$mysqli,
15-
"SELECT SQL_CALC_FOUND_ROWS * FROM software
16-
LEFT JOIN logins ON login_software_id = software_id
15+
"SELECT SQL_CALC_FOUND_ROWS * FROM software
1716
WHERE software_template = 1
18-
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
17+
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%')
1918
ORDER BY $sort $order LIMIT $record_from, $record_to"
2019
);
2120

@@ -25,7 +24,7 @@
2524

2625
<div class="card card-dark">
2726
<div class="card-header py-2">
28-
<h3 class="card-title mt-2"><i class="fas fa-fw fa-rocket mr-2"></i>License Templates</h3>
27+
<h3 class="card-title mt-2"><i class="fas fa-fw fa-cube mr-2"></i>License Templates</h3>
2928
<div class="card-tools">
3029
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addSoftwareTemplateModal"><i class="fas fa-plus mr-2"></i>New License Template</button>
3130
</div>
@@ -36,7 +35,7 @@
3635

3736
<div class="col-md-4">
3837
<div class="input-group mb-3 mb-md-0">
39-
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){ echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Licenses">
38+
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){ echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search License Templates">
4039
<div class="input-group-append">
4140
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
4241
</div>
@@ -56,7 +55,6 @@
5655
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_name&order=<?php echo $disp; ?>">Template</a></th>
5756
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_type&order=<?php echo $disp; ?>">Type</a></th>
5857
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_license_type&order=<?php echo $disp; ?>">License Type</a></th>
59-
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_seats&order=<?php echo $disp; ?>">Seats</a></th>
6058
<th class="text-center">Action</th>
6159
</tr>
6260
</thead>
@@ -67,20 +65,29 @@
6765
$software_id = intval($row['software_id']);
6866
$software_name = nullable_htmlentities($row['software_name']);
6967
$software_version = nullable_htmlentities($row['software_version']);
68+
$software_description = nullable_htmlentities($row['software_description']);
7069
$software_type = nullable_htmlentities($row['software_type']);
7170
$software_license_type = nullable_htmlentities($row['software_license_type']);
72-
$software_key = nullable_htmlentities($row['software_key']);
73-
$software_seats = nullable_htmlentities($row['software_seats']);
74-
$software_purchase = nullable_htmlentities($row['software_purchase']);
75-
$software_expire = nullable_htmlentities($row['software_expire']);
7671
$software_notes = nullable_htmlentities($row['software_notes']);
7772

7873
?>
7974
<tr>
80-
<td><a class="text-dark text-bold" href="#" data-toggle="modal" data-target="#editSoftwareTemplateModal<?php echo $software_id; ?>"><?php echo "$software_name<br><span class='text-secondary'>$software_version</span>"; ?></a></td>
75+
<td>
76+
<a class="text-dark" href="#" data-toggle="modal" data-target="#editSoftwareTemplateModal<?php echo $software_id; ?>">
77+
<div class="media">
78+
<i class="fa fa-fw fa-2x fa-cube mr-3"></i>
79+
<div class="media-body">
80+
<p>
81+
<?php echo "$software_name <span>$software_version</span>"; ?>
82+
<br>
83+
<small class="text-secondary"><?php echo $software_description; ?></small>
84+
</p>
85+
</div>
86+
</div>
87+
</a>
88+
</td>
8189
<td><?php echo $software_type; ?></td>
8290
<td><?php echo $software_license_type; ?></td>
83-
<td><?php echo $software_seats; ?></td>
8491
<td>
8592
<div class="dropdown dropleft text-center">
8693
<button class="btn btn-secondary btn-sm" data-toggle="dropdown">

‎client_software.php‎

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
$sql = mysqli_query(
1414
$mysqli,
1515
"SELECT SQL_CALC_FOUND_ROWS * FROM software
16-
LEFT JOIN logins ON login_software_id = software_id
1716
WHERE software_client_id = $client_id
1817
AND software_template = 0
1918
AND software_$archive_query
@@ -81,7 +80,6 @@
8180
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_type&order=<?php echo $disp; ?>">Type</a></th>
8281
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_license_type&order=<?php echo $disp; ?>">License Type</a></th>
8382
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_seats&order=<?php echo $disp; ?>">Seats</a></th>
84-
<th></th>
8583
<th class="text-center">Action</th>
8684
</tr>
8785
</thead>
@@ -91,6 +89,7 @@
9189
while ($row = mysqli_fetch_array($sql)) {
9290
$software_id = intval($row['software_id']);
9391
$software_name = nullable_htmlentities($row['software_name']);
92+
$software_description = nullable_htmlentities($row['software_description']);
9493
$software_version = nullable_htmlentities($row['software_version']);
9594
$software_type = nullable_htmlentities($row['software_type']);
9695
$software_license_type = nullable_htmlentities($row['software_license_type']);
@@ -101,11 +100,6 @@
101100
$software_notes = nullable_htmlentities($row['software_notes']);
102101
$software_created_at = nullable_htmlentities($row['software_created_at']);
103102

104-
// Get Login
105-
$login_id = intval($row['login_id']);
106-
$login_username = nullable_htmlentities(decryptLoginEntry($row['login_username']));
107-
$login_password = nullable_htmlentities(decryptLoginEntry($row['login_password']));
108-
109103
$seat_count = 0;
110104

111105
// Asset Licenses
@@ -130,51 +124,23 @@
130124

131125
?>
132126
<tr>
133-
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>"><?php echo "$software_name<br><span class='text-secondary'>$software_version</span>"; ?></a></td>
134-
<td><?php echo $software_type; ?></td>
135-
<td><?php echo $software_license_type; ?></td>
136-
<td><?php echo "$seat_count / $software_seats"; ?></td>
137127
<td>
138-
<?php
139-
if ($login_id > 0) { ?>
140-
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
141-
142-
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
143-
<div class="modal-dialog">
144-
<div class="modal-content bg-dark">
145-
<div class="modal-header">
146-
<h5 class="modal-title"><i class="fa fa-fw fa-key"></i> <?php echo $software_name; ?></h5>
147-
<button type="button" class="close text-white" data-dismiss="modal">
148-
<span>&times;</span>
149-
</button>
150-
</div>
151-
<div class="modal-body bg-white">
152-
<div class="form-group">
153-
<div class="input-group">
154-
<div class="input-group-prepend">
155-
<span class="input-group-text"><i class="fa fa-user"></i></span>
156-
</div>
157-
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
158-
</div>
159-
</div>
160-
<div class="form-group">
161-
<div class="input-group">
162-
<div class="input-group-prepend">
163-
<span class="input-group-text"><i class="fa fa-lock"></i></span>
164-
</div>
165-
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
166-
</div>
167-
</div>
168-
</div>
169-
</div>
128+
<a class="text-dark" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>">
129+
<div class="media">
130+
<i class="fa fa-fw fa-2x fa-cube mr-3"></i>
131+
<div class="media-body">
132+
<p>
133+
<?php echo "$software_name <span>$software_version</span>"; ?>
134+
<br>
135+
<small class="text-secondary"><?php echo $software_description; ?></small>
136+
</p>
170137
</div>
171138
</div>
172-
173-
<?php
174-
}
175-
176-
?>
139+
</a>
177140
</td>
141+
<td><?php echo $software_type; ?></td>
142+
<td><?php echo $software_license_type; ?></td>
143+
<td><?php echo "$seat_count / $software_seats"; ?></td>
178144
<td>
179145
<div class="dropdown dropleft text-center">
180146
<button class="btn btn-secondary btn-sm" data-toggle="dropdown">
@@ -216,11 +182,11 @@
216182
</div>
217183

218184
<?php
185+
219186
require_once "client_software_add_modal.php";
220187

221188
require_once "client_software_add_from_template_modal.php";
222189

223190
require_once "client_software_export_modal.php";
224191

225192
require_once "footer.php";
226-

‎client_software_add_modal.php‎

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
<li class="nav-item">
2222
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
2323
</li>
24-
<li class="nav-item">
25-
<a class="nav-link" data-toggle="pill" href="#pills-login">Login</a>
26-
</li>
2724
</ul>
2825

2926
<hr>
@@ -52,6 +49,16 @@
5249
</div>
5350
</div>
5451

52+
<div class="form-group">
53+
<label>Description</label>
54+
<div class="input-group">
55+
<div class="input-group-prepend">
56+
<span class="input-group-text"><i class="fa fa-fw fa-angle-right"></i></span>
57+
</div>
58+
<input type="text" class="form-control" name="description" placeholder="Short description">
59+
</div>
60+
</div>
61+
5562
<div class="form-group">
5663
<label>Type <strong class="text-danger">*</strong></label>
5764
<div class="input-group">
@@ -178,34 +185,7 @@
178185

179186
<div class="tab-pane fade" id="pills-notes">
180187

181-
<textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"></textarea>
182-
183-
</div>
184-
185-
<div class="tab-pane fade" id="pills-login">
186-
187-
<div class="form-group">
188-
<label>Username</label>
189-
<div class="input-group">
190-
<div class="input-group-prepend">
191-
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
192-
</div>
193-
<input type="text" class="form-control" name="username" placeholder="Username">
194-
</div>
195-
</div>
196-
197-
<div class="form-group">
198-
<label>Password</label>
199-
<div class="input-group">
200-
<div class="input-group-prepend">
201-
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
202-
</div>
203-
<input type="password" class="form-control" data-toggle="password" name="password" placeholder="Password" autocomplete="new-password">
204-
<div class="input-group-append">
205-
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
206-
</div>
207-
</div>
208-
</div>
188+
<textarea class="form-control" rows="12" placeholder="Enter some notes" name="notes"></textarea>
209189

210190
</div>
211191

0 commit comments

Comments
 (0)