forked from Microsheep/2015-NCTU_find_roommate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
77 lines (74 loc) · 2.59 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
include_once("./header.php");
?>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
交大新生找室友
<small>搜出你可愛的室友 ~</small>
</h1>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h4>我的室友在哪裡?</h4>
</div>
<div class="panel-body">
<form name="search_name" action="search_result_name.php" method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="_name">以姓名查詢 (模糊搜尋)</label>
<input type="text" class="form-control" name="post_name" id="_name" placeholder="EX: 王小名 老王"><br>
<div class="alert alert-danger" role="alert" id="A_name" style="display:none">
姓名不可以為空!
</div>
</div>
</div>
<div class="col-md-6">
<br>
<input class="btn btn-primary" type="button" value="姓名搜尋" onClick="check_name()">
</div>
</div><br>
</form>
<form name="search_ID" action="search_result_ID.php" method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="_ID">以學號查詢 (模糊搜尋)</label>
<input type="text" class="form-control" name="post_ID" id="_ID" placeholder="EX: 0123456"><br>
<div class="alert alert-danger" role="alert" id="A_ID" style="display:none">
學號搜尋不可以小於四位數!
</div>
</div>
</div>
<div class="col-md-6">
<br>
<input class="btn btn-primary" type="button" value="學號搜尋" onClick="check_ID()">
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
function check_ID(){
if(document.getElementById("_ID").value.length>3) {
search_ID.submit();
}
else{
document.getElementById("A_ID").style.display="";
}
}
function check_name(){
if(document.getElementById("_name").value!="") {
search_name.submit();
}
else{
document.getElementById("A_name").style.display="";
}
}
</script>
<script src=./asset/no_enter.js></script>
<?php
include_once("./footer.php");
?>