本文整理匯總了PHP中Appointment::setById方法的典型用法代碼示例。如果您正苦於以下問題:PHP Appointment::setById方法的具體用法?PHP Appointment::setById怎麽用?PHP Appointment::setById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Appointment
的用法示例。
在下文中一共展示了Appointment::setById方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Appointment
<?php
include './modules/wrappers/header-customer-required.php';
?>
<div class="infoBox">
<h2>Choose a Bid</h2>
<?php
if (isset($_GET['bid'])) {
$bidId = $_GET['bid'];
$user->selectBid($bidId);
echo "<p><strong>Bid has been accepted.</strong></p><p>This mechanic will now assist you with your service on the day of your appointment.\n\t\t\t\t\t\t\tYou will be required to pay for the full amount of your services prior to the appointment.</p>";
} else {
if (isset($_GET['job'])) {
$appointmentId = $_GET['job'];
$appointment = new Appointment();
$appointment->setById($appointmentId);
?>
<p>Here are the bids that have currently been placed on your <strong><?php
echo $appointment->getStartTime('g:i a') . " " . $appointment->service->name;
?>
</strong> on <strong><?php
echo $appointment->getStartTime('F d, Y');
?>
</strong>.
Choose one of these bids to select the mechanic as your service provider.</p>
<p><strong>Current Bids</strong></p>
<?php
$bids = $appointment->getBids();
echo "<table border='1' class='result_table'><tr><th>Username</th><th>Bid Amount</th><th>Bid Date</th><th> </th></tr>";
if ($bids != null) {
foreach ($bids as $bid) {
示例2: Appointment
} else {
echo "<p><strong>Your bid failed.</strong></p><p>Please contact one of the site administrators if you think there is a problem.</p>";
}
} else {
$error = true;
$errorMessage = "You must submit a valid number for the amount.";
}
}
if (isset($_GET['job']) || isset($_POST['submitted']) && $error == true) {
?>
<p>You have selected to place a bid on the following appointment:</p>
<?php
$appointment = new Appointment();
$appointment->setById($_GET['job']);
echo "<table><tr><td><strong>Service Type:</strong></td><td>" . $appointment->service->name . "</td></tr>";
echo "<tr><td><strong>Start time:</strong></td><td>" . $appointment->getStartTime('g:i a - F d, Y') . "</td></tr>";
echo "<tr><td><strong>End time:</strong></td><td>" . $appointment->getEndTime('g:i a - F d, Y') . "</td></tr></table>";
echo "<strong>Bidding History</strong>";
$bids = $appointment->getBids();
echo "<table border='1' class='result_table'><tr><th>Username</th><th>Bid Amount</th><th>Bid Date</th></tr>";
if ($bids != null) {
foreach ($bids as $bid) {
echo "<tr><td>" . $bid->username . "</td><td>" . $bid->amount . "</td><td>" . $bid->date . "</td></tr>";
}
} else {
echo "<tr><td colspan=3 style='padding:20px;'>No bids have been placed on this appointment.</td></tr>";
}
echo "</table>";
?>