Refactor domains modals so they are dyanmically populated. Implement basic NS, MX and WHOIS scraping for domains on add/edit

This commit is contained in:
Marcus Hill
2022-03-07 22:31:19 +00:00
parent 8839ee1f73
commit e1a419ea11
4 changed files with 228 additions and 77 deletions

View File

@@ -76,6 +76,28 @@ if(isset($_GET['certificate_get_json_details'])){
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'])){
$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");
while($row = mysqli_fetch_array($vendor_sql)){
$response['vendors'][] = $row;
}
echo json_encode($response);
}
/*
* Looks up info on the ticket number provided, used to populate the ticket merge modal
*/