@@ -101,6 +101,15 @@ public function get_event_location() {
101
101
}
102
102
103
103
$ match_player = JwtApiCall ($ my_api ."event/memberList " , "POST " , array ('eventId ' => $ event_id ), $ _SESSION ['token ' ]); //참여인원
104
+
105
+ function comparePlayers ($ player1 , $ player2 ) {
106
+ $ sortA = $ player1 ['memberName ' ];
107
+ $ sortB = $ player2 ['memberName ' ];
108
+
109
+ return strcmp ($ sortA , $ sortB );
110
+ }
111
+
112
+ usort ($ match_player ['memberList ' ], 'comparePlayers ' );
104
113
?>
105
114
<div class="page_wrap">
106
115
<div class="page">
@@ -156,7 +165,7 @@ public function get_event_location() {
156
165
<div class="icon"><i class="fa-solid fa-user-check"></i></div>
157
166
<div class="attendance_check_txt"><p>출석 확인</p></div>
158
167
</a>
159
- <a href="../view_control/purchasereq_check?eventId= <?= $ event_dto_id ?> &memberId= <?= $ _SESSION [ ' member_id ' ] ?> " class="expenses_check">
168
+ <a href="javascript:;" onclick="purchasereq_check() " class="expenses_check">
160
169
<div class="icon"><i class="fa-solid fa-hand-holding-dollar"></i></div>
161
170
<div class="expenses_check_txt"><p>납부 확인</p></div>
162
171
</a>
@@ -203,11 +212,27 @@ public function get_event_location() {
203
212
</div>
204
213
</div>
205
214
<script>
215
+ function loading_page(status) {
216
+ if (status) {
217
+ $.ajax({
218
+ url: '../loading/loading',
219
+ method: 'POST',
220
+ data: { status: status },
221
+ success: function(response) {
222
+ document.body.innerHTML += response;
223
+ }
224
+ });
225
+ } else {
226
+ const loading = document.getElementById("spinner-wrapper");
227
+ loading.parentNode.removeChild(loading);
228
+ }
229
+ }
206
230
function player_check_lity() {
207
231
lity('#player_check_lity');
208
232
}
209
233
function attendance_check() {
210
234
if ("geolocation" in navigator) {
235
+ loading_page(true);
211
236
navigator.geolocation.getCurrentPosition(function(position) {
212
237
var latitude = position.coords.latitude; // 위도
213
238
var longitude = position.coords.longitude; // 경도
@@ -216,14 +241,34 @@ function attendance_check() {
216
241
method: 'POST',
217
242
data: { eventId: <?= $ event_dto_id?> , latitude: latitude, longitude: longitude },
218
243
success: function(response) {
244
+ loading_page(false);
219
245
alert(response);
220
246
}
221
247
});
248
+ }, function(error) {
249
+ if (error.code === error.PERMISSION_DENIED) {
250
+ alert("위치 권한이 거부되었습니다.");
251
+ } else {
252
+ alert("위치 정보를 가져오는 중 오류가 발생했습니다.");
253
+ }
222
254
});
223
255
} else {
256
+ loading_page(false);
224
257
alert("위치정보를 지원하지 않는 브라우저입니다.");
225
258
}
226
259
}
260
+ function purchasereq_check() {
261
+ loading_page(true);
262
+ $.ajax({
263
+ url: '../view_control/purchasereq_check',
264
+ method: 'POST',
265
+ data: { eventId: <?= $ event_dto_id?> },
266
+ success: function(response) {
267
+ loading_page(false);
268
+ alert(response);
269
+ }
270
+ });
271
+ }
227
272
function matchLocation() {
228
273
var address = document.getElementById('match_address_txt').textContent;
229
274
var centerCoord = new naver.maps.LatLng(37.5666102, 126.9783881);
0 commit comments