-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
259 lines (216 loc) · 9.05 KB
/
Copy pathsearch.php
File metadata and controls
259 lines (216 loc) · 9.05 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?php
include 'src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId' => 'XXXXXXXXXXXXXXXXXX',
'secret' => 'XXXXXXXXXXXXXXXXXX',
));
// Get User ID
$user = $facebook->getUser();
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
$user_checkin = $facebook->api('/me/locations');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
// Login or logout url will be needed depending on current user state.
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$statusUrl = $facebook->getLoginStatusUrl();
$loginUrl = $facebook->getLoginUrl(array("scope" => "user_photos,user_friends,friends_about_me"));
}
// This call will always work since we are fetching public data.
//$naitik = $facebook->api('/naitik');
?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="http://arwen.cs.nccu.edu.tw/~stanley10603/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="http://arwen.cs.nccu.edu.tw/~stanley10603/css/final.css" rel="stylesheet" media="screen">
<title>搜尋 - 揪球友</title>
<style>
body {
font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
}
h1 a {
text-decoration: none;
color: #3b5998;
}
h1 a:hover {
text-decoration: underline;
}
</style>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script language="JavaScript">
function setHidValue()
{
// test 是否已寫入hidden
alert('uid: ' + $("#userID").val());
alert('uname: ' + $("#userNAME").val());
}
</script>
</head>
<body>
<div id='blackBar'> <!--所有頁面頂端的bar-->
<div align='center'>
<a id="title" href="index.html">回首頁</a>
</div>
</div>
<div id='substance' class="content_font">
<h1>揪球友</h1>
<?php if ($user): ?>
<a href="<?php echo $logoutUrl; ?>">Logout</a>
<?php else: ?>
<div>
Login using OAuth 2.0 handled by the PHP SDK:
<a href="<?php echo $loginUrl; ?>">Login with Facebook</a>
</div>
<?php endif ?>
<!--
<h3>PHP Session</h3>
<pre><?php print_r($_SESSION); ?></pre>
-->
<!-- User&Friend information -->
<?php if ($user): ?>
<table cellpadding="10 border="0">
<tbody>
<tr>
<td>
<center>
<b>
User Picture
</b>
</center>
<div style="border:0px solid #999; overflow:auto;">
<img src="https://graph.facebook.com/<?php echo $user; ?>/picture?type=large">
</div>
</td>
<td>
<center>
<b>
User Information
</b>
</center>
<div style="border:0px solid #999; overflow:auto;">
<pre><?php echo "User id: " . $user_profile['id']; ?></pre>
<pre><?php echo "User Name: " . $user_profile['name']; ?></pre>
<pre><?php echo "User link: " . $user_profile['link']; ?></pre>
</div>
</td>
</tr>
</tbody>
</table>
<!-- User's friends -->
<?php
$allfriend = $facebook->api(array(
'method' => 'fql.query',
'query' => 'SELECT uid1, uid2 FROM friend WHERE uid1==me()'));
?>
<br><br>
<form name='newUser' method='POST' action='searchResult.php'>
<!-- 選擇球類 複選 checkbox -->
選擇球類(可複選)
<table width='600px' border='0'>
<tbody>
<tr>
<td>
<input type="checkbox" name="ball[]" value="PingPong" align='center'>
<img width='60' height='60' src="img/PingPong.png" alt="乒乓球" align='center'>
</td>
<td>
<input type="checkbox" name="ball[]" value="Basketball" align='center'>
<img width='60' height='60' src="img/Basketball.png" alt="籃球" align='center'>
</td>
<td>
<input type="checkbox" name="ball[]" value="Tennis" align='center'>
<img width='60' height='60' src="img/Tennis.png" alt="網球" align='center'>
</td>
<td>
<input type="checkbox" name="ball[]" value="Volley" align='center'>
<img width='60' height='60' src="img/Volley.png" alt="排球" align='center'>
</td>
</tr>
</tbody>
</table>
<br><br>
<!-- 選擇地區 下拉式選單 -->
選擇地區
<select name='place'>
<option value="1">北部</option>
<option value="2">中部</option>
<option value="3">南部</option>
<option value="4">東部</option>
</select>
<br><br>
<!-- 選擇時段 複選 checkbox -->
選擇時段(可複選)
<div class="table-responsive">
<table cellpadding="20" border="2" class="table">
<tbody>
<tr>
<td></td>
<td>星期一</td>
<td>星期二</td>
<td>星期三</td>
<td>星期四</td>
<td>星期五</td>
<td>星期六</td>
<td>星期日</td>
</tr>
<tr>
<td>上午</td>
<td><input type="checkbox" name="timeslot[]" value="1" id="timeslot1"></td>
<td><input type="checkbox" name="timeslot[]" value="2" id="timeslot2"></td>
<td><input type="checkbox" name="timeslot[]" value="3" id="timeslot3"></td>
<td><input type="checkbox" name="timeslot[]" value="4" id="timeslot4"></td>
<td><input type="checkbox" name="timeslot[]" value="5" id="timeslot5"></td>
<td><input type="checkbox" name="timeslot[]" value="6" id="timeslot6"></td>
<td><input type="checkbox" name="timeslot[]" value="7" id="timeslot7"></td>
</tr>
<tr>
<td>下午</td>
<td><input type="checkbox" name="timeslot[]" value="8" id="timeslot8"></td>
<td><input type="checkbox" name="timeslot[]" value="9" id="timeslot9"></td>
<td><input type="checkbox" name="timeslot[]" value="10" id="timeslot10"></td>
<td><input type="checkbox" name="timeslot[]" value="11" id="timeslot11"></td>
<td><input type="checkbox" name="timeslot[]" value="12" id="timeslot12"></td>
<td><input type="checkbox" name="timeslot[]" value="13" id="timeslot13"></td>
<td><input type="checkbox" name="timeslot[]" value="14" id="timeslot14"></td>
</tr>
<tr>
<td>晚上</td>
<td><input type="checkbox" name="timeslot[]" value="15" id="timeslot15"></td>
<td><input type="checkbox" name="timeslot[]" value="16" id="timeslot16"></td>
<td><input type="checkbox" name="timeslot[]" value="17" id="timeslot17"></td>
<td><input type="checkbox" name="timeslot[]" value="18" id="timeslot18"></td>
<td><input type="checkbox" name="timeslot[]" value="19" id="timeslot19"></td>
<td><input type="checkbox" name="timeslot[]" value="20" id="timeslot20"></td>
<td><input type="checkbox" name="timeslot[]" value="21" id="timeslot21"></td>
</tr>
</tbody>
</table>
</div>
<br><br>
<?php echo "<input type='hidden' id='userID' name='userID' value='" . $user_profile['id'] . "'>"; ?>
<?php echo "<input type='hidden' id='userNAME' name='userNAME' value='" . $user_profile['name'] . "'>"; ?>
<input type="submit" name="sendBtn" id="sendBtn" class="btn btn-default btn-lg" value="開始揪球友" />
</form>
<!-- <pre><?php print_r($allfriend); ?></pre> -->
<?php else: ?>
<strong><em><br>You are not Connected.</em></strong>
<?php endif ?>
<!--
<h3>Public profile of Naitik</h3>
<img src="https://graph.facebook.com/naitik/picture">
<?php echo $naitik['name']; ?>
-->
</div>
</body>
</html>