-
Notifications
You must be signed in to change notification settings - Fork 0
/
prayertime.html
209 lines (156 loc) · 6.96 KB
/
prayertime.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
<html>
<div class="card-body text-center" style="color:#ffffff">
<div class="row bg-salah py-3">
<p>পরবর্তী নামাজ - আসর</p>
<p style="font-size:32px" id="asr" class="tobng">4:25 PM</p>
<input type="hidden" id="nextPrayerId" value="asr" />
</div>
</div>
<p class="my-3 text-center py-2 tobng" style="font-size:20px; background-color:#ffffff">মঙ্গলবার, 5 সেপ্টেম্বর, 2023</p>
<div class="container" id="prayerTime">
<div class="card mb-2 card-body">
<div class="row">
<div class="col-4">
<p>ফযর</p>
</div>
<div class="col-8 text-end">
<p id="fazr_" class="text-secondary tobng">
04:29
</p>
</div>
</div>
</div>
<div class="card mb-2 card-body ">
<div class="row">
<div class="col-4">
<p class=" my-auto">জোহর</p>
</div>
<div class="col-8 text-end">
<p id="juhr_" class="text-secondary tobng">
12:01
</p>
</div>
</div>
</div>
<div class="card card-body mb-2">
<div class="row">
<div class="col-4">
<p>আসর</p>
</div>
<div class="col-8 text-end">
<p id="asr_" class="text-secondary tobng">
16:25
</p>
</div>
</div>
</div>
<div class="card card-body mb-2">
<div class="row">
<div class="col-4">
<p>মাগরিব</p>
</div>
<div class="col-8 text-end">
<p id="magrib_" class="text-secondary tobng">
18:16
</p>
</div>
</div>
</div>
<div class="card card-body mb-2">
<div class="row">
<div class="col-4">
<p>ইশা</p>
</div>
<div class="col-8 text-end">
<p id="isha_" class="text-secondary tobng">
19:31
</p>
</div>
</div>
</div>
</div>
<script>
var defaultTime = null;
var cities = null;
$('.tobng').each(function () {
var currentElement = $(this);
var value = currentElement.html().trim(); // if it is an input/select/textarea field
currentElement.html(convertToBanglanumber(value));
// TODO: do something with the value
});
getCity();
getDefaultTime();
function getCity() {
$.ajax({
type: "get",
url: "https://nagad.islamicservice.net/PrayerTime/GetCities",
async: true,
success: function (response) {
for (var i = 0; i < response.length; i++) {
$("#ddlPlaces").append($("<option></option>").val(response[i].place_name).html(response[i].place_name));
$("#ddlPlaces").val("ঢাকা");
}
cities = response;
},
failure: function (response) {
},
error: function (response) {
}
});
}
function getDefaultTime() {
$.ajax({
type: "get",
async: true,
url: "https://nagad.islamicservice.net/PrayerTime/GetDefaultTime",
success: function (response) {
defaultTime = response;
},
failure: function (response) {
},
error: function (response) {
}
});
}
function getSelectedCityTime() {
if (cities.length > 0) {
var obj = cities.filter(a => a.place_name == $('#ddlPlaces').val());
if (obj != null) {
var fazr = defaultTime.fazr.replace('AM', '');
var juhr = defaultTime.juhr.replace('PM','');
var asr = defaultTime.asr.replace('PM','');
var magrib = defaultTime.magrib.replace('PM','');
var isha = defaultTime.isha.replace('PM', '');
fazr = defaultTime.fazr.split(':')[0] + ':' + (parseInt(defaultTime.fazr.split(':')[1]) + parseInt(obj[0]['fazr'])) + ' AM';
juhr = defaultTime.juhr.split(':')[0] + ':' + (parseInt(defaultTime.fazr.split(':')[1]) + parseInt(obj[0]['johr'])) + ' PM';
asr = defaultTime.asr.split(':')[0] + ':' + (parseInt(defaultTime.asr.split(':')[1]) + parseInt(obj[0]['asr'])) + ' PM';
magrib = defaultTime.magrib.split(':')[0] + ':' + (parseInt(defaultTime.magrib.split(':')[1]) + parseInt(obj[0]['magrib'])) + ' PM';
isha = defaultTime.isha.split(':')[0] + ':' + (parseInt(defaultTime.isha.split(':')[1]) + parseInt(obj[0]['isha'])) + ' PM';
//var isha = defaultTime.isha.split(':')[0] + ':' + (parseInt(defaultTime.isha.split(':')[1]) + parseInt(obj[0]['isha'])) +defaultTime.isha.includes('AM') ? 'AM' : 'PM';
//var fazr = defaultTime.fazr.split(':')[0] + ':' + (parseInt(defaultTime.fazr.split(':')[1]) + parseInt(obj[0]['fazr'])) +defaultTime.fazr.includes('AM') ? 'AM' : 'PM';
//var juhr = defaultTime.juhr.split(':')[0] + ':' + (parseInt(defaultTime.juhr.split(':')[1]) + parseInt(obj[0]['johr'])) +defaultTime.juhr.includes('AM') ? 'AM' : 'PM';
//var asr = defaultTime.asr.split(':')[0] + ':' + (parseInt(defaultTime.asr.split(':')[1]) + parseInt(obj[0]['asr'])) + defaultTime.asr.includes('AM') ? 'AM' : 'PM';
//var magrib = defaultTime.magrib.split(':')[0] + ':' + (parseInt(defaultTime.magrib.split(':')[1]) + parseInt(obj[0]['magrib'])) + defaultTime.magrib.includes('AM') ? 'AM' : 'PM';
var asd = $('.nowPrayer').val();
$('#fazr_').html(fazr);
$('#juhr_').html(juhr);
$('#asr_').html(asr);
$('#magrib_').html(magrib);
$('#isha_').html(isha);
var currentId = $('#nextPrayerId').val()
$('#' + currentId).html($('#' + currentId + '_').html());
$('.tobng').each(function () {
var currentElement = $(this);
var value = currentElement.html().trim(); // if it is an input/select/textarea field
currentElement.html(convertToBanglanumber(value));
// TODO: do something with the value
});
}
}
}
</script>
<body>
<a href="https://nagad.islamicservice.net/PrayerTime/GetDefaultTime" style="text-align: center; font-size: 40px; text-transform: capitalize;"> defaultTime </a>
<a href="https://nagad.islamicservice.net/Quran/GetSuraPartialView" style="text-align: center; font-size: 40px; text-transform: capitalize;"> Quran </a>
</body>
</html>