本文整理汇总了PHP中Student::getMajor方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getMajor方法的具体用法?PHP Student::getMajor怎么用?PHP Student::getMajor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::getMajor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
echo "<label for='info'>";
echo "Advisor: ", $oldAdvisorName, "<br>";
// Display advisor office for individual advisor
if (isset($oldAdvisorOffice)) {
echo "Office: ", $oldAdvisorOffice, "<br>";
}
echo "Appointment: ", date('l, F d, Y g:i A', $oldDatephp), "<br>";
// Display meeting location
echo "Meeting Location: ", $appt->getMeeting(), "</label><br>";
// Hidden input for old appointment ID
echo "<input type='hidden' name='oldAppID' value='{$oldApptID}'>";
}
$currentAdvisorID = $_POST["advisor"];
$currentDatephp = strtotime($_POST["appTime"]);
// Get appointment information for current appointment, even if it's taken
$appointments = Appointment::searchAppointments($COMMON, $currentAdvisorID, $student->getMajor(), $_POST["appTime"], null, false, 1, '');
$currentAppt = $appointments[0];
$currentApptID = $currentAppt->getID();
if ($currentAdvisorID != 0) {
// Individual advisor, so get info from database
$currentAdvisor = new Advisor($COMMON, $currentAdvisorID);
$currentAdvisorName = $currentAdvisor->convertFullName();
$currentAdvisorOffice = $currentAdvisor->getOffice();
} else {
// Group advising appointment
$currentAdvisorName = "Group";
}
echo "<h2>Current Appointment</h2>";
echo "<label for='newinfo'>";
echo "Advisor: ", $currentAdvisorName, "<br>";
// Display office for individual advisor
示例2: Student
<meta charset="UTF-8" />
<title>Search for Appointment</title>
<link rel='stylesheet' type='text/css' href='../css/standard.css'/>
</head>
<body>
<div id="login">
<div id="form">
<div class="top">
<h1>Search Results</h1>
<h3>Showing open appointments only</h3>
<div class="field">
<p>Showing results for: </p>
<?php
// Get student data from database
$student = new Student($COMMON, $_SESSION["studID"]);
$major = $student->getMajor();
$date = $_POST["date"];
$times = $_POST["time"];
$advisor = $_POST["advisor"];
$results = array();
if ($date == '') {
echo "Date: All";
} else {
echo "Date: ", $date;
$date = date('Y-m-d', strtotime($date));
}
echo "<br>";
if (empty($times)) {
echo "Time: All";
} else {
$i = 0;
示例3: time
</head>
<body>
<div id="login">
<div id="form">
<div class="top">
<h1>Select Appointment Time</h1>
<div class="field">
<form action = "10StudConfirmSch.php" method = "post" name = "SelectTime">
<?php
// Hidden form field for advisor ID
echo "<input type='hidden' name='advisor' value='{$localAdvisor}'>";
// http://php.net/manual/en/function.time.php fpr SQL statements below
// Comparing timestamps, could not remember.
$curtime = time();
// Search for open appointments with given advisor, student's major, and that are in the future
$appointments = Appointment::searchAppointments($COMMON, $localAdvisor, $student->getMajor());
// Display title
if ($localAdvisor != 0) {
echo "<h2>Individual Advising</h2><br>";
echo "<label for='prompt'>Select appointment with ", $advisor->convertFullName(), ":</label><br>";
} else {
echo "<h2>Group Advising</h2><br>";
echo "<label for='prompt'>Select appointment:</label><br>";
}
// Display all appointment options on screen
foreach ($appointments as $appt) {
$datephp = strtotime($appt->getTime());
echo "<label for='", $appt->getID(), "'>";
echo "<input id='", $appt->getID(), "' type='radio' name='appTime' required value='", $appt->getTime(), "'>", date('l, F d, Y g:i A', $datephp), "</label><br>\n";
}
?>
示例4:
echo $student->getStudentId();
?>
>
</div>
<div class="field">
<label for="email">E-mail</label>
<input id="email" size="30" maxlength="255" type="email" name="email" required value=<?php
echo $student->getEmail();
?>
>
</div>
<div class="field">
<label for="major">Major</label>
<select id="major" name = "major">
<option <?php
if ($student->getMajor() == 'CMPE') {
echo "selected";
}
?>
>Computer Engineering</option>
<option <?php
if ($student->getMajor() == 'CMSC') {
echo "selected";
}
?>
>Computer Science</option>
<option <?php
if ($student->getMajor() == 'MENG') {
echo "selected";
}
?>