-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
154 lines (133 loc) · 6.73 KB
/
search.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="./img/logo.svg">
<title>こづみーる</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/example.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" integrity="sha384-3AB7yXWz4OeoZcPbieVW64vVXEwADiYyAEhwilzWsLw+9FgqpyjjStpPnpBO8o8S" crossorigin="anonymous">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="./">
<img src="./img/logo.svg" width="30" height="30" class="d-inline-block align-top mr-1" alt="こづみーる">
こづみーる
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<section class="section section-default">
<div class="container">
<h2>店舗検索</h2>
<div class="bs-component">
<form name="search" action="search.html" method="GET">
<fieldset>
<div class="form-group">
<label for="area">フリーワード・市町区村名を入力</label>
<input type="text" class="form-control" name="area" id="area" placeholder="フリーワードを入力">
</div>
<div class="form-group">
<label for="option">オプション</label>
<div class="form-check">
<label class="form-check-label"></label>
<input type="checkbox" value="true" name="is_ok_baby" id="is_ok_baby">乳児OK
<input type="checkbox" value="true" name="is_ok_infant" id="is_ok_infant">幼児OK
<input type="checkbox" value="true" name="is_no_smoking" id="is_no_smoking">禁煙・分煙
<input type="checkbox" value="true" name="is_ok_baby_car" id="is_ok_baby_car">ベビーカーOK
<input type="checkbox" value="true" name="is_zashiki" id="is_zashiki">子上がり・座敷
<input type="checkbox" value="true" name="is_private_room" id="is_private_room">個室
<input type="checkbox" value="true" name="is_parking_area" id="is_parking_area">駐車場有り
<input type="checkbox" value="true" name="is_luggage_storage" id="is_luggage_storage">荷物置き(席の近くに)
<input type="checkbox" value="true" name="is_nap_space" id="is_nap_space">お昼寝スペース
<input type="checkbox" value="true" name="is_baby_bed" id="is_baby_bed">ベビーベッド・おむつ交換台
<input type="checkbox" value="true" name="is_kids_menu" id="is_kids_menu">お子様メニュー
<input type="checkbox" value="true" name="is_kids_chair" id="is_kids_chair">お子様用椅子
<input type="checkbox" value="true" name="is_kids_dish" id="is_kids_dish">お子様用食器
<input type="checkbox" value="true" name="is_kids_toilet" id="is_kids_toilet">お子様用トイレ
<input type="checkbox" value="true" name="is_kids_toy" id="is_kids_toy">お子様用本・おもちゃ
<input type="checkbox" value="true" name="is_ok_baby_food" id="is_ok_baby_food">離乳食持ち込みOK
<input type="checkbox" value="true" name="is_nursing_room" id="is_nursing_room">授乳室・スペース
<input type="checkbox" value="true" name="is_kids_room" id="is_kids_room">キッズルーム・スペース・託児施設
<input type="checkbox" value="true" name="is_allergen_label" id="is_allergen_label">アレルギー表示・対応食
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">検索</button>
</fieldset>
</form>
</div>
</div>
</section>
<section class="section section-default">
<div class="container">
<h2>検索結果</h2>
<div class="bs-component" id="shoplist">
<!-- This space is shop list -->
</div>
</div>
</section>
<footer class="small">
<div class="container">
<div class="row">
<div class="col-12 text-center copyright">
© 2020 Social Creaters Team G.
</div>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/kodumeal.js"></script>
<script type="text/javascript">
$('.bs-component [data-toggle="popover"]').popover();
$('.bs-component [data-toggle="tooltip"]').tooltip();
</script>
<script type="text/javascript">
const apiUrl = "https://api.kodumeal.k0ui1.jp";
let requestUrl = apiUrl + "/restaurants?";
let arg = new Object;
let pair=location.search.substring(1).split('&');
for(let i=0;pair[i];i++) {
let kv = pair[i].split('=');
arg[kv[0]]=kv[1];
if(document.getElementById(kv[0]) != null){
if(kv[0]!="area"){
document.getElementById(kv[0]).checked = true;
}else{
document.getElementById(kv[0]).value = kv[1];
}
}
requestUrl = requestUrl + pair[i] + "&";
}
let request = new XMLHttpRequest();
request.open('GET', requestUrl, true);
request.responseType = 'json';
request.onload = function () {
const data = this.response;
console.log(data);
const target = $('#shoplist');
for(let index in data){
let text = '<div class="shoplist"><div class="shopname"><a href="./shopdetail.html?shopid=' + data[index].ID + '">' + data[index].name + '</a></div></div>';
$(target).append(text);
}
};
request.send();
</script>
</body>
</html>