-
Notifications
You must be signed in to change notification settings - Fork 1
/
hospital.html
171 lines (154 loc) · 6.81 KB
/
hospital.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
<html>
<head>
<title>History</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" href="resources/css/main.css">
<!--<script type="text/javascript" src="resources/json/coordinates.json"></script>-->
<script src="resources/js/jquery-3.0.0.min.js"></script>
<script src="resources/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="resources/bootstrap/css/bootstrap.min.css">
<link rel="shortcut icon" href="resources/images/favicon.ico" type="image/x-icon">
<style>
body {
height: 100%;
margin: 0;
padding: 0;
overflow-y: unset;
}
#content{
padding-top: 50px;
}
#map {
height: 100%;
z-index: 0;
}
.glyphicon-chevron-down{
color: dimgray;
}
.dropdown-button{
position: absolute;
right: 10px;
}
.panel{
margin-top: 16px;
}
</style>
<script src="resources/js/vue.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse" id="navbar">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">iAmbulansiya</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="map.html">Home</a></li>
<li class="active"><a href="hospital.html">Hospital</a></li>
<li><a href="history.html">History</a></li>
<li><a href="abouts.html">About</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<div id="warnings-panel"></div>
</ul>
</div>
<div class="progress" id="progressDirection">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%">
please wait...
</div>
</div>
</div>
</nav>
<div class="container" id="content">
<!-- Modal -->
<div id="history_list">
<ul id="history_list" class="list-group">
<li v-for="item,index in items" class="list-group-item">
<div class="container">
<div class="row">
<div class="col-md-10">
<div class="text-item">{{ item.name }}</div>
</div>
<div class="col-md-1">
<a v-bind:href=" '#collapse-' + index" data-toggle="collapse" class="dropdown-button">
<span class="glyphicon glyphicon-chevron-down"></span>
</a>
</div>
</div>
</div>
<!--<a href="#demo" data-toggle="collapse">Collapsible</a>-->
<div v-bind:id=" 'collapse-' + index" class="collapse">
<div class="panel panel-default">
<div class="panel-body">
address{{item.location.address}}
</div>
<div class="panel-body">
coordinates: {{item.location.lat+", "+item.location.lat}}
</div>
<div class="panel-body">
contact#: {{item.contact}}
</div>
<div class="panel-body">
available: {{item.available}}
<button type="button" v-on:click='openAlert(index)'>edit</button>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
<script>
var example1 = new Vue({
el: '#content',
data: {
items: [
]
},
methods:{
getList: function(){
var history =localStorage.getItem("hospital_list");
console.log(history);
this.items = JSON.parse(history);
for(var i = 0; i<this.items.length;i++){
this.items[i]['view'] = false;
}
$('#progressDirection').hide();
},
viewlist: function(index){
this.items[index].view = !this.items[index].view ;
console.log("item: "+index+" view: "+this.items[index].view );
},openAlert: function(index){
var available = prompt("enter no of available response unit of "+this.items[index].name);
if(available!=null&&available.length>0){
if(!isNaN(available)){
var r = confirm("save input?");
if (r == true) {
this.items[index].available = available;
localStorage.setItem("hospital_list",JSON.stringify(this.items));
}
}else{
alert("should be a number");
}
}
}
}
})
example1.getList();
function init(){
var history_list = JSON.parse(localStorage.getItem("experiment_paper"));
history_list.forEach(function(item){
generateItem(item);
})
}
function generateItem(){
}
</script>
</body>
</html>