diff --git a/ajax.php b/ajax.php index 35bc752b..afb622bd 100644 --- a/ajax.php +++ b/ajax.php @@ -40,72 +40,6 @@ if (isset($_GET['certificate_fetch_parse_json_details'])) { } -/* - * Looks up info for a given certificate ID from the database, used to dynamically populate modal fields - */ -if (isset($_GET['certificate_get_json_details'])) { - enforceUserPermission('module_support'); - - $certificate_id = intval($_GET['certificate_id']); - $client_id = intval($_GET['client_id']); - - // Individual certificate lookup - $cert_sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_id = $certificate_id AND certificate_client_id = $client_id"); - while ($row = mysqli_fetch_array($cert_sql)) { - $response['certificate'][] = $row; - } - - // Get all domains for this client that could be linked to this certificate - $domains_sql = mysqli_query($mysqli, "SELECT domain_id, domain_name FROM domains WHERE domain_client_id = $client_id"); - while ($row = mysqli_fetch_array($domains_sql)) { - $response['domains'][] = $row; - } - - echo json_encode($response); -} - -/* - * Looks up info for a given domain ID from the database, used to dynamically populate modal fields - */ -if (isset($_GET['domain_get_json_details'])) { - enforceUserPermission('module_support'); - - $domain_id = intval($_GET['domain_id']); - $client_id = intval($_GET['client_id']); - - // Individual domain lookup - $cert_sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_id = $domain_id AND domain_client_id = $client_id"); - while ($row = mysqli_fetch_array($cert_sql)) { - $response['domain'][] = $row; - } - - // Get all registrars/webhosts (vendors) for this client that could be linked to this domain - $vendor_sql = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC"); - while ($row = mysqli_fetch_array($vendor_sql)) { - $response['vendors'][] = $row; - } - - // Get domain history - $history_sql = mysqli_query($mysqli, "SELECT * FROM domain_history WHERE domain_history_domain_id = $domain_id"); - $history_html = "
| Date | Field | Before | After |
|---|---|---|---|
| " . htmlspecialchars(date('Y-m-d', strtotime($row['domain_history_modified_at']))) . " | "; - $history_html .= "" . htmlspecialchars($row['domain_history_column']) . " | "; - $history_html .= "" . htmlspecialchars($row['domain_history_old_value']) . " | "; - $history_html .= "" . htmlspecialchars($row['domain_history_new_value']) . " | "; - $history_html .= "