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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
|
<?php include('_init.php');
if(PRODUCTION==1){ header("Location: index.php"); exit; }
$id = (int)$_GET['id'];
if ($_SESSION["is_student"] == 1) { $sql = "select profile_id,(select id from `tutor_main` where cmsloginid = tb.user_id LIMIT 1) as id from `profile_user` as tb where user_id = ? and deleted = ? LIMIT 1"; $parameters2 = array($_SESSION['cmsloginid'], 0); $row_profile = bind_pdo($sql, $parameters2, "selectone"); } /*$sql = "select *, (select count(*) from `order` where job_id = tb.id and (status = 'process' or status = 'paid') and deleted = 0) as count, (select count(*) from `order` where job_id = tb.id and (status = 'process' or status = 'paid') and studentmain_id = '" . $row_profile['id'] . "' and deleted = 0) as studentcount from tutor_postjob as tb where id = ? and deleted = ? and approved = ? and status = ? and (NOW() between start_date and end_date)";*/ $sql = "select *, (select count(*) from `order` where order_type = 'course' and job_id = tb.id and (status = 'paid') and deleted = 0) as count, (select count(*) from `order` where order_type = 'course' and job_id = tb.id and (status = 'paid') and studentmain_id = '" . $row_profile['id'] . "' and deleted = 0) as studentcount from tutor_postjob as tb where id = ? and deleted = ? and approved = ? and status = ? and (NOW() between start_date and end_date)"; $parameters = array($id, 0, 1, 1); $row_detail = bind_pdo($sql, $parameters, "selectone");
$remain_num = $row_detail["people_count"] - ($row_detail["reserved_people_count"] + $row_detail['count']);
$sql = "select nickname,tutor_no, id from tutor_main where id = ? and deleted = ? LIMIT 1"; $parameters = array($row_detail["tutormain_id"], 0); $row_tutor = bind_pdo($sql, $parameters, "selectone");
$sql = "select name_cn as name from master_type_code where id = ? and typeid = ? and deleted = ? LIMIT 1"; $parameters = array($row_detail["mas_instrument"], 'INSTRUMENT', 0); $row_instrument = bind_pdo($sql, $parameters, "selectone");
$sql = "select * from master_type_code where typeid = ? and id = ? and deleted = ?"; $parameters = array('RESIDENCE_POSITIONCODE', $row_detail['classlocation'], 0); $row_position = bind_pdo($sql, $parameters, "selectone");
$sql = "SELECT date FROM tutor_postjob_date WHERE postjob_refid = ?"; $parameters99 = array(intval($row_detail['id'])); $rows_postjob_date = bind_pdo($sql, $parameters99, "selectall");
$weekTitle_array = array('日', '一', '二', '三', '四', '五', '六'); $array = explode(',', $row_detail['week']); unset($week_array); for ($i = 0; $i < count($array); $i++) { $week_array[] = $weekTitle_array[$array[$i]]; } $week_array = implode('、', $week_array); $photo = ''; for ($i = 1; $i <= 6; $i++) { if (!$photo) { $photo = $row_detail["upload_photo" . $i]; } } if ($row_detail['level'] == 1) { $level = '初級'; } else if ($row_detail['level'] == 3) { $level = '三級'; } $url = $site_info["url"]; echo $meta = ' <meta property="og:title" content="' . $row_instrument["name"] . " " . $row_detail["people_count"] . '人班"/> <meta property="og:type" content="website"/> <meta property="og:url" content="' . $url . 'course_detail.php?id=' . $id . '"/> <meta property="og:image" content="' . $url . 'file/teacherpostjob/' . $photo . '"/> <link rel="image_src" type="image/jpeg" href="' . $url . 'file/teacherpostjob/' . $photo . '"/> <meta name="description" content="每人收費 : $' . (float)$row_detail["fee"] . ' 級別 : ' . $level . '" /> <meta property="og:description" content="每人收費 : $' . (float)$row_detail["fee"] . ' 級別 : ' . $level . '" /> <meta name="keywords" content="' . $row_instrument["name"] . " " . $row_detail["people_count"] . '人班"> <meta property="og:updated_time" content="' . time() . '" />'; ?>
<!DOCTYPE html> <html lang="en"> <head> <?php include('_head.php'); ?> <link href="css/style_k.css?v=<?= time(); ?>" type="text/css" rel="stylesheet"> <script> function refreshcode() { $('#LiCodeiframe').html('<iframe width="160" height="50" src="_verifyCode.php" frameborder="0" scrolling="no" marginwidth="0"></iframe>'); } function fbSharer(url) { var shareurl = "http://www.facebook.com/sharer/sharer.php?u=" + url; window.open(shareurl, '', 'width=550,height=350,menubar=no,status=no'); } $(function () { $('#share_img').click( function () { $('#share_email').show(); $('#LiFullbg').show(); } ); $('#share_email .PayTutorBTN2').click( function () { var thisform = $('#share_email'); $.post('_ajax.php', { async: false, ajax: 'checkverifyCode', verifyCode: $('input[name="verifyCode"]', thisform).val(), }, function (json) { var json = JSON.parse(json); var error = false; $('.error', thisform).hide(); if (!$('input[name="myemail"]', thisform).val()) { $("#myemailError", thisform).show(); error = true; } else if (!/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test($('input[name="myemail"]', thisform).val())) { $("#myemailError2", thisform).show(); error = true; } if (!$('input[name="email"]', thisform).val()) { $("#emailError", thisform).show(); error = true; } else if (!/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test($('input[name="email"]', thisform).val())) { $("#emailError2", thisform).show(); error = true; } if (!$('input[name="verifyCode"]', thisform).val()) { $("#verifyCodeError").show(); error = true; } else { if (json.status == false) { $("#verifyCode2Error", thisform).show(); error = true; } } if (error == false) { return true; } else { return false; } $('#share_email').hide(); $('#LiFullbg').hide(); }); return false; } ); $('#share_img #PayTutorBTN3').click( function () { $('#share_email').hide(); $('#LiFullbg').hide(); } ); $('#LiBanner .img').on("click", function () { var img_num = $(this).parent().attr("id"); $('#LiImg img').attr('id', "this_" + img_num); $('#LiImg img').attr('src', $('img', this).attr('src')); });
$("#LiImg img").on("click", function () { var _this_id = this.id; $("#" + _this_id.substring(5)).click(); }); }) </script> </head>
<body> <?php include('_header.php') ?> <?php include('_dialog.php') ?> <div id="share_email"> <form action="_process.php" method="post" style="margin-bottom:0px;"> <input type="hidden" name="action" value="course_share_email"> <input type="hidden" name="course_id" value="<?= $id ?>"> <div class="panel-body"> <div>你的電郵地址</div> <div> <input type="text" name="myemail" value=""> <div style="color:#F00; display:none;" class="error" id="myemailError"> 請輸入你的電郵</div> <div style="color:#F00; display:none;" class="error" id="myemailError2"> 請檢查你的電郵格式。</div> </div> <div>朋友電郵地址</div> <div> <input type="text" name="email" value=""> <div style="color:#F00; display:none;" class="error" id="emailError"> 請輸入朋友電郵</div> <div style="color:#F00; display:none;" class="error" id="emailError2"> 請檢查朋友電郵格式。</div> </div> <div> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td id="LiCodeiframe"> <iframe width="160" height="50" src="_verifyCode.php" frameborder="0" scrolling="no" marginwidth="0"></iframe> </td> <td> <img src="img/refresh_icon.png" alt="" height="50" style="cursor:pointer;" onClick="refreshcode()"/> </td> </tr> </table> <div> <input name="verifyCode" type="text" class="inputPrice" value="" maxlength="6" style="width:160px;"/> </div> <div style="color:#F00; display:none;" class="error" id="verifyCodeError"> <?= _lang('Please enter verification code.') ?> </div> <div style="color:#F00; display:none;" class="error" id="verifyCode2Error"> <?= _lang('Verification code is wrong.') ?> </div> </div> <button class="PayTutorBTN2 btn btn-primary" type="submit" style="margin-top:5px; margin-bottom:5px;"> 分享給朋友 </button> <div> <div class="PayTutorBTN3 btn btn-danger">取消</div> </div> </div> </form> </div> <div class="Categoryheader"> <div class="container"> <div class="intro-text"> <p class="BannerBigFont"> <?= _lang('Music Class') ?> </p>
<!--<p class="weFound">The best place to find your perfect tutor</p>--> </div> </div> </div> <div class="course_payment_box"> <form action="course_calladmin.php" class="LiAdminMsg" method="post" style="margin-bottom:0px;"> <input type="hidden" name="course_id" value=""> <div class="header panel-heading">請先登入為學生。按 <div class="inline pointer" style="color: blue; text-decoration: underline;font-weight: bold" onclick="_login()"> 此 </div> 登入。<br> 或<br> 請提供電郵地址及手提電話號碼,我們將盡快為你提供協助。 </div> <div class="panel-body"> <div>電郵地址</div> <div> <input type="text" name="email" value=""> <div style="color:#F00; display:none;" class="error" id="emailError"> 請輸入你的電郵</div> <div style="color:#F00; display:none;" class="error" id="emailError2"> 請檢查電郵格式。</div> <div style="color:#F00; display:none;" class="error" id="emailError3"> 你的電郵已有人使用。</div> </div> <div>電話號碼</div> <div> <input type="text" name="tel" value="" maxlength="8"> <div style="color:#F00; display:none;" class="error" id="mobnoError"> 請輸入手提電話號碼。</div> <div style="color:#F00; display:none;" class="error" id="mobnoError2"> 手提電話應是數字。</div> </div> <button class="PayTutorBTN2 btn btn-primary" type="button" style="margin-top:5px; margin-bottom:5px;"> 聯絡管理員 </button> <div> <div class="PayTutorBTN3 btn btn-danger">取消</div> </div> </div> </form> </div> <div class="GreyBackground"> <div class="container"> <!--<div class="tr" style="margin-bottom: 10px;"> <button class="ContactTutorBTN" type="button" onclick="location.href='course_category.php'">返回 </button> </div>-->
<div style="margin-bottom: 10px;"> <div class="fl page_breadcrumbs"><a href="index.php" class="default_a"> <?= _lang("Home") ?> </a> > <a href="course_category.php" class="default_a"> <?= _lang("Music Class") ?> </a> > <?= $row_instrument["name"] . " " . $row_detail["people_count"] . "人班 (".count($rows_postjob_date)."堂)" ?> </div> <div id="displaying_text" class="fr"></div> <div class="clearboth"></div> </div> <div class="row Tutor margin0" style="padding-bottom: 15px;"> <div class="col-lg-4"> <div id="LiBanner"> <div id="LiImg" class="pointer" style="position: relative; z-index: 999"> <?php if($remain_num <= 0 || $row_detail["is_full"] == 1) { ?> <!--<button class="ContactTutorBTN" type="button" style="cursor: default; background-color: #c11c2c; width: 100%; margin-top: 10px;">已滿額</button>--> <div style="position: absolute; top:15px; left: 0;"> <img src="img/full.png" style="width: 180px;"/> </div>
<img src="file/teacherpostjob/<?= $photo ?>" style="width: 100%; padding: 15px 0;" id="this_img_1"/>
<?php }else{ ?> <img src="file/teacherpostjob/<?= $photo ?>" style="width: 100%; padding: 15px 0;" id="this_img_1"/> <?php } ?> </div> <div style=""> <? for ($i = 1; $i <= 6; $i++) { ?> <? if ($row_detail["upload_photo" . $i]) { ?> <a class="fancybox-thumb" rel="fancybox-thumb" href="file/teacherpostjob/<?= $row_detail["upload_photo" . $i] ?>" id="img_<?= $i ?>"> <div class="img" style="float:left; width:16%; cursor:pointer; <? if ($i != 6) { ?>margin-right:0.8%;<? } ?>"> <img src="file/teacherpostjob/<?= $row_detail["upload_photo" . $i] ?>" style="width: 100%;"/> </div> </a> <? } ?> <? } ?> </div> </div> </div> <div class="col-lg-5"> <div style="margin-top:10px;"> <div>
<div style="font-size:18px;font-weight: bold;color:#c11c2c"> <?= $row_instrument["name"] . " " . $row_detail["people_count"] . "人班 (".count($rows_postjob_date)."堂)"; ?> </div>
<div style="border-bottom: 1px solid #dddddd"> 導師 : <b><a href="profile.php?id=<?= $row_tutor["id"] ?>" target="_blank"> <?= $row_tutor['nickname'] ?> </a></b> <br> <span style="padding-left: 39px;"> (導師編號 :<?= $row_tutor['tutor_no'] ?>)</span></div>
<div style=""> <div style="">級別 : <? if ($row_detail['level'] == 1) { echo '初級'; } else if ($row_detail['level'] == 3) { echo '中級'; } ?> </div> <div style="">學生年齡 : <? if ($row_detail['student_age'] == 1) { echo '4 - 10歲'; } else if ($row_detail['student_age'] == 2) { echo '11 - 18歲'; } else if ($row_detail['student_age'] == 3) { echo '18歲或以上'; } ?> </div> </div> </div>
<div> 課堂人數 : <?= $row_detail["people_count"] ?> 人 <?php if($remain_num > 0 && $row_detail["is_full"] != 1){ ?> (尚餘<span style="color:#F00;"> <?= ($row_detail["people_count"] - ($row_detail["reserved_people_count"] + $row_detail['count'])) ?> 個</span>名額) <?php } ?> </div>
<div style="border-bottom: 1px solid #dddddd"> <div style="display: inline-block; vertical-align: top;"> 樂器安排 : </div>
<div style="display: inline-block"> <?php if($row_detail["instrument_arrangement_1"]==1) { echo "- 導師可免費提供樂器,另加按金$".(float)$row_detail["instrument_deposit_1"];
if($row_detail["instrument_arrangement_2"]==1) { echo " 或 "; }
echo "<br>"; }
if($row_detail["instrument_arrangement_2"]==1) { echo "- 導師可提供樂器租借,另加租借價錢$".(float)$row_detail["instrument_rent_fee_2"].",按金$".(float)$row_detail["instrument_deposit_2"];
if($row_detail["instrument_arrangement_3"]==1) { echo " 或 "; }
echo "<br>"; }
if($row_detail["instrument_arrangement_3"]==1) { echo "- 學生需自備樂器"."<br>"; }
echo "<div style=''>".nl2br($row_detail["instrument_arrangement_remark"])."</div>"; ?> </div> </div>
<div style=""> <div style="float:left;"> <?= _lang("上課時間") ?> : </div> <div style="float:left; margin-left:3px;"> <? foreach ($rows_postjob_date as $row_postjob_date) { ?> <div> <?= date('Y年m月d日', strtotime($row_postjob_date["date"])) ?> ,<?= date('H:i', strtotime($row_postjob_date["date"])) ?> - <?= date('H:i', strtotime($row_postjob_date["date"]) + ($row_detail['course_hours'] * 60)) ?> </div> <? } ?> </div> <div style="clear:both;"></div> </div>
<div style=""> 堂數 : <?= count($rows_postjob_date) ?>堂 </div>
<div style="border-bottom: 1px solid #dddddd"> 上課地點 : <?= $row_detail["address_admin_cn"] ?> </div>
<div> <div style="float:left;"> 課程簡介 :</div> <div style="float:left;"> <?= nl2br($row_detail["detail_cn"]) ?> </div> <div style="clear:both;"></div> </div>
</div> </div>
<div class="col-lg-3" id="course_dtl_right" style="text-align: right;"> <div style=""> <div style="white-space: nowrap;margin-bottom:10px;">課堂編號 : <?= $row_detail["postjob_no"] ?> </div> <div style="margin-top:10px;">截止報名日期 : <?= date("Y-m-d", strtotime($row_detail["end_date"])) ?></div> <div style="margin-bottom:10px"> <span style="font-size: 16px;">每人收費 : </span> <span style="font-size: 24px; margin-top:15px;color: #c11c2c;margin-bottom:10px;"> <?= " $" . (float)$row_detail["fee"] ?> </span> </div>
<div style="margin-bottom:10px"> <? if (empty($row_detail["is_full"])) { ?> <? if ($_SESSION["is_student"] == 1) { ?> <? if ($row_detail['studentcount'] == 0 && (($row_detail["reserved_people_count"] + $row_detail['count']) < $row_detail["people_count"])) { ?> <form action="webadmin/course_search_process.php" method="post" style="margin-bottom: 10px;"> <input type="hidden" name="id" value="<?= $row_detail['id'] ?>"/> <input type="hidden" name="type" value="fontend"/> <button class="ContactTutorBTN" type="submit"> 立即付款報名</button> </form> <? } else { ?> <button class="ContactTutorBTN" type="button" style="cursor: default; margin-bottom: 10px;"> 你已報名參加 </button> <? } ?> <? } else { if($remain_num > 0){ ?> <button class="ContactTutorBTN" type="button" onclick="open_payment_tutor('<?= aes_crypt($id, 1) ?>')"> 立即付款報名 </button> <br> <? } } } else { ?> <button class="ContactTutorBTN" type="button" style="background: grey; cursor: default;"> 已滿額 </button> <? } ?> </div>
<?php if($remain_num > 0){ ?> <img src="img/payment_method.jpg" alt="" style="width:auto; margin-bottom:10px; height: 30px;"> <?php } ?>
<div> 分享給朋友 : <img src="img/email_icon.png" style="width: 25px; margin-right: 5px; cursor:pointer;" id="share_img"> <a class="facebook_share loading" href="javascript:fbSharer('<?= $url . 'course_detail.php?id=' . $id ?>');"><img src="img/facebook_icon.png" style="width: 22px;"></a> </div> </div>
</div> </div> </div> </div> <? include('_footer.php') ?> <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css?v=<?=time()?>" type="text/css" media="screen"/> <script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>
<!-- Add fancyBox - thumbnail helper (this is optional) --> <link rel="stylesheet" type="text/css" href="js/fancybox/helpers/jquery.fancybox-thumbs.css?v=2.1.5"/> <script type="text/javascript" src="js/fancybox/helpers/jquery.fancybox-thumbs.js?v=2.1.5"></script> <script type="text/javascript"> function _login() { $(".course_payment_box,.course_payment_box2").hide(); $("#LiLoginMenu").click(); $("#LiFullbg").hide(); } function open_payment_tutor(course_id) { $('#LiFullbg').show(); $('.course_payment_box .error').hide(); $('.course_payment_box').show(); $('.course_payment_box input[name="course_id"]').val(course_id); } $(document).ready(function () { $("#course_dtl_right").css("z-index", "99"); $('.PayTutorBTN3').click( function () { $(this).parent().parent().parent().parent().hide(); $('#LiFullbg').hide(); } ); $('.LiAdminMsg').submit( function () { var error = false; $('.error', this).hide(); if (!$('input[name="email"]', this).val()) { $("#emailError", this).show(); error = true; } else if (!/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test($('input[name="email"]', this).val())) { $("#emailError2", this).show(); error = true; } if (!$('input[name="tel"]', this).val()) { $("#mobnoError", this).show(); error = true; } else { var num = $('input[name="tel"]', this).val(); if ($.isNumeric(num) == false) { $("#mobnoError2", this).show(); error = true; } } if (error == false) { return true; } else { return false; } } ); $(".fancybox-thumb").fancybox({ prevEffect: 'none', nextEffect: 'none', helpers: { title: { type: 'outside' }, thumbs: { width: 50, height: 50 } } });
<? if($_SESSION['course_msg'] == true){?> alert('你的聯絡資料已被記錄,我們將盡快與你聯絡。'); <? unset($_SESSION['course_msg']); }?>
function course_dtl_right() { if ($(window).width() < 1200) { $("#course_dtl_right").css("text-align", "left"); } else { $("#course_dtl_right").css("text-align", "right"); } }
course_dtl_right();
$(window).resize(function () { course_dtl_right(); }); });
</script>
<script type="text/javascript" src="js/jquery.sticky.js"></script> <script type="text/javascript"> function sticky1() { if ($(window).width() > 1200) { $("#course_dtl_right").sticky({topSpacing: 110});
$(window).scroll(function () { var container_position = $(".Tutor").position(); var check_position_top = container_position.top + parseFloat($(".Tutor").height() - 150);
//console.log("1." + $("#course_dtl_right").offset().top); //console.log("2." + check_position_top); if ($("#course_dtl_right").offset().top > check_position_top) { //console.log(1); $("#course_dtl_right").unstick(); } else { if ($(window).scrollTop() < 200) { $("#course_dtl_right").sticky({topSpacing: 110}); } } }); } }
$(document).ready(function () { sticky1(); $(window).resize(function () { sticky1(); });
}); </script>
</body> </html>
|