本文整理汇总了PHP中Checkout::getPerson方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::getPerson方法的具体用法?PHP Checkout::getPerson怎么用?PHP Checkout::getPerson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::getPerson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGearTypes
//for usercake
if (!securePage(htmlspecialchars($_SERVER['PHP_SELF']))) {
die;
}
require_once 'models/Checkout.php';
require_once 'models/funcs.php';
$types = getGearTypes();
//define variables and set to empty values
$co_start = $co_end = $title = $description = $location = $dr_number = "";
//get initial checkout info
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$co_id = test_input($_GET['co_id']);
$co = new Checkout();
$co->retrieveCheckout($co_id);
//user does not have permission to edit this checkout
if (!$loggedInUser->checkPermission(array(2)) && $loggedInUser->user_id != $co->getPerson()) {
header("Location: checkout.php?co_id=" . $co_id);
}
$co_start = $co->getStart();
$co_end = $co->getEnd();
$co_start = new DateTime($co_start);
$co_end = new DateTime($co_end);
//error message handling from step 1 submission
if (!empty($_GET['errors'])) {
$errorCode = test_input($_GET['errors']);
if ($errorCode == "dates_order") {
$errors[] = "The start date/time is after the end date/time";
} elseif ($errorCode == "dates_same") {
$errors[] = "The start and end date/times are the same";
}
}
示例2: getPersonName
?>
<br /><br />
<div class="panel panel-default">
<div class="panel-heading text-center">Checkout Details</div>
<div class="panel-body text-center">
<p>
<?php
printf("<strong>Checkout ID:</strong> %s<br /><br />", $checkout->getID());
printf("<strong>Description:</strong> %s<br /><br />", $checkout->getDescription());
if (!empty($checkout->getDRNumber())) {
echo "<strong>DR:</strong> " . $checkout->getDRNumber() . "<br /><br />";
}
if (!empty($checkout->getLocation())) {
echo "<strong>Location:</strong> " . $checkout->getLocation() . "<br /><br />";
}
$personName = getPersonName($checkout->getPerson());
printf("<strong>Person:</strong> %s<br /><br />", $personName);
$co_start = new DateTime($checkout->getStart());
$co_end = new DateTime($checkout->getEnd());
printf("<strong>Start Time:</strong> %s<br /><br />", $co_start->format('m-d-y g:iA'));
printf("<strong>End Time:</strong> %s<br /><br />", $co_end->format('m-d-y g:iA'));
if ($checkout->getReturned()) {
$retDate = new DateTime($checkout->getReturned());
echo "<strong>Returned:</strong> " . $retDate->format('m-d-y g:iA') . "<br /><br />";
}
if ($loggedInUser->checkPermission(array(2)) || $loggedInUser->user_id == $checkout->getPerson()) {
echo "<form id='retForm' role='form' action='" . htmlspecialchars($_SERVER["PHP_SELF"]) . "' method='POST'>";
echo "<input type='hidden' name='co_id' value='" . $co_id . "' />";
echo "<input id='now' type='hidden' name='dateTime' />";
//fill with JS on button click
echo "</form>";
示例3: foreach
</tr>
</thead>
<tbody>
<?php
foreach ($gearList as $gear) {
$gearObject = new Gear();
$gearObject->fetch($gear['gear_id']);
printf("<tr>");
printf("<td><a href='gear-item.php?gear_id=%s'>%s</a></td>", $gear['gear_id'], $gear['name']);
echo "<td>" . $gearObject->status(date('Y-m-d h:m:s')) . "</td>";
$co_id = $gearObject->lastCheckoutID();
//fetchLastCheckout($gear['gear_id']);
if (!empty($co_id)) {
$co = new Checkout();
$co->retrieveCheckout($co_id);
printf("<td><a href='checkout.php?co_id=%s'>%s</a></td>", $co_id, getPersonName($co->getPerson()));
} else {
//no last checkout
printf("<td>n/a</td>");
}
printf("<td class='text-center'>%s</td>", $gearObject->getQty());
//$gear['qty']
printf("</tr>");
}
?>
</tbody>
</table>
<?php
}
}
//foreach