diff --git a/add_certificate_modal.php b/add_certificate_modal.php new file mode 100644 index 00000000..2292710f --- /dev/null +++ b/add_certificate_modal.php @@ -0,0 +1,51 @@ + \ No newline at end of file diff --git a/client.php b/client.php index 122c79b9..a1976a31 100644 --- a/client.php +++ b/client.php @@ -78,6 +78,9 @@ if(isset($_GET['client_id'])){ $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('domain_id') AS num FROM domains WHERE client_id = $client_id")); $num_domains = $row['num']; + + $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('certificate_id') AS num FROM certificates WHERE client_id = $client_id")); + $num_certificates = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('software_id') AS num FROM software WHERE client_id = $client_id")); $num_software = $row['num']; diff --git a/client_certificates.php b/client_certificates.php new file mode 100644 index 00000000..1ae5e2c2 --- /dev/null +++ b/client_certificates.php @@ -0,0 +1,127 @@ + $sb, 'o' => $o))); + +//Paging +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*$config_records_per_page; + $record_to = $config_records_per_page; +}else{ + $record_from = 0; + $record_to = $config_records_per_page; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = mysqli_real_escape_string($mysqli,$_GET['q']); +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); +}else{ + $sb = "certificate_name"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM certificates + WHERE client_id = $client_id AND (certificate_name LIKE '%$q%' OR certificate_issued_by LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to"); + +$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +$total_found_rows = $num_rows[0]; +$total_pages = ceil($total_found_rows / 10); + +?> + +
+
+
Certificates
+ +
+
+
+ + +
+ +
+ +
+
+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + +
NameIssued ByExpireUpdatedAction
+ + +
+ + + +
+
+
+ + \ No newline at end of file diff --git a/client_routes.php b/client_routes.php index e471f021..da921ac9 100644 --- a/client_routes.php +++ b/client_routes.php @@ -25,6 +25,9 @@ if(isset($_GET['tab'])){ elseif($_GET['tab'] == "domains"){ include("client_domains.php"); } + elseif($_GET['tab'] == "certificates"){ + include("client_certificates.php"); + } elseif($_GET['tab'] == "software"){ include("client_software.php"); } diff --git a/client_side_nav.php b/client_side_nav.php index 9847aae9..a5a794ff 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -95,6 +95,19 @@ + +