mirror of https://github.com/itflow-org/itflow
parent
aafb6a677f
commit
8f3cb64158
118
portal/index.php
118
portal/index.php
|
|
@ -4,6 +4,10 @@
|
|||
* 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
|
||||
|
|
@ -23,26 +27,70 @@ if (!isset($_GET['status'])) {
|
|||
}
|
||||
|
||||
$contact_tickets = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN contacts ON ticket_contact_id = contact_id WHERE $ticket_status_snippet AND ticket_contact_id = '$session_contact_id' AND ticket_client_id = '$session_client_id' ORDER BY ticket_id DESC");
|
||||
?>
|
||||
|
||||
<h2>Welcome, <?php echo $session_contact_name ?>, to the <?php echo $config_app_name ?> client portal.</h2>
|
||||
<br>
|
||||
<h2>My tickets</h2>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<form method="get">
|
||||
<label>Ticket Status</label>
|
||||
<select class="form-control" name="status" onchange="this.form.submit()">
|
||||
<option value="%" <?php if($status == "%"){echo "selected";}?> >Any</option>
|
||||
<option value="Open" <?php if($status == "Open"){echo "selected";}?> >Open</option>
|
||||
<option value="Closed" <?php if($status == "Closed"){echo "selected";}?> >Closed</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
//Get Total tickets closed
|
||||
$sql_total_tickets_closed = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS total_tickets_closed FROM tickets WHERE ticket_status = 'Closed' AND ticket_client_id = $session_client_id AND ticket_contact_id = $session_contact_id");
|
||||
$row = mysqli_fetch_array($sql_total_tickets_closed);
|
||||
$total_tickets_closed = $row['total_tickets_closed'];
|
||||
|
||||
//Get Total tickets open
|
||||
$sql_total_tickets_open = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS total_tickets_open FROM tickets WHERE ticket_status != 'Closed' AND ticket_client_id = $session_client_id AND ticket_contact_id = $session_contact_id");
|
||||
$row = mysqli_fetch_array($sql_total_tickets_open);
|
||||
$total_tickets_open = $row['total_tickets_open'];
|
||||
|
||||
//Get Total tickets
|
||||
$sql_total_tickets = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS total_tickets FROM tickets WHERE ticket_client_id = $session_client_id AND ticket_contact_id = $session_contact_id");
|
||||
$row = mysqli_fetch_array($sql_total_tickets);
|
||||
$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 }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>
|
||||
<br>
|
||||
|
||||
<?php } ?>
|
||||
<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>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-10">
|
||||
<div class="card">
|
||||
<span class="border border-secondary">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<thead class="thead-dark">
|
||||
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Subject</th>
|
||||
<th scope="col">Status</th>
|
||||
</tr>
|
||||
|
|
@ -52,13 +100,47 @@ $contact_tickets = mysqli_query($mysqli, "SELECT * FROM tickets LEFT JOIN contac
|
|||
<?php
|
||||
while($ticket = mysqli_fetch_array($contact_tickets)){
|
||||
echo "<tr>";
|
||||
echo "<td> <a href='ticket.php?id=$ticket[ticket_id]'> $ticket[ticket_number]</a></td>";
|
||||
echo "<td> <a href='ticket.php?id=$ticket[ticket_id]'> $ticket[ticket_subject]</a></td>";
|
||||
echo "<td>$ticket[ticket_status]</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("portal_footer.php"); ?>
|
||||
|
||||
<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;">
|
||||
<div class="card-header">My Open tickets | <b><?php echo $total_tickets_open ?></b></div>
|
||||
</div></a>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php include("portal_footer.php"); ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue