-
Notifications
You must be signed in to change notification settings - Fork 2
/
event.html
357 lines (338 loc) · 16.6 KB
/
event.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
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>婉君護台灣 :: 101倒塌事件</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
<!--script src="js/less-1.3.3.min.js"></script-->
<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/jquery.loadmask.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/favicon.png">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript">
function deleteInj(){
$.get("http://opends2.azurewebsites.net/test.php?Type=Injured&PerID=1&IP=1.1.1.1",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteDis(){
$.get("http://opends2.azurewebsites.net/test.php?Type=Disaster&PerID=1&IP=1.1.1.1",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteSup(){
$.get("http://opends2.azurewebsites.net/test.php?Type=Supplies&PerID=1&IP=1.1.1.1",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteALLInj(){
$.get("http://opends2.azurewebsites.net/test.php?all=Injured",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteALLDis(){
$.get("http://opends2.azurewebsites.net/test.php?all=Disaster",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteALLSup(){
$.get("http://opends2.azurewebsites.net/test.php?all=Supplies",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteALLAmb(){
$.get("http://opends2.azurewebsites.net/test.php?all=Ambulance",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function deleteALLPer(){
$.get("http://opends2.azurewebsites.net/test.php?all=Person",function( result ){
var DeleteObj = JSON.parse(result);
alert(DeleteObj.state);
});
}
function newPer(){
var N=$("#TextPer").val();
if( N == "undefined" || N == ""){
alert("請輸入一個數值");
}else{
$.get("http://opends2.azurewebsites.net/test.php?GET=Person&N=" + N ,function(result){
alert("OK");
});
}
}
function newInj(){
var N=$("#TextInj").val();
if( N == "undefined" || N == ""){
alert("請輸入一個數值");
}else{
$.get("http://opends2.azurewebsites.net/test.php?GET=Injured&N=" + N ,function(result){
var InjuredObj = JSON.parse(result);
for(var a=0 ;a<InjuredObj.length;a++){
var TempObj=InjuredObj[a];
var Para = "Type=Per&PerID=1&IP=1.1.1.1&lat="+TempObj.lat+"&lng="+TempObj.lng;
$.post("http://opends2.azurewebsites.net/api/dynamic/InjuredInit.php?" + Para ,{
"Injured_Name": TempObj.Injured_Name ,
"Contact_Name":TempObj.Contact_Name ,
"Contact_Phone":TempObj.Contact_Phone ,
"Injured_Sex":TempObj.Injured_Sex,
"injured_area":TempObj.injuredArea ,
"injured_Cause":TempObj.injuredCause ,
"injured_Status":TempObj.injuredStatus},function(result){
// alert(result);
});
}
alert("OK");
});
}
}
function newDis(){
var N=$("#TextDis").val();
if( N == "undefined" || N == ""){
alert("請輸入一個數值");
}else{
$.get("http://opends2.azurewebsites.net/test.php?GET=Disaster&N=" + N ,function(result){
var DisasterObj = JSON.parse(result);
for(var a=0 ;a<DisasterObj.length;a++){
var TempObj=DisasterObj[a];
var Para = "PerID=1&IP=1.1.1.1&lat="+TempObj.lat+"&lng="+TempObj.lng;
$.post("http://opends2.azurewebsites.net/api/dynamic/DisasterInit.php?" + Para ,{"RoadStatus" : TempObj.RoadStatus , "Scope" : TempObj.Scope , "CarPass" : TempObj.CarPass , "DisStatus" : TempObj.DisStatus },function(result){
// alert(result);
});
}
});
}
}
function newSup(){
var N=$("#TextSup").val();
if( N == "undefined" || N == ""){
alert("請輸入一個數值");
}else{
$.get("http://opends2.azurewebsites.net/test.php?GET=Supplies&N=" + N ,function(result){
var SuppliesObj = JSON.parse(result);
for(var a=0 ;a<SuppliesObj.length;a++){
var TempObj=SuppliesObj[a];
var Para = "PerID=1&IP=1.1.1.1&lat="+TempObj.lat+"&lng="+TempObj.lng;
$.post("http://opends2.azurewebsites.net/api/dynamic/SuppliesInit.php?" + Para ,{"Items" : TempObj.Items ,"PersonNumber" : TempObj.PersonNumber },function(result){
// alert(result);
});
}
});
}
}
</script>
<script>
var AmbulanceObj={};
function AmbGetTask(AmbType){
if(AmbType=="2"){
for(var RowAmb in AmbulanceObj){
$.post("http://opends2.azurewebsites.net/api/dynamic/injuredProcess.php", {"status" : "2" , "AmbID": AmbulanceObj[RowAmb].AmbID ,"IP" : AmbulanceObj[RowAmb].IP,"InjID" : AmbulanceObj[RowAmb].InjID},function(result){
// alert(result);
var UpdateObj = JSON.parse(result);
});
}
alert("完成");
}else if(AmbType=="3"){
for(var RowAmb in AmbulanceObj){
$.post("http://opends2.azurewebsites.net/api/dynamic/injuredProcess.php", {"status" : "3" , "AmbID": AmbulanceObj[RowAmb].AmbID ,"IP" : AmbulanceObj[RowAmb].IP,"InjID" : AmbulanceObj[RowAmb].InjID},function(result){
// alert(result);
var UpdateObj = JSON.parse(result);
});
}
alert("完成");
}else if(AmbType=="0"){
for(var RowAmb in AmbulanceObj){
$.get("http://opends2.azurewebsites.net/api/dynamic/ambulanceTask.php?AmbID=" + AmbulanceObj[RowAmb].AmbID , function( result ){
var TempObj = JSON.parse(result);
if(TempObj.injured=="Wait"){
alert("等候傷患中");
}else{
AmbulanceObj[TempObj.Amb.AmbID].InjID=TempObj.injured.InjuredPeopleID;
}
// alert(AmbulanceObj[TempObj.Amb.AmbID].InjID);
});
alert(RowAmb+"取得任務");
}
}
}
function newAmb(){
var N=$("#TextAmb").val();
if( N == "undefined" || N == ""){
alert("請輸入一個數值");
}else{
$.get("http://opends2.azurewebsites.net/test.php?GET=Ambulance&N=" + N , function(result){
TempObj = JSON.parse(result);
for(var a=0 ; a<TempObj.length;a++){
var AmbID = TempObj[a].AmbID;
AmbulanceObj[AmbID]=TempObj[a];
}
alert("完成");
});
}
}
</script>
<script>
var minNum = 0;
function UpdateHos() {
//543
for(var hid=1;hid<543;hid++)
{
var thb =(hid>10)?100:300;
var tsr =(hid>10)?5:10;
var ahb = Math.floor(Math.random() * (thb - minNum + 1)) + minNum;
var asr = Math.floor(Math.random() * (tsr - minNum + 1)) + minNum;
var url = "http://opends2.azurewebsites.net/api/dynamic/hospitalUpdate.php?HID="+hid+"&AHB="+ahb+"&THB="+thb+"&ASR="+asr+"&TSR="+tsr;
$.get(url,function(result){
// alert(result);
});
}
}
</script>
</head>
<body>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<h3> 當恐怖組織進攻台灣!101 突然倒塌!?</h3>
<div class="panel-group" id="panel-main">
<div class="panel panel-default">
<div class="panel-heading">
<a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-main" href="#panel-person">網軍進攻</a>
</div>
<div id="panel-person" class="panel-collapse collapse">
<div class="panel-body row">
<div class="col-md-4">
<h5> 建立傷患點</h5>
<div class="input-group">
<input id="TextInj" type="text" class="form-control" placeholder="10" value="10">
<span class="input-group-btn">
<button type="button" class="btn btn-primary" onclick="newInj();"> 新增傷患 </button>
</span>
</div><!-- /input-group -->
</div>
</div>
<div class="panel-body row">
<div class="col-md-4">
<h5> 建立物資點</h5>
<div class="input-group">
<input id="TextSup" type="text" class="form-control" placeholder="10" value="10">
<span class="input-group-btn">
<button type="button" class="btn btn-primary" onclick="newSup();"> 新增物資 </button>
</span>
</div><!-- /input-group -->
</div>
</div>
<div class="panel-body row">
<div class="col-md-4">
<h5> 建立災難點</h5>
<div class="input-group">
<input id="TextDis" type="text" class="form-control" placeholder="10" value="10">
<span class="input-group-btn">
<button type="button" class="btn btn-primary" onclick="newDis();"> 新增周圍癱瘓路口 </button>
</span>
</div><!-- /input-group -->
</div>
</div>
<div class="panel-body row">
<div class="col-md-4">
<h5> 建立婉君出沒</h5>
<div class="input-group">
<input id="TextPer" type="text" class="form-control" placeholder="100" value="100">
<span class="input-group-btn">
<button type="button" class="btn btn-primary" onclick="newPer();"> 新增大量婉君 </button>
</span>
</div><!-- /input-group -->
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-main" href="#panel-amb">救護車救援</a>
</div>
<div id="panel-amb" class="panel-collapse collapse">
<div class="panel-body row">
<div class="col-md-4">
<h5> 建立救護車</h5>
<div class="input-group">
<input id="TextAmb" type="text" class="form-control" placeholder="8" value="8">
<span class="input-group-btn">
<button type="button" class="btn btn-warning" onclick="newAmb();"> 新增救護車 </button>
</span>
</div><!-- /input-group -->
</div>
</div>
<div class="panel-body row">
<div class="col-md-4">
<h5> 救護車指令 </h5>
<button type="button" class="btn btn-default" onclick="AmbGetTask('0');"> 接獲任務 </button>
<button type="button" class="btn btn-info" onclick="AmbGetTask('2');"> 接到傷患 </button>
<button type="button" class="btn btn-primary" onclick="AmbGetTask('3');"> 送達醫院 </button>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-main" href="#panel-hos">醫院設定</a>
</div>
<div id="panel-hos" class="panel-collapse collapse">
<div class="panel-body row">
<div class="col-md-4">
<h5> 空床數量</h5>
<button type="button" class="btn btn-warning" onclick="UpdateHos();"> 設定 </button>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-main" href="#panel-clean">清除所有項目</a>
</div>
<div id="panel-clean" class="panel-collapse collapse">
<div class="panel-body">
<h5> 清除事件資料 </h5>
<button type="button" class="btn btn-warning" onclick="deleteInj()"> 清除傷患點(ALL) </button>
<button type="button" class="btn btn-warning" onclick="deleteDis()"> 清除災害點(ALL) </button>
<button type="button" class="btn btn-warning" onclick="deleteSup()"> 清除物資點(ALL) </button>
<button type="button" class="btn btn-warning" onclick="deleteAmb()"> 清除救護車(ALL) </button>
</div>
<div class="panel-body">
<h5> 清除所有資料 </h5>
<button type="button" class="btn btn-danger" onclick="deleteALLInj()"> 清除傷患點(ALL) </button>
<button type="button" class="btn btn-danger" onclick="deleteALLDis()"> 清除災害點(ALL) </button>
<button type="button" class="btn btn-danger" onclick="deleteALLSup()"> 清除物資點(ALL) </button>
<button type="button" class="btn btn-danger" onclick="deleteALLAmb()"> 清除救護車(ALL) </button>
<button type="button" class="btn btn-danger" onclick="deleteALLPer()"> 清除婉君(ALL) </button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>