Add Vendor Details Popup, works with Domain Vendors right now, Added fallBack function when no text is present use a placeholder
This commit is contained in:
@@ -7,7 +7,7 @@ $category = nullable_htmlentities($_GET['category']);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-list-ul mr-2"></i>New <?php echo $category; ?> Category</h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-list-ul mr-2"></i>New Category</h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -21,31 +21,19 @@ $type = intval($_GET['id']);
|
|||||||
<input type="hidden" name="type" value="<?php echo $type; ?>">
|
<input type="hidden" name="type" value="<?php echo $type; ?>">
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Name <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
<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="name" placeholder="Tag name" maxlength="200" required autofocus>
|
<input type="text" class="form-control" name="name" placeholder="Tag name" maxlength="200" required autofocus>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Color <strong class="text-danger">*</strong></label>
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-paint-brush"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="color" class="form-control col-3" name="color" required>
|
<input type="color" class="form-control col-3" name="color" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Icon</label>
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-image"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="icon" placeholder="Icon ex handshake">
|
<input type="text" class="form-control" name="icon" placeholder="Icon ex handshake">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,23 +20,69 @@ $sla = sanitizeInput($row['vendor_sla']);
|
|||||||
$code = sanitizeInput($row['vendor_code']);
|
$code = sanitizeInput($row['vendor_code']);
|
||||||
$notes = sanitizeInput($row['vendor_notes']);
|
$notes = sanitizeInput($row['vendor_notes']);
|
||||||
|
|
||||||
|
|
||||||
// Generate the HTML form content using output buffering.
|
// Generate the HTML form content using output buffering.
|
||||||
ob_start();
|
ob_start();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="modal-header">
|
<div class="modal-header bg-dark text-white">
|
||||||
<h5 class="modal-title text-white"><i class="fas fa-fw fa-building mr-2"></i><?php echo $vendor_name; ?></h5>
|
<div class="d-flex align-items-center">
|
||||||
|
<i class="fas fa-fw fa-building fa-2x mr-3"></i>
|
||||||
|
<div>
|
||||||
|
<h5 class="modal-title mb-0"><?php echo $name; ?></h5>
|
||||||
|
<div class="text-muted"><?php echo getFallback($description); ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span>×</span>
|
<span>×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body bg-white">
|
|
||||||
<div>Description:</div><?php echo $vendor_description; ?></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-body bg-light">
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Close</button>
|
|
||||||
|
<!-- Vendor Info Card -->
|
||||||
|
<div class="card mb-3 shadow-sm rounded">
|
||||||
|
<div class="card-body">
|
||||||
|
<h6 class="text-secondary"><i class="fas fa-info-circle mr-2"></i>Vendor Details</h6>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div><strong>Account Number:</strong> <?php echo getFallback($account_number); ?></div>
|
||||||
|
<div><strong>Hours:</strong> <?php echo getFallback($hours); ?></div>
|
||||||
|
<div><strong>SLA:</strong> <?php echo getFallback($sla); ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div><strong>Code:</strong> <?php echo getFallback($code); ?></div>
|
||||||
|
<div><strong>Website:</strong> <?php echo !empty($website) ? '<a href="' . $website . '" target="_blank" class="text-primary">' . $website . '</a>' : '<span class="text-muted">Not Available</span>'; ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Contact Info Card -->
|
||||||
|
<div class="card mb-3 shadow-sm rounded">
|
||||||
|
<div class="card-body">
|
||||||
|
<h6 class="text-secondary"><i class="fas fa-user mr-2"></i>Contact Information</h6>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div><strong>Contact Name:</strong> <?php echo getFallback($contact_name); ?></div>
|
||||||
|
<div><strong>Phone:</strong> <?php echo getFallback($phone); ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div><strong>Email:</strong> <?php echo !empty($email) ? '<a href="mailto:' . $email . '" class="text-primary">' . $email . '</a>' : '<span class="text-muted">Not Available</span>'; ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Notes Card -->
|
||||||
|
<div class="card mb-3 shadow-sm rounded">
|
||||||
|
<div class="card-body">
|
||||||
|
<h6 class="text-secondary"><i class="fas fa-sticky-note mr-2"></i>Notes</h6>
|
||||||
|
<div>
|
||||||
|
<?php echo getFallback($notes); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
37
domains.php
37
domains.php
@@ -22,9 +22,13 @@ enforceUserPermission('module_support');
|
|||||||
$url_query_strings_sort = http_build_query($get_copy);
|
$url_query_strings_sort = http_build_query($get_copy);
|
||||||
|
|
||||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS domains.*, clients.*,
|
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS domains.*, clients.*,
|
||||||
|
registrar.vendor_id AS registrar_id,
|
||||||
registrar.vendor_name AS registrar_name,
|
registrar.vendor_name AS registrar_name,
|
||||||
|
dnshost.vendor_id AS dnshost_id,
|
||||||
dnshost.vendor_name AS dnshost_name,
|
dnshost.vendor_name AS dnshost_name,
|
||||||
|
mailhost.vendor_id AS mailhost_id,
|
||||||
mailhost.vendor_name AS mailhost_name,
|
mailhost.vendor_name AS mailhost_name,
|
||||||
|
webhost.vendor_id AS webhost_id,
|
||||||
webhost.vendor_name AS webhost_name
|
webhost.vendor_name AS webhost_name
|
||||||
FROM domains
|
FROM domains
|
||||||
LEFT JOIN clients ON client_id = domain_client_id
|
LEFT JOIN clients ON client_id = domain_client_id
|
||||||
@@ -191,12 +195,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
} else {
|
} else {
|
||||||
$tr_class = '';
|
$tr_class = '';
|
||||||
}
|
}
|
||||||
|
$domain_registrar_id = intval($row['registrar_id']);
|
||||||
|
$domain_webhost_id = intval($row['webhost_id']);
|
||||||
|
$domain_dnshost_id = intval($row['dnshost_id']);
|
||||||
|
$domain_mailhost_id = intval($row['mailhost_id']);
|
||||||
$domain_registrar_name = nullable_htmlentities($row['registrar_name']);
|
$domain_registrar_name = nullable_htmlentities($row['registrar_name']);
|
||||||
if($domain_registrar_name) {
|
|
||||||
$domain_registrar_name_display = $domain_registrar_name;
|
|
||||||
} else {
|
|
||||||
$domain_registrar_name_display = "-";
|
|
||||||
}
|
|
||||||
$domain_webhost_name = nullable_htmlentities($row['webhost_name']);
|
$domain_webhost_name = nullable_htmlentities($row['webhost_name']);
|
||||||
$domain_dnshost_name = nullable_htmlentities($row['dnshost_name']);
|
$domain_dnshost_name = nullable_htmlentities($row['dnshost_name']);
|
||||||
$domain_mailhost_name = nullable_htmlentities($row['mailhost_name']);
|
$domain_mailhost_name = nullable_htmlentities($row['mailhost_name']);
|
||||||
@@ -205,10 +208,26 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$client_id = intval($row['domain_client_id']);
|
$client_id = intval($row['domain_client_id']);
|
||||||
$client_name = nullable_htmlentities($row['client_name']);
|
$client_name = nullable_htmlentities($row['client_name']);
|
||||||
// Add - if empty on the table
|
// Add - if empty on the table
|
||||||
$domain_registrar_name_display = $domain_registrar_name ? $domain_registrar_name : "-";
|
$domain_registrar_name_display = $domain_registrar_name ? "
|
||||||
$domain_webhost_name_display = $domain_webhost_name ? $domain_webhost_name : "-";
|
<a href='#' data-toggle='ajax-modal'
|
||||||
$domain_dnshost_name_display = $domain_dnshost_name ? $domain_dnshost_name : "-";
|
data-ajax-url='ajax/ajax_vendor_details.php' data-ajax-id='$domain_registrar_id'>
|
||||||
$domain_mailhost_name_display = $domain_mailhost_name ? $domain_mailhost_name : "-";
|
$domain_registrar_name
|
||||||
|
</a>" : "-";
|
||||||
|
$domain_webhost_name_display = $domain_webhost_name ? "
|
||||||
|
<a href='#' data-toggle='ajax-modal'
|
||||||
|
data-ajax-url='ajax/ajax_vendor_details.php' data-ajax-id='$domain_webhost_id'>
|
||||||
|
$domain_webhost_name
|
||||||
|
</a>" : "-";
|
||||||
|
$domain_dnshost_name_display = $domain_dnshost_name ? "
|
||||||
|
<a href='#' data-toggle='ajax-modal'
|
||||||
|
data-ajax-url='ajax/ajax_vendor_details.php' data-ajax-id='$domain_dnshost_id'>
|
||||||
|
$domain_dnshost_name
|
||||||
|
</a>" : "-";
|
||||||
|
$domain_mailhost_name_display = $domain_mailhost_name ? "
|
||||||
|
<a href='#' data-toggle='ajax-modal'
|
||||||
|
data-ajax-url='ajax/ajax_vendor_details.php' data-ajax-id='$domain_mailhost_id'>
|
||||||
|
$domain_mailhost_name
|
||||||
|
</a>" : "-";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr class="<?php echo $tr_class; ?>">
|
<tr class="<?php echo $tr_class; ?>">
|
||||||
|
|||||||
@@ -1408,4 +1408,9 @@ function logAuth($status, $details) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mysqli_query($mysqli, "INSERT INTO auth_logs SET auth_log_status = $status, auth_log_details = '$details', auth_log_ip = '$session_ip', auth_log_user_agent = '$session_user_agent', auth_log_user_id = $session_user_id");
|
mysqli_query($mysqli, "INSERT INTO auth_logs SET auth_log_status = $status, auth_log_details = '$details', auth_log_ip = '$session_ip', auth_log_user_agent = '$session_user_agent', auth_log_user_id = $session_user_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function for missing data fallback
|
||||||
|
function getFallback($data) {
|
||||||
|
return !empty($data) ? $data : '<span class="text-muted">N/A</span>';
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user