本文整理汇总了PHP中Staff::GetAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::GetAll方法的具体用法?PHP Staff::GetAll怎么用?PHP Staff::GetAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::GetAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<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&staff&id=" . $staff->GetID() . "&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>";
示例2: strlen
<?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);