本文整理汇总了PHP中Staff::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::Load方法的具体用法?PHP Staff::Load怎么用?PHP Staff::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetStaff
public static function GetStaff()
{
if (!self::Is_Set("sid") || !self::Is_Set("secret")) {
return null;
}
return Staff::Load(self::GetStaffID());
}
示例2: elseif
<div class="form-group">
<label for="type">Account Type</label>
<select class="form-control" id="type" name="type">
<?php
for ($i = TYPE_FIRST; $i <= TYPE_LAST; $i++) {
echo "<option value=\"" . $i . "\">" . Staff::GetTypeReal($i) . "</option>";
}
?>
</select>
</div>
<button type="submit" name="add" class="btn btn-default">Create Account</button>
</form>
<?php
} elseif (isset($_GET["id"])) {
$staff = Staff::Load($_GET["id"]);
if ($staff->IsValid() && $staff->IsActive() && $me->GetType() == TYPE_SUPERSTAFF) {
if (isset($_POST["edit"])) {
$password = $_POST["password"];
$password_confirm = $_POST["password_confirm"];
$name = $_POST["name"];
$building = $_POST["building"];
$email = CleanString($_POST["email"]);
$phone_number = CleanString($_POST["phone_number"]);
$type = $_POST["type"];
if (empty($name) || empty($building) || empty($email) || empty($phone_number)) {
ShowError("One or more fields were empty!");
} elseif ($password != $password_confirm) {
ShowError("Passwords did not match! Go back and try again.");
} elseif (!Building::Exists($building) && $building !== "N/A") {
ShowError("Invalid building.");
示例3: COUNT
/*
Query
*/
$statement = $database->prepare("SELECT COUNT(*) FROM tickets");
$statement->execute();
$totalNumRows = $statement->fetch(PDO::FETCH_NUM);
$statement = $database->prepare("SELECT SQL_CALC_FOUND_ROWS " . implode(",", $aColumns) . " FROM tickets " . $sWhere . " " . $sOrder . " " . $sLimit);
$statement->execute();
$statement2 = $database->prepare("SELECT FOUND_ROWS()");
$statement2->execute();
$filteredNumRows = $statement2->fetch(PDO::FETCH_NUM);
$rows = $statement->fetchAll(PDO::FETCH_ASSOC);
$rowCount = count($rows);
for ($i = 0; $i < $rowCount; $i++) {
$row = $rows[$i];
$color = "";
if ($q == -1) {
$color = " danger";
$rows[$i] = array($row["id"], Client::Load($row["cid"])->GetUsername(), DisplayDatetime($row["creation_date"]), DisplayLimited($row["description"]));
} else {
$sid = $row["sid"];
$status = $row["status"];
if ($sid == $me->GetID()) {
$color = " " . ($status == STATUS_OPENED ? "danger" : "success");
}
$rows[$i] = array($row["id"], $status == STATUS_OPENED ? "Opened" : "Closed", Client::Load($row["cid"])->GetUsername(), DisplayDatetime($row["creation_date"]), DisplayLimited($row["description"]), implode(", ", json_decode($row["tags"], true)), Staff::Load($sid)->GetUsername(), DisplayDatetime($row["closed_date"]));
}
$rows[$i]["DT_RowClass"] = "linkrow" . $color;
}
$output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $totalNumRows[0], "iTotalDisplayRecords" => $filteredNumRows[0], "aaData" => $rows);
echo json_encode($output);
示例4: DisplayDatetime
</div>
</div>
<?php
$updates = $ticket->GetUpdates();
if (!is_null($updates)) {
?>
<div class="row">
<div class="col-lg-12">
<?php
for ($i = 0; $i < count($updates); $i++) {
$update = $updates[$i];
$id = $update["id"];
$time = $update["time"];
$description = $update["description"];
$update_staff = Staff::Load($id);
?>
<div class="panel panel-default">
<div class="panel-heading">
Update #<?php
echo $i + 1;
?>
- <?php
echo $update_staff->GetUsername();
?>
- <?php
echo DisplayDatetime($time);
?>
</div>
<div class="panel-body">
<?php