當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Appointment::createAppointment方法代碼示例

本文整理匯總了PHP中Appointment::createAppointment方法的典型用法代碼示例。如果您正苦於以下問題:PHP Appointment::createAppointment方法的具體用法?PHP Appointment::createAppointment怎麽用?PHP Appointment::createAppointment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Appointment的用法示例。


在下文中一共展示了Appointment::createAppointment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

if (!empty($majors)) {
    $majorPrint = "";
    foreach ($majors as $m) {
        $majorDB .= $m . " ";
        $majorPrint .= $m . ", ";
    }
    $majorPrint = substr($majorPrint, 0, -2);
}
//get advisor id
$id = $_SESSION['UserID'];
//make sure app doesn't exist
//insert new app to DB
//print app
foreach ($datetimes as $dt) {
    // Attempt to create appointment
    $created = Appointment::createAppointment($COMMON, $dt, 0, $majorDB, $studentLimit, $location);
    echo date('l, F d, Y g:i A', strtotime($dt)), "<br>Location: ", $location, "<br>Majors included: ", $majorPrint;
    echo "<br>Number of seats: {$studentLimit}";
    if (!$created) {
        // Appointment already exists
        echo "<br><span style='color:red'>!!</span>";
    }
    echo "<br><br>";
}
?>
        <br>
        <form method="link" action="AdminUI.php">
          <input type="submit" name="next" class="button large go" value="Return to Home">
        </form>
      </div>
      <div class="bottom">
開發者ID:jb-aero,項目名稱:Project2,代碼行數:31,代碼來源:AdminConfirmScheGroupApp.php

示例2: substr

        $majorDB .= $m . " ";
        $majorPrint .= $m . ", ";
    }
    $majorPrint = substr($majorPrint, 0, -2);
}
//get advisor id
$id = $_SESSION['UserID'];
$adv = new Advisor($COMMON, $id);
$advID = $adv->getID();
$location = $adv->getMeeting();
//make sure app doesn't exist
//insert new app to DB
//print app
foreach ($datetimes as $dt) {
    // Attempt to create appointment
    $created = Appointment::createAppointment($COMMON, $dt, $advID, $majorDB, 1, $location);
    echo date('l, F d, Y g:i A', strtotime($dt)), "<br>Advisor: ", $adv->getFirstName(), " ", $adv->getLastName(), "<br>Location: ", $location, " <br> Majors: ", $majorPrint;
    if (!$created) {
        // Appointment already exists
        echo "<br><span style='color:red'>!!</span>";
    }
    echo "<br><br>";
}
?>
		<br>
		<form method="link" action="AdminUI.php">
			<input type="submit" name="next" class="button large go" value="Return to Home">
		</form>
	</div>
	<div class="bottom">
		<p><span style="color:red">!!</span> indicates that this appointment already exists. A repeat appointment was not made.</p>
開發者ID:jb-aero,項目名稱:Project2,代碼行數:31,代碼來源:AdminConfirmScheIndApp.php


注:本文中的Appointment::createAppointment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。