mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Portal - allow adding contacts
This commit is contained in:
@@ -16,57 +16,63 @@ if ($session_contact_primary == 0 && !$session_contact_is_technical_contact) {
|
||||
$contacts_sql = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_email, contact_primary, contact_technical, contact_billing FROM contacts WHERE contact_client_id = $session_client_id AND contacts.contact_archived_at IS NULL ORDER BY contact_created_at");
|
||||
?>
|
||||
|
||||
<h3>Contacts</h3>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<h3>Contacts</h3>
|
||||
<div class="col offset-7">
|
||||
<a href="contact_add.php" class="btn btn-primary" role="button"><i class="fas fa-plus mr-2"></i>New Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
<div class="row">
|
||||
|
||||
<table class="table tabled-bordered border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Roles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($contacts_sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_primary = intval($row['contact_primary']);
|
||||
$contact_technical = intval($row['contact_technical']);
|
||||
$contact_billing = intval($row['contact_billing']);
|
||||
|
||||
$contact_roles_display = '-';
|
||||
if ($contact_primary) {
|
||||
$contact_roles_display = 'Primary contact';
|
||||
} else if ($contact_technical && $contact_billing) {
|
||||
$contact_roles_display = 'Technical & Billing';
|
||||
} else if ($contact_technical) {
|
||||
$contact_roles_display = 'Technical';
|
||||
} else if ($contact_billing) {
|
||||
$contact_roles_display = 'Billing';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="col-md-10">
|
||||
|
||||
<table class="table tabled-bordered border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<td><a href="contact_edit.php?id=<?php echo $contact_id?>"><?php echo $contact_name ?></a></td>
|
||||
<td><?php echo $contact_email; ?></td>
|
||||
<td><?php echo $contact_roles_display ?></td>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Roles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($contacts_sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_primary = intval($row['contact_primary']);
|
||||
$contact_technical = intval($row['contact_technical']);
|
||||
$contact_billing = intval($row['contact_billing']);
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
$contact_roles_display = '-';
|
||||
if ($contact_primary) {
|
||||
$contact_roles_display = 'Primary contact';
|
||||
} else if ($contact_technical && $contact_billing) {
|
||||
$contact_roles_display = 'Technical & Billing';
|
||||
} else if ($contact_technical) {
|
||||
$contact_roles_display = 'Technical';
|
||||
} else if ($contact_billing) {
|
||||
$contact_roles_display = 'Billing';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="contact_edit.php?id=<?php echo $contact_id?>"><?php echo $contact_name ?></a></td>
|
||||
<td><?php echo $contact_email; ?></td>
|
||||
<td><?php echo $contact_roles_display ?></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once "portal_footer.php";
|
||||
|
||||
Reference in New Issue
Block a user