Exemple #1
0
		<table class="table table-bordered table-striped table-hover">
			<thead>
				<tr>
					<th>#</th>
					<th>Full Name</th>
					<th>Account Type</th>
					<th>Username</th>
					<th>Building</th>
					<th>Email</th>
					<th>Phone Number</th>
					<th>Action</th>
				</tr>
			</thead>
			<tbody class="searchable">
				<?php 
        foreach (Staff::GetAll() as $staff) {
            if (!$staff->IsActive()) {
                continue;
            }
            echo "<tr>";
            echo "<td>" . $staff->GetID() . "</td>";
            echo "<td>" . $staff->GetName() . "</td>";
            echo "<td>" . Staff::GetTypeReal($staff->GetType()) . "</td>";
            echo "<td>" . $staff->GetUsername() . "</td>";
            echo "<td>" . $staff->GetBuilding() . "</td>";
            echo "<td><a href=\"mailto:" . $staff->GetEmail() . "\">" . $staff->GetEmail() . "</a></td>";
            echo "<td>" . $staff->GetPhoneNumber() . "</td>";
            echo "<td>";
            echo "<a class=\"btn btn-default btn-sm\" href=\"index.php?p=admin&amp;staff&amp;id=" . $staff->GetID() . "&amp;edit\" title=\"Edit Account\"><span class=\"glyphicon glyphicon-pencil\"></span></a> ";
            echo "<a class=\"btn btn-default btn-sm staff_delete\" href=\"#confirm_delete\" data-id=\"" . $staff->GetID() . "\" data-toggle=\"modal\" title=\"Delete Account\"><span class=\"glyphicon glyphicon-trash\"></span></a>";
            echo "</td>";
Exemple #2
0
<?php

$staffs = Staff::GetAll();
$correct = null;
foreach ($staffs as $staff) {
    if ($staff->IsValid()) {
        $phoneNumber = $staff->GetPhoneNumber();
        $phoneNumber = preg_replace('/[^0-9]/', '', $phoneNumber);
        if (strlen($phoneNumber) === 10) {
            $phoneNumber = "1" . $phoneNumber;
        }
        $phoneNumber = "+" . $phoneNumber;
        if ($phoneNumber === $_REQUEST['From']) {
            $correct = $staff;
            break;
        }
    }
}
if ($correct === null) {
    exit;
}
$lastTicket = Ticket::GetByStaffIDOrderSingle($staff->GetID(), "last_modified_date", "DESC");
if (!$lastTicket->IsValid()) {
    exit;
}
$client = Client::Load($lastTicket->GetClientID());
if (!$client->IsValid()) {
    exit;
}
$body = "Client Information\nID: " . $client->GetUsername() . "\nName: " . $client->GetName() . "\nCommunity: " . Building::GetCommunity($client->GetBuilding()) . "\nBuilding: " . $client->GetBuilding() . "\nRoom: " . $client->GetLocation();
$remaining = 255 - strlen($body);