Index: trunk/wikimania/wmreg/skin/admin_interface.old.php |
— | — | @@ -1,515 +0,0 @@ |
2 | | -<?php |
3 | | -/* Prevent hacking */ |
4 | | -if ( !defined( 'TC_STARTED' ) ) |
5 | | -{ die( 'Hacking Attempt' ); } |
6 | | - |
7 | | -include_once 'includes/language_zh-hant.php'; |
8 | | - |
9 | | -global $myself_url, $register_data, $table_data, $lang_countries, $error_message, $lang_register_form; |
10 | | - |
11 | | -function get_percentage( $number ) { |
12 | | - global $register_data; |
13 | | - if ( $register_data['total_people'] == 0 ) return '0.0%'; |
14 | | - else return number_format( $number / $register_data['total_people'] * 100, 1 ) . '%'; |
15 | | -} |
16 | | -/* Fix XSS */ |
17 | | -$register_data = array_map( 'htmlspecialchars', $register_data ); |
18 | | - |
19 | | -$cloth_sizes = array( NULL, 'XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL' ); |
20 | | - |
21 | | -$parameters = $myself_url . 'index.php?action=admin'; |
22 | | -$parameters2 = $myself_url . 'index.php?action=admin'; |
23 | | -if ( $MY_REQUEST['page'] ) |
24 | | -{ $parameters .= '&page=' . urlencode( $MY_REQUEST['page'] ); } |
25 | | - |
26 | | -if ( $MY_REQUEST['keyword'] ) |
27 | | -{ |
28 | | - $parameters .= '&keyword=' . urlencode( $MY_REQUEST['keyword'] ) . '&filter=' . urlencode( $MY_REQUEST['filter'] ); |
29 | | - $parameters2 .= '&keyword=' . urlencode( $MY_REQUEST['keyword'] ) . '&filter=' . urlencode( $MY_REQUEST['filter'] ); |
30 | | -} |
31 | | -$parameters2 .= '&mode=' . urlencode( $MY_REQUEST['mode'] ); |
32 | | - |
33 | | -?> |
34 | | - <script type="text/javascript" src="jquery-latest.pack.js"><!--//XHTML hack--></script> |
35 | | - <script type="text/javascript"> |
36 | | - <!-- |
37 | | - |
38 | | - $(document).ready(function(){ |
39 | | - for (i = 1; i <= 3; i++) |
40 | | - {if (document.getElementById("item"+i+"_radio").checked == true) {radiocheck(i); } } |
41 | | - |
42 | | - $('#admin_form2').addClass('popup'); |
43 | | - $('#cancel_button').removeClass('hide_item'); |
44 | | - $('#fill_data_col').removeClass('hide_item'); |
45 | | - $('.fill_data_link').removeClass('hide_item'); |
46 | | - |
47 | | - }); |
48 | | - |
49 | | - function confirm_warning() |
50 | | - { |
51 | | - return confirm('注意:一旦勾選接受或退回報名,報名的處理狀態將無法再度在此介面修正。\n並且,在您勾選的同時,會將報名結果寄發信件給報名者。\n請再次確定您的勾選資料是否正確。'); |
52 | | - } |
53 | | - |
54 | | - function warning2() |
55 | | - { |
56 | | - if (document.getElementById("item2_radio").checked == true) |
57 | | - return confirm('注意:\n(1) 請確認該報名者是否有有選擇過參加8/2的議程;如果有的話請確認Hacking Days Extra與Citizen Journalism Unconference的參加有沒有勾選。若沒有勾選,可能需要確認報名者希望參與哪場活動。\n(2) 新加入的勾選住宿者將自動設定為「不在乎」房間類型;而取消住宿者也將取消喜好房間類型的設定,而再次勾選住宿並無法復原其喜好設定。\n\n請再度確定填寫的資料是否正確。是否確定執行?'); |
58 | | - else |
59 | | - return confirm('請再度確定填寫的資料是否正確。是否確定執行?'); |
60 | | - |
61 | | - } |
62 | | - function fill_data(surname, given_name, unique_code, j1, he, cju, j3, j4, j5, n1, n2, n3, n4, n5, n6, tag/* now invaild */, vip_status) |
63 | | - { |
64 | | - |
65 | | - $("#content_part, #admin_form3, #footer").fadeTo('slow', 0.5); |
66 | | - $('#mask').show(); |
67 | | - $("#admin_form2").fadeIn('slow'); |
68 | | - |
69 | | - for (i = 1; i <= 3; i++) |
70 | | - {if (document.getElementById("item"+i+"_radio").checked == true) {radiocheck(i); } } |
71 | | - |
72 | | - $("#surname").val(surname); |
73 | | - $("#given_name").val(given_name); |
74 | | - $("#u_code").val(unique_code); |
75 | | - $("#tag").val(tag); |
76 | | - |
77 | | - if (j1) $("#j1").attr("checked", "checked"); |
78 | | - else $("#j1").removeAttr("checked"); |
79 | | - if (he) $("#he").attr("checked", "checked"); |
80 | | - else $("#he").removeAttr("checked"); |
81 | | - if (eval("cju")) $("#cju").attr("checked", "checked"); |
82 | | - else $("#cju").removeAttr("checked"); |
83 | | - |
84 | | - for (var i=3; i<=5; i++) |
85 | | - { if (eval("j"+i)) $("#j"+i).attr("checked", "checked"); |
86 | | - else $("#j"+i).removeAttr("checked"); |
87 | | - } |
88 | | - for (var i=1; i<=6; i++) |
89 | | - { if (eval("n"+i)) $("#n"+i).attr("checked", "checked"); |
90 | | - else $("#n"+i).removeAttr("checked"); |
91 | | - } |
92 | | - |
93 | | - for (var i=0; i<=3; i++) |
94 | | - { if (vip_status == i) $("#vips"+i).attr("selected", "selected"); |
95 | | - else $("#vips"+i).removeAttr("selected"); |
96 | | - } |
97 | | - } |
98 | | - |
99 | | - function radiocheck(num) |
100 | | - { |
101 | | - for (i = 1; i<= 3; i++) |
102 | | - { |
103 | | - if (i != num) |
104 | | - $("#item"+i).removeClass(); |
105 | | - $("#item"+i+" > p").hide('fast'); |
106 | | - } |
107 | | - $("#item"+num).addClass("checked_item"); |
108 | | - $("#item"+num+" > p").show(); |
109 | | - } |
110 | | - |
111 | | - function close_popup() |
112 | | - { |
113 | | - $('#mask').hide(); |
114 | | - $("#content_part, #admin_form3, #footer").fadeTo('slow', 1); |
115 | | - $("#admin_form2").fadeOut('slow'); |
116 | | - } |
117 | | - //--> |
118 | | - </script> |
119 | | - <div id="mask"> </div> |
120 | | - <div id="content_part"> |
121 | | - <h1>管理介面</h1> |
122 | | - <p id="special_pages">登入為<strong> <?php echo $_SESSION['user_id']?></strong> | <a href="<?php echo $myself_url . 'index.php?action=logout'?>" title="登出並離開管理介面">登出</a></p> |
123 | | - <?php if ( !empty( $error_message ) ) |
124 | | - { |
125 | | - echo '<div id="correction">' . "\n" . $error_message . "\n" . '</div>' . "\n"; |
126 | | - } |
127 | | - ?> |
128 | | -<h3>列表與統計資料</h3> |
129 | | - |
130 | | -<?php if ( $register_data['total_keyword'] ) { ?> |
131 | | -<p>搜尋結果共找到 <strong><?php echo $register_data['total_keyword']?></strong> 筆資料。<a href="<?php echo $myself_url; ?>?action=admin" title="結束搜尋,顯示所有資料">清除搜尋結果</a> |
132 | | -<?php } else { ?> |
133 | | -<p>目前共有 <strong><?php echo $register_data['total_people']; ?> 人</strong>報名,<strong><?php echo $register_data['total_accommodation']; ?> 人</strong>需要安排住宿。</p> |
134 | | -<?php } ?> |
135 | | -<form action="<?php echo $myself_url . 'index.php'; ?>" method="GET"> |
136 | | - <div id="admin_navigation"> |
137 | | - <p id="search_form"> |
138 | | - <select name="filter"> |
139 | | - <option value="name" <?php if ( $MY_REQUEST['filter'] == 'name' ) echo 'selected="selected"'; ?>>姓名、維基帳號</option> |
140 | | - <option value="organization" <?php if ( $MY_REQUEST['filter'] == 'organization' ) echo 'selected="selected"'; ?>>組織</option> |
141 | | - <option value="email" <?php if ( $MY_REQUEST['filter'] == 'email' ) echo 'selected="selected"'; ?>>電子郵件</option> |
142 | | - <option value="unique_code" <?php if ( $MY_REQUEST['filter'] == 'unique_code' ) echo 'selected="selected"'; ?>>識別碼</option> |
143 | | - <option value="tag" <?php if ( $MY_REQUEST['filter'] == 'tag' ) echo 'selected="selected"'; ?>>標籤</option> |
144 | | - </select> |
145 | | - <input type="text" name="keyword" value="<?php echo stripslashes( htmlspecialchars( $MY_REQUEST['keyword'] ) ); ?>" /> |
146 | | - <input type="submit" value="查詢" /> |
147 | | - <input type="hidden" name="action" value="admin" /> |
148 | | - <input type="hidden" name="mode" value="<?php echo htmlspecialchars( $MY_REQUEST['mode'] ); ?>" /> |
149 | | - </p> |
150 | | -<p><a href="<?php echo $parameters?>" title="諸如生日、姓名與身分證資料的資訊">基本資料</a> | <a href="<?php echo $parameters?>&mode=topic" title="參加的日期、偏好的主題、飲食習慣與衣服尺寸">日期、主題、食衣住行</a> | <a href="<?php echo $parameters?>&mode=liveinfo" title="是否須安排住宿,偏好的房間大小">住宿資訊</a> | <a href="<?php echo $parameters?>&mode=visa" title="是否要籌備團隊安排簽證協助,與需求的內容">簽證需求</a> | <a href="<?php echo $parameters?>&mode=pay" title="是否已經付款,付了多少錢">付款狀態</a></p> |
151 | | -</div> |
152 | | -</form> |
153 | | -<p> |
154 | | -<?php |
155 | | -switch( $MY_REQUEST['mode'] ) |
156 | | -{ |
157 | | - case NULL: |
158 | | - echo '共來自 <strong>' . $register_data['total_countries'] . '</strong> 個國家 / ' . |
159 | | - '<strong>' . $register_data['total_male'] . '</strong> 男 (' . get_percentage( $register_data['total_male'] ) . ')/ ' . |
160 | | - '<strong>' . $register_data['total_female'] . '</strong> 女 (' . get_percentage( $register_data['total_female'] ) . ')/ ' . |
161 | | - '<strong>' . $register_data['total_sex_other'] . '</strong> 其他 (' . get_percentage( $register_data['total_sex_other'] ) . ')/ ' . |
162 | | - '<strong>' . $register_data['total_wikimedians'] . '</strong> 維基人 (' . get_percentage( $register_data['total_wikimedians'] ) . ')'; |
163 | | - break; |
164 | | - |
165 | | - case 'topic': |
166 | | - for ( $i = 3; $i <= 5; $i++ ) |
167 | | - echo '8/' . $i . ':<strong>' . $register_data['total_day' . $i] . '</strong> 人 (' . get_percentage( $register_data['total_day' . $i] ) . ') / '; |
168 | | - for ( $i = 1; $i <= 3; $i++ ) |
169 | | - echo '' . $i . ' 天:<strong>' . $register_data['total_' . $i . 'days'] . '</strong> 人 (' . get_percentage( $register_data['total_' . $i . 'days'] ) . ') / '; |
170 | | - break; |
171 | | - |
172 | | - case 'liveinfo': |
173 | | - for ( $i = 1; $i <= 6; $i++ ) |
174 | | - echo $i . ' 天:<strong>' . $register_data['total_' . $i . 'nights'] . '</strong> 人 (' . get_percentage( $register_data['total_' . $i . 'nights'] ) . ') / '; |
175 | | - break; |
176 | | - |
177 | | - case 'visa': |
178 | | - echo '共 <strong>' . $register_data['total_assist'] . '</strong> 人 (' . get_percentage( $register_data['total_assist'] ) . ') 需要簽證協助'; |
179 | | - break; |
180 | | -} |
181 | | -?></p> |
182 | | -<form action="<?php echo $myself_url . 'index.php'; ?>" method="POST" onsubmit="return confirm_warning();"> |
183 | | - <table id="admin_table"> |
184 | | - <tr> |
185 | | - <th>核取</th> |
186 | | - <th>編號</th><th>姓名</th><th>台籍</th> |
187 | | - <th>姓別</th><th>註冊時間</th> |
188 | | - <?php if ( $MY_REQUEST['mode'] ) { ?> |
189 | | - <th>8/1</th> |
190 | | - <th>8/2</th> |
191 | | - <th>HE</th> |
192 | | - <th>CJU</th> |
193 | | - <th>8/3</th> |
194 | | - <th>8/4</th> |
195 | | - <th>8/5</th> |
196 | | - <?php } |
197 | | - switch( $MY_REQUEST['mode'] ) { |
198 | | - case NULL: |
199 | | - echo '<th>ID</th><th>國家</th> |
200 | | - '/*<th>城市</th>*/ . '<th>生日</th><th>母語</th> |
201 | | - <th>語言程度</th> |
202 | | - <th>組織</th><th>維基用戶名</th><th>名稱顯示</th>'; |
203 | | - break; |
204 | | - case 'topic': |
205 | | - echo '<th>T1</th> |
206 | | - <th>T2</th> |
207 | | - <th>T3</th> |
208 | | - <th>衣</th><th>食</th> |
209 | | - <th>過敏</th>'; |
210 | | - break; |
211 | | - case 'liveinfo': |
212 | | - echo '<th>7/31</th> |
213 | | - <th>8/1</th> |
214 | | - <th>8/2</th> |
215 | | - <th>8/3</th> |
216 | | - <th>8/4</th> |
217 | | - <th>8/5</th> |
218 | | - <th>R2</th> |
219 | | - <th>R4</th> |
220 | | - <th>R6</th> |
221 | | - <th>DC</th> |
222 | | - <th>應繳金額</th> |
223 | | -'; |
224 | | - break; |
225 | | - case 'visa': |
226 | | - echo '<th>簽證需求</th><th>需求詳述</th>'; |
227 | | - break; |
228 | | - case 'pay': |
229 | | - echo '<th>Email</th><th>識別碼</th><th>付款方式</th><th>付款狀態</th><!--<th>PayPal OK</th>--><th>應繳金額</th><th>收到金額</th>'; |
230 | | - break; |
231 | | - } ?> |
232 | | - <th>折價券</th> |
233 | | - <th>狀態</th> |
234 | | - <th>標籤</th> |
235 | | - <th id="fill_data_col">編輯資訊</th> |
236 | | - </tr> |
237 | | -<?php foreach ( $table_data as $data ) { |
238 | | -/* I Hate XSS */ |
239 | | -$data = array_map( 'htmlspecialchars', $data ); |
240 | | -?> |
241 | | - <tr> |
242 | | - <td><input type="checkbox" name="no[]" value=<?php echo $data['no']; ?> /></td> |
243 | | - <td><?php echo $data['no']; ?></td> |
244 | | - <td><?php echo $data['given_name'] . ' ' . $data['surname']; ?></td> |
245 | | - <td><?php if ( $data['egy'] ) echo '是'; else echo '否'; ?></td> |
246 | | - <td><?php |
247 | | - switch( $data['sex'] ) |
248 | | - { |
249 | | - case 1: echo '男'; break; |
250 | | - case 2: echo '女'; break; |
251 | | - case 3: echo $data['custom_sex']; break; |
252 | | - } |
253 | | - ?></td><td><?php echo $data['signuptime']; ?></td> |
254 | | - <?php if ( $MY_REQUEST['mode'] ) { ?> |
255 | | - <td class="group1"><?php if ( $data['join1'] ) echo '●'; ?></td> |
256 | | - <td class="group1"><?php if ( $data['join2'] ) echo '●'; ?></td> |
257 | | - <td class="group1"><?php if ( $data['hacking'] ) echo '●'; ?></td> |
258 | | - <td class="group1"><?php if ( $data['citizen'] ) echo '●'; ?></td> |
259 | | - <td class="group1"><?php if ( $data['join3'] ) echo '●'; ?></td> |
260 | | - <td class="group1"><?php if ( $data['join4'] ) echo '●'; ?></td> |
261 | | - <td class="group1"><?php if ( $data['join5'] ) echo '●'; ?></td> |
262 | | - <?php |
263 | | - } |
264 | | - switch( $MY_REQUEST['mode'] ) { |
265 | | - case "": |
266 | | - echo '<td>' . $data['id'] . '</td><td>' . $lang_countries[strtolower( $data['country'] )] . '</td> |
267 | | - <td>'/*.$data['city'].'</td><td>'*/ . $data['birthday'] . '</td><td>' . $data['langn'] . '</td> |
268 | | - <td>'; |
269 | | - if ( $data['lang1'] ) |
270 | | - echo $data['lang1'] . '-' . $data['lang1-level'] . '<br />'; |
271 | | - if ( $data['lang2'] ) |
272 | | - echo $data['lang2'] . '-' . $data['lang2-level'] . '<br />'; |
273 | | - if ( $data['lang3'] ) |
274 | | - echo $data['lang3'] . '-' . $data['lang3-level'] . '<br />'; |
275 | | - echo '</td><td>'; |
276 | | - echo $data['organization']; |
277 | | - echo '</td><td>'; |
278 | | - if ( $data['wiki_id'] ) echo $data['wiki_id'] . '@' . $data['wiki_language'] . '.' . $data['wiki_project']; |
279 | | - echo '</td><td>'; |
280 | | - |
281 | | - foreach ( explode( ',', $data['showname'] ) as $key => $value ) |
282 | | - { |
283 | | - echo $lang_register_form['showname' . $value]; |
284 | | - if ( $value == 4 ) |
285 | | - { echo ': ' . $data['custom_showname']; } |
286 | | - else |
287 | | - { echo ', '; } |
288 | | - } |
289 | | - echo '</td>'; |
290 | | - break; |
291 | | - case "topic":?> |
292 | | - <td class="group2"><?php if ( $data['topic1'] ) echo '●'; ?></td> |
293 | | - <td class="group2"><?php if ( $data['topic2'] ) echo '●'; ?></td> |
294 | | - <td class="group2"><?php if ( $data['topic3'] ) echo '●'; ?></td> |
295 | | - <?php echo |
296 | | - '<td>' . $cloth_sizes[$data['size']] . '</td> |
297 | | - <td>'; |
298 | | - foreach ( explode( ',', $data['food'] ) as $key => $value ) |
299 | | - { |
300 | | - echo $lang_register_form['food' . $value]; |
301 | | - if ( $value == 6 ) |
302 | | - { echo ': ' . $data['food_other']; } |
303 | | - else |
304 | | - { echo ', '; } |
305 | | - } |
306 | | - echo '</td><td>' . $data['allegric'] . '</td>'; |
307 | | - break; |
308 | | - case "liveinfo": |
309 | | - echo '<td class="group2">'; |
310 | | - if ( $data['night1'] && $data['room_num1'] ) echo $data['room_num1']; elseif ( $data['night1'] ) echo '●'; |
311 | | - echo '</td><td class="group2">'; |
312 | | - if ( $data['night2'] && $data['room_num2'] ) echo $data['room_num2']; elseif ( $data['night2'] ) echo '●'; |
313 | | - echo '</td><td class="group2">'; |
314 | | - if ( $data['night3'] && $data['room_num3'] ) echo $data['room_num3']; elseif ( $data['night3'] ) echo '●'; |
315 | | - echo '</td><td class="group2">'; |
316 | | - if ( $data['night4'] && $data['room_num4'] ) echo $data['room_num4']; elseif ( $data['night4'] ) echo '●'; |
317 | | - echo '</td><td class="group2">'; |
318 | | - if ( $data['night5'] && $data['room_num5'] ) echo $data['room_num5']; elseif ( $data['night5'] ) echo '●'; |
319 | | - echo '</td><td class="group2">'; |
320 | | - if ( $data['night6'] && $data['room_num6'] ) echo $data['room_num6']; elseif ( $data['night6'] ) echo '●'; |
321 | | - echo '</td><td class="group3">'; |
322 | | - if ( $data['room2'] ) echo '●'; |
323 | | - echo '</td><td class="group3">'; |
324 | | - if ( $data['room4'] ) echo '●'; |
325 | | - echo '</td><td class="group3">'; |
326 | | - if ( $data['room6'] ) echo '●'; |
327 | | - echo '</td><td class="group3">'; |
328 | | - if ( $data['room8'] ) echo '●'; |
329 | | - echo '</td>'; |
330 | | - echo '<td>' . $data['cost_total'] . '</td>'; |
331 | | - break; |
332 | | - case 'visa': |
333 | | - echo '<td>'; |
334 | | - if ( $data['visa_assistance'] ) echo '是'; else echo '否'; |
335 | | - echo '</td> |
336 | | - <td>' . $data['visa_assistance_description'] . '</td>'; |
337 | | - break; |
338 | | - case 'pay': |
339 | | - echo '<td>' . $data['email'] . '</td>'; |
340 | | - echo '<td>' . $data['unique_code'] . '</td><td>'; |
341 | | - if ( $data['pay_method'] == 1 ) echo 'PayPal'; else echo '匯款'; |
342 | | - echo '</td><td>'; |
343 | | - if ( $data['cost_total'] > $data['cost_paid'] ) echo '不足'; |
344 | | - if ( $data['cost_total'] == 0 ) echo '免費'; |
345 | | - elseif ( $data['cost_total'] == $data['cost_paid'] ) echo '剛好付清'; |
346 | | - if ( $data['cost_total'] < $data['cost_paid'] ) echo '超過'; |
347 | | - // echo '</td><td>'; |
348 | | - // if ($data['paypal'] == 1) echo '完成'; else echo '未完成'; |
349 | | - echo '</td><td>' . $data['cost_total']; |
350 | | - echo '</td><td>' . $data['cost_paid'] . '</td>'; |
351 | | - |
352 | | - } |
353 | | - echo '<td>'; |
354 | | - switch ( $data['vip_status'] ) |
355 | | - { |
356 | | - case 1: echo '完全免費'; break; |
357 | | - case 2: echo '一律維基人價'; break; |
358 | | - case 3: echo '只有住宿費'; break; |
359 | | - } |
360 | | - echo '</td>'; |
361 | | - echo '<td>'; |
362 | | - switch ( $data['status'] ) |
363 | | - { |
364 | | - case 0: echo '未受理'; break; |
365 | | - case 1: echo '已接受'; break; |
366 | | - case 2: echo '已拒絕'; break; |
367 | | - } |
368 | | - echo '</td><td>' . $data['tag'] . '</td><td>'; |
369 | | - echo '<a href="#" class="fill_data_link" onclick="fill_data(\'' . addslashes( $data['surname'] ) . '\',\'' . addslashes( $data['given_name'] ) . '\',\'' . $data['unique_code'] . '\',' . $data['join1'] . ',' . $data['hacking'] . ',' . $data['citizen'] . ',' . $data['join3'] . ',' . $data['join4'] . ',' . $data['join5'] . ',' . $data['night1'] . ',' . $data['night2'] . ',' . $data['night3'] . ',' . $data['night4'] . ',' . $data['night5'] . ',' . $data['night6'] . ',\'' . addslashes( $data['tag'] ) . '\',' . $data['vip_status'] . ')">編輯</a>'; |
370 | | - echo '</td>'; |
371 | | - ?> |
372 | | - </tr> |
373 | | -<?php } ?> |
374 | | - </table> |
375 | | - <p id="page"> |
376 | | - <?php |
377 | | - if ( $MY_REQUEST['keyword'] ) |
378 | | - { $total_page = ceil( $register_data['total_keyword'] / $register_data['per_page'] ); } |
379 | | - else |
380 | | - { $total_page = ceil( $register_data['total_people'] / $register_data['per_page'] ); } |
381 | | - |
382 | | - if ( $register_data['page'] >= 5 ) |
383 | | - { echo '<a href="' . $parameters2 . '&page=1" title="第 1 頁">1</a> '; } |
384 | | - if ( $register_data['page'] >= 6 ) |
385 | | - { echo '... '; } |
386 | | - for ( $i = max( 1, $register_data['page'] - 3 ); ( $i < $register_data['page'] ); $i++ ) |
387 | | - { |
388 | | - echo '<a href="' . $parameters2 . '&page=' . ( $i ) . '" title="第 ' . ( $i ) . ' 頁">' . ( $i ) . '</a> '; |
389 | | - } |
390 | | - echo '<strong>' . $register_data['page'] . '</strong> '; |
391 | | - |
392 | | - for ( $i = $register_data['page'] + 1; ( $i <= $total_page && $i <= $register_data['page'] + 3 ); $i++ ) |
393 | | - { |
394 | | - echo '<a href="' . $parameters2 . '&page=' . ( $i ) . '" title="第 ' . ( $i ) . ' 頁">' . ( $i ) . '</a> '; |
395 | | - } |
396 | | - if ( $total_page - $register_data['page'] >= 5 ) |
397 | | - { echo '... '; } |
398 | | - |
399 | | - if ( $total_page - $register_data['page'] >= 4 ) |
400 | | - { echo '<a href="' . $parameters2 . '&page=' . $total_page . '" title="第 ' . $total_page . ' 頁">' . $total_page . '</a> '; } |
401 | | - ?> |
402 | | - </p> |
403 | | - |
404 | | - <div id="admin_form1"> |
405 | | - <p> |
406 | | - 所核取的報名者: |
407 | | - <input type="hidden" name="modification" value="change_status" /> |
408 | | - <input type="radio" name="status" value="1" id="accept" checked="checked" /><label for="accept"> 接受報名</label> |
409 | | - <input type="radio" name="status" value="2" id="reject" /><label for="reject"> 退回報名</label> |
410 | | - <input type="hidden" name="action" value="admin" /> |
411 | | - <input type="hidden" name="mode" value="<?php echo htmlspecialchars( $MY_REQUEST['mode'] ); ?>" /> |
412 | | - <input type="hidden" name="keyword" value="<?php echo htmlspecialchars( $MY_REQUEST['keyword'] ); ?>" /> |
413 | | - <input type="hidden" name="page" value="<?php echo htmlspecialchars( $MY_REQUEST['page'] ); ?>" /> |
414 | | - <input type="submit" value="確認" /> (接受報名只對已付完全款者有效) |
415 | | - </p> </div> |
416 | | - </form> |
417 | | - </div> |
418 | | - <form action="<?php echo $myself_url; ?>index.php" method="POST" onsubmit="return warning2();"> |
419 | | - <div id="admin_form2"> |
420 | | - <h3>調整項目</h3> |
421 | | - <p>名:<input type="text" name="given_name" id="given_name" /> |
422 | | - 姓:<input type="text" name="surname" id="surname" /> |
423 | | - 識別碼:<input type="text" name="unique_code" size="6" id="u_code" /> |
424 | | - </p> |
425 | | - <div id="item1" class="checked_item"> |
426 | | - <input type="radio" name="item" value="1" checked="checked" id="item1_radio" onclick="radiocheck(1);" /><label for="item1_radio">收到付款登記</label> |
427 | | - <p>收到金額:<input type="text" name="cost_paid" value="<?php if ( $MY_REQUEST['cost_paid'] != 0 ) echo htmlspecialchars( $MY_REQUEST['cost_paid'] ); ?>" size="5" /> |
428 | | - <input type="hidden" name="modification" value="add_paid" /> |
429 | | - <input type="hidden" name="action" value="admin" /> |
430 | | - <input type="hidden" name="mode" value="<?php echo htmlspecialchars( $MY_REQUEST['mode'] ); ?>" /> |
431 | | - <input type="hidden" name="keyword" value="<?php echo htmlspecialchars( $MY_REQUEST['keyword'] ); ?>" /> |
432 | | - <input type="hidden" name="filter" value="<?php echo htmlspecialchars( $MY_REQUEST['filter'] ); ?>" /> |
433 | | - <input type="hidden" name="page" value="<?php echo htmlspecialchars( $MY_REQUEST['page'] ); ?>" /> |
434 | | - |
435 | | - (若輸入錯誤,可設定為負值以調整) |
436 | | - </p> |
437 | | - </div> |
438 | | - <div id="item2"> |
439 | | - <input type="radio" name="item" value="2" id="item2_radio" onclick="radiocheck(2);" /><label for="item2_radio">日期與住宿資訊</label> |
440 | | - <p> |
441 | | - 參加日期: |
442 | | - <?php if ( $MY_REQUEST['j'] ) |
443 | | - { echo ' <input type="checkbox" value="1" name="j1" id="j1" checked="checked" />'; } |
444 | | - else |
445 | | - { echo ' <input type="checkbox" value="1" name="j1" id="j1" />'; } |
446 | | - echo '<label for="j1">' . $lang_register_form['join1'] . '</label>' . "\n"; |
447 | | - |
448 | | - // echo $lang_register_form['join2']; ?> |
449 | | - <input type="checkbox" name="he" value="1" id="he"<?php if ( $MY_REQUEST['he'] ) echo ' checked="checked"'; ?> /> <label for="he">Hacking Days Extra</label> |
450 | | - <input type="checkbox" name="cju" value="1" id="cju"<?php if ( $MY_REQUEST['cju'] ) echo ' checked="checked"'; ?> /> <label for="cju">Citizen Journalism Unconference</label> |
451 | | - </p><p style="margin-left: 6em;"> |
452 | | -<?php |
453 | | -for ( $i = 3; $i <= 5; $i++ ) |
454 | | -{ |
455 | | - if ( $MY_REQUEST['j' . $i] ) |
456 | | - { echo ' <input type="checkbox" value="1" name="j' . $i . '" id="j' . $i . '" checked="checked" />'; } |
457 | | - else |
458 | | - { echo ' <input type="checkbox" value="1" name="j' . $i . '" id="j' . $i . '" />'; } |
459 | | - echo '<label for="j' . $i . '">' . $lang_register_form['join' . $i] . '</label>'; |
460 | | - |
461 | | - echo "\n"; |
462 | | - |
463 | | -} |
464 | | -?> |
465 | | - </p> |
466 | | - |
467 | | - <p> |
468 | | -住宿: |
469 | | - <?php |
470 | | -for ( $i = 1; $i <= 6; $i++ ) |
471 | | -{ |
472 | | - if ( $MY_REQUEST['n' . $i] ) |
473 | | - { echo ' <input type="checkbox" value="1" name="n' . $i . '" id="n' . $i . '" checked="checked" />'; } |
474 | | - else |
475 | | - { echo ' <input type="checkbox" value="1" name="n' . $i . '" id="n' . $i . '" />'; } |
476 | | - echo '<label for="n' . $i . '">' . $lang_register_form['night' . $i] . '</label>'; |
477 | | - |
478 | | - echo "\n"; |
479 | | - |
480 | | -} |
481 | | -?> |
482 | | - |
483 | | - </p> |
484 | | - </div> |
485 | | - <div id="item3"> |
486 | | - <input type="radio" name="item" value="3" id="item3_radio" onclick="radiocheck(3);" /><label for="item3_radio">編輯標籤與特殊身分</label> |
487 | | - <p><label for="tag">標籤:</label><input type="text" name="tag" id="tag" /> |
488 | | - <label for="vip_status">特殊費用計算:</label><select name="vip_status" id="vip_status"> |
489 | | - <option value="0" id="vips0">不做特殊費用</option> |
490 | | - <option value="1" id="vips1">完全免費</option> |
491 | | - <option value="2" id="vips2">一律維基人價</option> |
492 | | - <option value="3" id="vips3">只有住宿費</option> |
493 | | - </select></p> |
494 | | - </div> |
495 | | - <p><input type="submit" value="確認" /><input type="button" value="取消" id="cancel_button" class="hide_item" onclick="close_popup()" /></p></div> |
496 | | - </form> |
497 | | - <div id="admin_form3"> |
498 | | - <form enctype="multipart/form-data" action="<?php echo $myself_url; ?>index.php" method="POST"> |
499 | | - <h3>資料上傳</h3> |
500 | | - <p>上傳住宿資料: |
501 | | - <input type="file" name="accommodation_file"> |
502 | | - <input type="hidden" name="modification" value="set_data" /> |
503 | | - <input type="hidden" name="action" value="admin" /> |
504 | | - <input type="submit" value="上傳" /> |
505 | | - </p> |
506 | | - </form> |
507 | | - |
508 | | - <form action="<?php echo $myself_url; ?>index.php" method="POST"> |
509 | | - <h3>下載資料</h3> |
510 | | - <p> |
511 | | - <input type="hidden" name="modification" value="get_data" /> |
512 | | - <input type="hidden" name="action" value="admin" /> |
513 | | - <input type="submit" value="下載住宿資料庫" /> 格式為Tab分隔,UTF16-LE編碼的檔案,可匯入Micorosft Excel處理,處理完後存成Tab分隔檔案上傳即可。 |
514 | | - </p> |
515 | | - </form> |
516 | | - </div> |
Index: trunk/wikimania/wmreg/recaptchalib.php |
— | — | @@ -45,17 +45,15 @@ |
46 | 46 | * @return string - encoded request |
47 | 47 | */ |
48 | 48 | function _recaptcha_qsencode ( $data ) { |
49 | | - $req = ""; |
50 | | - foreach ( $data as $key => $value ) |
51 | | - $req .= $key . '=' . urlencode( stripslashes( $value ) ) . '&'; |
| 49 | + $req = ""; |
| 50 | + foreach ( $data as $key => $value ) |
| 51 | + $req .= $key . '=' . urlencode( stripslashes( $value ) ) . '&'; |
52 | 52 | |
53 | | - // Cut the last '&' |
54 | | - $req = substr( $req, 0, strlen( $req ) -1 ); |
55 | | - return $req; |
| 53 | + // Cut the last '&' |
| 54 | + $req = substr( $req, 0, strlen( $req ) -1 ); |
| 55 | + return $req; |
56 | 56 | } |
57 | 57 | |
58 | | - |
59 | | - |
60 | 58 | /** |
61 | 59 | * Submits an HTTP POST to a reCAPTCHA server |
62 | 60 | * @param string $host |
— | — | @@ -66,33 +64,31 @@ |
67 | 65 | */ |
68 | 66 | function _recaptcha_http_post( $host, $path, $data, $port = 80 ) { |
69 | 67 | |
70 | | - $req = _recaptcha_qsencode ( $data ); |
| 68 | + $req = _recaptcha_qsencode ( $data ); |
71 | 69 | |
72 | | - $http_request = "POST $path HTTP/1.0\r\n"; |
73 | | - $http_request .= "Host: $host\r\n"; |
74 | | - $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; |
75 | | - $http_request .= "Content-Length: " . strlen( $req ) . "\r\n"; |
76 | | - $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; |
77 | | - $http_request .= "\r\n"; |
78 | | - $http_request .= $req; |
| 70 | + $http_request = "POST $path HTTP/1.0\r\n"; |
| 71 | + $http_request .= "Host: $host\r\n"; |
| 72 | + $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; |
| 73 | + $http_request .= "Content-Length: " . strlen( $req ) . "\r\n"; |
| 74 | + $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; |
| 75 | + $http_request .= "\r\n"; |
| 76 | + $http_request .= $req; |
79 | 77 | |
80 | | - $response = ''; |
81 | | - if ( false == ( $fs = @fsockopen( $host, $port, $errno, $errstr, 40 ) ) ) { |
82 | | - die ( 'Could not open socket' ); |
83 | | - } |
| 78 | + $response = ''; |
| 79 | + if ( false == ( $fs = @fsockopen( $host, $port, $errno, $errstr, 40 ) ) ) { |
| 80 | + die ( 'Could not open socket' ); |
| 81 | + } |
84 | 82 | |
85 | | - fwrite( $fs, $http_request ); |
| 83 | + fwrite( $fs, $http_request ); |
86 | 84 | |
87 | | - while ( !feof( $fs ) ) |
88 | | - $response .= fgets( $fs, 1160 ); // One TCP-IP packet |
89 | | - fclose( $fs ); |
90 | | - $response = explode( "\r\n\r\n", $response, 2 ); |
| 85 | + while ( !feof( $fs ) ) |
| 86 | + $response .= fgets( $fs, 1160 ); // One TCP-IP packet |
| 87 | + fclose( $fs ); |
| 88 | + $response = explode( "\r\n\r\n", $response, 2 ); |
91 | 89 | |
92 | | - return $response; |
| 90 | + return $response; |
93 | 91 | } |
94 | 92 | |
95 | | - |
96 | | - |
97 | 93 | /** |
98 | 94 | * Gets the challenge HTML (javascript and non-javascript version). |
99 | 95 | * This is called from the browser, and the resulting reCAPTCHA HTML widget |
— | — | @@ -132,8 +128,8 @@ |
133 | 129 | * A ReCaptchaResponse is returned from recaptcha_check_answer() |
134 | 130 | */ |
135 | 131 | class ReCaptchaResponse { |
136 | | - var $is_valid; |
137 | | - var $error; |
| 132 | + var $is_valid; |
| 133 | + var $error; |
138 | 134 | } |
139 | 135 | |
140 | 136 | /** |
Index: trunk/wikimania/wmreg/index.php |
— | — | @@ -835,7 +835,7 @@ |
836 | 836 | function administration() |
837 | 837 | { |
838 | 838 | global $_SESSION, $sql, $register_data, $MY_REQUEST, $table_data, $error_array, |
839 | | - $error_message, $lang_countries, $lang_register_form; |
| 839 | + $error_message, $lang_countries, $lang_register_form, $myself_url; |
840 | 840 | |
841 | 841 | /* check for login. If not, show login form */ |
842 | 842 | if ( !$_SESSION['logged_in'] ) |
— | — | @@ -1344,7 +1344,7 @@ |
1345 | 1345 | |
1346 | 1346 | function process_login() |
1347 | 1347 | { |
1348 | | - global $_POST, $sql, $error_message, $register_data; |
| 1348 | + global $_POST, $sql, $error_message, $register_data, $myself_url; |
1349 | 1349 | |
1350 | 1350 | $error_message = ''; |
1351 | 1351 | |
— | — | @@ -1388,6 +1388,7 @@ |
1389 | 1389 | unset( $_SESSION['user_id'] ); |
1390 | 1390 | unset( $_SESSION['user_password'] ); |
1391 | 1391 | |
| 1392 | + global $myself_url; |
1392 | 1393 | header( 'Location:' . $myself_url . 'index.php' ); |
1393 | 1394 | |
1394 | 1395 | } |