Fix Client portal index.php, removed unused vars and functions, fix code indentation and syntax

This commit is contained in:
johnnyq
2022-03-28 17:03:38 -04:00
parent f7252f24e8
commit 1b0d3474a7
2 changed files with 77 additions and 90 deletions
+1
View File
@@ -39,6 +39,7 @@ $contact = mysqli_fetch_array($contact_sql);
$session_contact_name = $contact['contact_name'];
$session_contact_initials = initials($session_contact_name);
$session_contact_email = $contact['contact_email'];
$session_contact_photo = $contact['contact_photo'];
// Get client info
$client_sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_id = '$session_client_id'");
+27 -41
View File
@@ -4,10 +4,6 @@
* Landing / Home page for the client portal
*/
$row = mysqli_fetch_array($sql);
$contact_photo = $row['contact_photo'];
$contact_id = $row['contact_id'];
require_once("inc_portal.php");
// Ticket status from GET
@@ -48,16 +44,14 @@ $total_tickets = $row['total_tickets'];
<table>
<tr>
<th class="text-center">
<a class="text-dark" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">
<?php if(!empty($contact_photo)){ ?>
<img src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>" alt="..." class="rounded-left">
>
<?php if(!empty($session_contact_photo)){ ?>
<img src="<?php echo "../uploads/clients/$session_company_id/$session_client_id/$session_contact_photo"; ?>" alt="..." class=" img-size-50 img-circle">
<?php }else{ ?>
<span class="fa-stack fa-2x rounded-left">
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
<span class="fa fa-stack-1x text-white"><?php echo $session_contact_initials; ?></span>
</span>
<br>
@@ -65,19 +59,15 @@ $total_tickets = $row['total_tickets'];
<div class="text-dark"><?php echo $contact_name; ?></div>
<div><?php echo $contact_title_display; ?></div>
<div><?php echo $primary_contact_display; ?></div>
</a>
</th>
<th>
<div class="">
<h4 class="">Welcome, <b><?php echo $session_contact_name ?></b>! </h4>
<div class="">
<h4 class="">Welcome, <b><?php echo $session_contact_name ?></b>!</h4>
<hr>
</div>
</th>
</div>
</th>
</tr>
</table>
</table>
<br>
@@ -86,9 +76,8 @@ $total_tickets = $row['total_tickets'];
<div class="col-10">
<div class="card">
<span class="border border-secondary">
<table class="table">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Subject</th>
@@ -107,40 +96,37 @@ $total_tickets = $row['total_tickets'];
}
?>
</tbody>
</table></span>
</div>
</div>
</table>
</span>
</div>
</div>
<div class="col-2">
<div class="card">
<a href="ticket_add.php" class="btn btn-primary">New ticket</a>
</div>
<hr>
<a href="?status=Open"><div class="card text-white bg-danger mb-3" style="max-width: 18rem;">
<a href="?status=Open">
<div class="card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header">My Open tickets | <b><?php echo $total_tickets_open ?></b></div>
</div></a>
</div>
</a>
<a href="?status=Closed"><div class="card text-white bg-success mb-3" style="max-width: 18rem;">
<a href="?status=Closed">
<div class="card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header">Resolved tickets | <b><?php echo $total_tickets_closed ?></b></div>
</div></a>
</div>
</a>
<a href="?status=%"><div class="card text-white bg-secondary mb-3" style="max-width: 18rem;">
<a href="?status=%">
<div class="card text-white bg-secondary mb-3" style="max-width: 18rem;">
<div class="card-header">All my tickets | <b><?php echo $total_tickets ?></b></div>
</div></a>
</div>
</a>
</div>
</div>
<?php include("portal_footer.php"); ?>