【发布时间】:2016-08-01 23:24:32
【问题描述】:
我必须为我学校的学生服务教师预约系统。到目前为止,我已经为教师和学生制作了一个登录系统和一个注册系统。现在我正在制作预订系统。
我的 PHPMyAdmin 数据库中的约会表如下所示:
id (int 11, A.I)
ss_name (int 11) (this is the teacher name, also in the teacher table)
slot_date (date)
client_student_id (int 11) (student id, also in students table)
slot_line (the line in school timetable for appointment to be made)
reason (varhar)
status (varchar)
我的问题是我需要能够输入学生 ID 号、教师姓名,并且能够转到该特定教师的下一页。
这是我的 PHP 代码:
<?php
ob_start();
session_start();
require_once 'dbconnect.php';
if( !isset($_SESSION['client']) ) {
header("Location: homepage_login.php");
exit;
}
// select loggedin users detail
$res=mysql_query("SELECT * FROM clients WHERE client_id=".$_SESSION['client']);
$userRow=mysql_fetch_array($res);
if( isset($_POST['btn-nxt-page']) ) {
$client_student_id = $_POST['client_student_id'];
$ss_name = $_POST['ss_name'];
$client_student_id = strip_tags(trim($client_student_id));
$ss_name = strip_tags(trim($ss_name));
$pass = ($client_student_id);
$res=mysql_query("SELECT client_student_id, ss_name FROM appointments WHERE client_student_id='$client_student_id'");
$row=mysql_fetch_array($res);
$count = mysql_num_rows($res); // if uname/pass correct it returns must be 1 row
if( $count == 1 && $row['client_student_id']==$pass ) {
$_SESSION['client'] = $row['ss_name'];
header("Location: homepage_loggedin_book2.php");
} else {
$errMSG = "Wrong Credentials, Try again...";
}
}
?>
这是我的 HTML 代码:
<div class="form-group">
<div class="input-group">
<input type="text" name="client_student_id" class="form-control" placeholder="Enter your Student ID" required />
</div>
</div>
<br>
<br>
<label for="ss" id="menu">Select a teacher</label>
<select name="ss_name" id="#menu">
<option>John</option>
<option>Smith</option>
<option>Greg</option>
<option>Jess</option>
</select>
<br>
<br>
<div class="form-group">
<button type="submit" class="btn btn-block btn-primary" name="btn-nxt-page">Next Page</button>
</div>
</div>
</div>
我的主要问题是:
如何获得按钮以重定向到具有预订系统的另一个页面,该页面针对在我的 HTML 代码中选择的特定教师??
【问题讨论】:
-
“为了我的学校项目” - 你需要为自己的分数而努力,而不是我们。这是家庭作业。从来没有人做过我的作业,我从来没想过他们也不会。
-
你说得对,但她只是在寻求帮助。这是一个具体的问题,她不是在问整个项目的解决方案..
标签: php mysql appointment