OSDN Git Service

cbdd398c2133a6dc351db257fe72d2f5074c61c4
[hengband/web.git] / score / custom_search.php
1 <?php
2 //ini_set('display_errors', 'On');
3
4 ini_set('log_errors', 'On');
5 ini_set('error_log', 'errors/'.pathinfo(__FILE__, PATHINFO_FILENAME).'.log');
6
7 ini_set('zlib.output_compression', 'On');
8
9 require_once "db_common.inc";
10 require_once "web_template.inc";
11
12 $db = new ScoreDb();
13 $defines = $db->get_defines();
14
15 function print_select_form($fp, $id_defines, $form_name)
16 {
17     fwrite($fp, "<select name='{$form_name}'>\n");
18     fwrite($fp, "<option value='0' selected>すべて</option>\n");
19     foreach ($id_defines as $num => $name) {
20         if ($num > 0 && strpos($name, '不明') !== 0) {
21             fwrite($fp, "<option value='{$num}'>{$name}</option>\n");
22         }
23     }
24     fwrite($fp, "</select>\n");
25 }
26
27
28 $wt = new WebTemplate();
29 $wt->set_title("変愚蛮怒 スコア カスタム検索");
30 $fp = $wt->main_contents_fp();
31
32 fwrite(
33     $fp,
34     <<<EOM
35 <h2>変愚蛮怒 スコア カスタム検索</h2>
36 <form action="score_ranking.php" method="GET">
37 <p>
38
39 EOM
40 );
41
42 fwrite($fp, "<label for=\"race_id\">種族:</label>");
43 print_select_form($fp, $defines['race'], 'race_id');
44 fwrite($fp, " <label for=\"class_id\">職業:</label>");
45 print_select_form($fp, $defines['class'], 'class_id');
46 fwrite($fp, " <label for=\"personality_id\">性格:</label>");
47 print_select_form($fp, $defines['personality'], 'personality_id');
48
49 fwrite($fp, "</p>\n");
50
51 fwrite($fp, "<p>\n");
52 fwrite($fp, "<label for=\"realm1_id\">領域1:</label>");
53 print_select_form($fp, $defines['realm'], 'realm_id1');
54 fwrite($fp, " <label for=\"realm2_id\">領域2:</label>");
55 print_select_form($fp, $defines['realm'], 'realm_id2');
56 fwrite($fp, "</p>\n");
57
58 fwrite(
59     $fp,
60     <<<EOM
61 <p>
62 <label for="name">キャラクター名:</label>
63 <input type="text" name="name">
64 <label for="name_match_strict">
65 <input type="radio" name="name_match" value="strict" id="name_match_strict" checked="checked">完全一致
66 </label>
67 <label for="name_match_partial">
68 <input type="radio" name="name_match" value="partial" id="name_match_partial">部分一致
69 </label>
70 </p>
71 <p>
72 <label for="sex">性別:</label>
73 <select name="sex" id="sex">
74 <option value="">すべて</option>
75 <option value="1">男性</option>
76 <option value="0">女性</option>
77 </select>
78 </p>
79 <p>
80 <label for="name">死因:</label>
81 <input type="text" name="killer" placeholder="死因を入力(例:デスソード)">※部分一致のみ、「勝利の後引退」は'ripe'、「勝利の後切腹」は'Seppuku'と入力
82 </p>
83 <p>
84 <label for="sort">ソート順:</label>
85 <select name="sort" id="sort">
86 <option value="socre">スコア順</option>
87 <option value="newcome">新着順</option>
88 </select>
89 </p>
90 <p>
91 <input type="submit" value="検索"></input>
92 </p>
93 </form>
94 EOM
95            );
96
97 $wt->print_page();