| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/imusiccircle/ |
Upload File : |
<?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>