403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/imusiccircle/profile.php
<?php
	include('_init.php');

	$id = (int)$_GET["id"];

	$sql        = "select *,tutor_main.id as id2, mtcode1.name_en as residence_en, mtcode1.name_cn as residence_cn, mtcode1.extra1 as residence_master from tutor_main
					INNER JOIN master_type_code mtcode1 ON mtcode1.id = tutor_main.mas_residencecode
					where tutor_main.id = ? and tutor_main.status = ? and tutor_main.deleted = ? and tutor_main.approved = ?";
	$parameters = array($id, 4, 0, 1);
	$tutor      = bind_pdo($sql, $parameters, "selectone");

	if (empty($tutor)) {
		echo "<script>alert('" . _lang("Cannot find tutor information!") . "'); location.href='index.php';</script>";
		exit;
	}

	$teaching_venue      = get_teaching_venue($id);
	$teaching_mode       = get_teaching_mode($id);
	$teaching_instrument = get_teaching_instrument($id);

	if (isset($_GET["category_id"]) && (int)$_GET["category_id"] > 0 || $teaching_instrument[0]['mas_instrument']) {
		$category_id        = $_GET["category_id"] ? $_GET["category_id"] : $teaching_instrument[0]['mas_instrument'];
		$sql                = "select * from tutor_charge INNER JOIN master_type_code ON tutor_charge.mas_instrument = master_type_code.id where tutor_charge.mas_instrument = ? and tutor_charge.deleted = ?";
		$parameters         = array($category_id, 0);
		$row_instrument     = bind_pdo($sql, $parameters, "selectone");
		$payment_instrument = $row_instrument['name_' . $langcode];
		$tutor_expectcharge = get_tutor_expectcharge($id, $_GET["category_id"], "tfee");
		foreach ($tutor_expectcharge as $row2) {
			$trail_fee_grade = get_master_type_code("TRIAL_FEE_GRADE", $row2["grade_name"]);
			//if ($_SESSION["is_tutor"] != 1) {
			if ($row2['charge_30min'] > 0) {
				if ($row2['charge_30min'] < $payment_charge || !$payment_charge) {
					$payment_charge   = $row2['charge_30min'];
					$payment_min      = '30';
					$payment_level    = $trail_fee_grade['name_' . $langcode];
					$payment_level_id = $trail_fee_grade['id'];
				}
			}
			if ($row2['charge_45min'] > 0) {
				if ($row2['charge_45min'] < $payment_charge || !$payment_charge) {
					$payment_charge   = $row2['charge_45min'];
					$payment_min      = '45';
					$payment_level    = $trail_fee_grade['name_' . $langcode];
					$payment_level_id = $trail_fee_grade['id'];
				}
			}
			if ($row2['charge_60min'] > 0) {
				if ($row2['charge_60min'] < $payment_charge || !$payment_charge) {
					$payment_charge   = $row2['charge_60min'];
					$payment_min      = '60';
					$payment_level    = $trail_fee_grade['name_' . $langcode];
					$payment_level_id = $trail_fee_grade['id'];
				}
			}
			//}
		}
	}

	//$tutor_resdience_master = get_master_type_code("TEACH_AREACODE", $tutor["residence_master"]);
	//var_dump($tutor);

	/*$start_date  = new DateTime($tutor["dob_year"] . "-" . $tutor["dob_mon"]);
	$since_start = $start_date->diff(new DateTime());
	$tutor_age   = $since_start->y;

	$year_range       = get_master_type_code("YEAR_RANGE");
	$tutor_year_range = "";

	foreach ($year_range as $range) {
		if (empty($tutor_year_range) && $tutor_age <= $range["extra1"]) {
			$tutor_year_range = $range["name_" . $langcode];
		}
	}*/


	$tutor_year_range_info = get_tutor_year_range($tutor["dob_year"], $tutor["dob_mon"]);
	$tutor_year_range      = $tutor_year_range_info["tutor_year_range"];

	$tutor_expstudentage      = get_tutor_expstudentage($id);
	$instrument_qualification = get_instrument_qualification($id);
	$teaching_area            = get_teaching_area($id);

	$teaching_area_master = array();

	foreach ($teaching_area as $row) {
		$teachareacode = get_master_type_code("TEACH_AREACODE", $row["extra1"]);
		$teachareacode = $teachareacode["name_" . $langcode];

		if (!in_array($teachareacode, $teaching_area_master)) {
			$teaching_area_master[] = $teachareacode;
		}
	}

	$areas = get_master_type_code("TEACH_AREACODE");

	$url = $site_info["url"];

	$instrument = '';
	if (!empty($teaching_instrument)) {
		foreach ($teaching_instrument as $key => $row) {
			$instrument .= $row["name_" . $langcode];
			if (($key + 1) != count($teaching_instrument)) {
				$instrument .= ", ";
			}
		}
	}

	$sql               = "select *, student_postjob.id as studentpostjob_id, master_type_code.name_" . $langcode . " as instrument_name from student_postjob
									INNER JOIN master_type_code ON master_type_code.id = student_postjob.mas_instrument
									where student_postjob.studentmain_id = ? and student_postjob.status = ? and student_postjob.deleted = ? and student_postjob.approved = ?";
	$parameters        = array($_SESSION["student_login"], 1, 0, 1);
	$student_post_jobs = bind_pdo($sql, $parameters, "selectall");
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<?php
		echo $meta = '
	<meta property="fb:app_id" content="1136003943104680"/>
	<meta property="og:title" content="' . $tutor["nickname"] . '-' . $instrument . '"/>
	<meta property="og:type" content="website"/>
	<meta property="og:url" content="' . $url . 'profile.php?id=' . $id . '&v=1"/>
	<meta property="og:image" content="' . $url . 'file/teacher/' . $tutor["profilephoto_path"] . '"/>
	<link rel="image_src" type="image/jpeg" href="' . $url . 'file/teacher/' . $tutor["profilephoto_path"] . '"/>
	<meta name="description" content="' . $tutor["self_describemyself"] . " " . $tutor["self_intro"] . '" />
	<meta property="og:description" content="' . $tutor["self_describemyself"] . " " . $tutor["self_intro"] . '" />
	<meta name="keywords" content="' . $tutor["nickname"] . '-' . $instrument . '">
	<meta property="og:updated_time" content="' . time() . '" />';
	?>
	<?php include('_head.php'); ?>
	<link href="css/style_k.css?v=<?= time(); ?>" type="text/css" rel="stylesheet">
	<style>
		.navbar-default {
			background-color: #000000 !important;
			border-color: #e7e7e7 !important;;
		}

		#accumulate_tutorial_hours_table {
			width: 100%;
			border-collapse: collapse;
		}

		#accumulate_tutorial_hours_table td, #accumulate_tutorial_hours_table th {
			padding: 5px;
		}

		.fb-share-button {
			position: relative;
			top: 9px;
			left: 15px;
		}
	</style>
</head>

<body>
<?php include('_header.php') ?>
<?php include('_dialog.php') ?>
<div id="course_payment_box" class="panel panel-default">
	<form action="_process.php" id="LiProfileAdminMsg" method="post" style="margin-bottom:0px;">
		<input type="hidden" name="action" value="profile_adminmsg"/>
		<div class="header panel-heading">
			<?= _lang("Please login first. If you have any problem, you can call 9446 0817 with Whatsapp to contact us.") ?>
		</div>
		<div class="panel-body">
			<div style="font-weight:bold; text-align:center; margin-bottom:15px;">或<br> 留言給導師</div>
			<div>
				<textarea name="msg"></textarea>
				<div style="color:#F00; display:none;" class="error" id="msgError">請輸入你的留言。</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 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>
			<div>#如果要我們的導師快速配對顧問服務,請致電3460 4105。</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="ProfileContent">
	<div class="Profilecontainer">

		<div style="margin-bottom: 10px;">
			<div class="fl page_breadcrumbs"><a href="index.php" class="default_a"><?= _lang("Home") ?></a> >
				<a href="category.php" class="default_a"><?= _lang("Learn") ?></a> > <?= $tutor["nickname"] ?></div>
			<div id="displaying_text" class="fr"></div>
			<div class="clearboth"></div>
		</div>

		<div class="row">
			<div class="col-sm-12">
				<div class="Profile" style="min-height: 320px;">
					<div class="row">
						<div class="col-sm-5" id="ProfileImg">
							<?php if (!empty($tutor["profilephoto_path"])) {

								?>
								<a id="fancybox_profile_img" href="file/teacher/<?= $tutor["profilephoto_path"] ?>">
									<div class="profile_img_container tutor_img" style="display: none;">
										<div class=" " style="background: url(file/teacher/<?= $tutor["profilephoto_path"] ?>) center center no-repeat; background-size: cover; width: inherit; height: inherit;"></div>
									</div>
								</a>
								<div>
									<img class="tutor_img2" style="display: none;" src="file/teacher/<?= $tutor["profilephoto_path"] ?>">
								</div>

							<?php } ?>

							<div style="text-align: left; margin-top: 10px;">
								<?php
									echo '<button class="ContactTutorBTN" type="button" onclick="contact_tutor();" style="margin-bottom:5px; width: auto !important;">' . _lang("Contact Tutor") . '</button>'; ?>
								<div id="fb-root" style="display: inline-block;"></div>
								<script>(function (d, s, id) {
										var js, fjs = d.getElementsByTagName(s)[0];
										if (d.getElementById(id)) return;
										js = d.createElement(s);
										js.id = id;
										js.src = "//connect.facebook.net/zh_HK/sdk.js#xfbml=1&version=v2.7";
										fjs.parentNode.insertBefore(js, fjs);
									}(document, 'script', 'facebook-jssdk'));</script>
								<div class="fb-share-button" data-href="<?= $url . 'profile.php?id=' . $id . '&v=' . time() ?>" data-layout="button_count" data-size="large" data-mobile-iframe="true">
									<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?= $url . 'profile.php?id=' . $id . '&v=' . time() ?>&src=sdkpreparse">分享</a>
								</div>
							</div>

						</div>
						<div class="col-sm-7">
							<div class="ProfileInfo">
								<div class="TutorName">
									<div class="row">
										<div class="col-sm-12" style="color: #D90018; ">
											<?= $tutor["nickname"] ?>
										</div>
									</div>
								</div>
								<div class="profile_text1">
									<?= _lang("Tutor Code") . ": " . $tutor["tutor_no"] . "<br>" ?>

									<?= _lang("Gender") . ": " . ($tutor["gender"] == "m" ? _lang("Male") : _lang("Female")) ?>
									<?= _lang("Age") . ": " . $tutor_year_range; ?>
								</div>

								<div class="ProfileDetail capitalize margin0">
									<div class="col-sm-12 padding0">
										<?= strtolower(_lang("WHERE I TEACH")) ?>
										:
										<?php
											foreach ($teaching_area_master as $key => $row) {

												echo $row;
												if (($key + 1) != count($teaching_area_master)) {
													echo " / ";
												}
											}

											echo "<br>";

											echo strtolower(_lang("TEACHING MUSICAL INSTRUMENTS")) . ": ";

											if (!empty($teaching_instrument)) {
												foreach ($teaching_instrument as $key => $row) {
													echo $row["name_" . $langcode];
													if (($key + 1) != count($teaching_instrument)) {
														echo ", ";
													}
												}
											}

											echo "<br>";

											echo _lang("Email Verification") . ': <span class="glyphicon glyphicon-ok-circle" aria-hidden="true" style="color: green;"></span>&nbsp;&nbsp;&nbsp;' . _lang("Phone Verification") . ': <span class="glyphicon glyphicon-ok-circle" aria-hidden="true" style="color: green;"></span><br>';

										?>
									</div>
								</div>

								<div class="clearboth"></div>
								<hr style="margin: 10px 0;">
								<!-- TutorIntro -->
								<div class="ProfileDetail" style="font-size: 20px; line-height: 120%;word-wrap: break-word;">
									<?php
										echo nl2br($tutor["self_describemyself"]);
									?>
									<!--<br>
									test test test test 中文 中文
									<br>
									test test test test 中文 中文
									<br>
									test test test test 中文 中文-->
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<?php /* ?>
			<div class="col-sm-4">
				<div class="ProfileSection fast_checkout">
					<div style="font-size:18px; color: #D90018; font-weight:bold; text-align:center;">優惠體驗班</div>
					<hr style="margin: 8px 0;">

					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;color: #00994B;">樂器 :</div>
					<div class="AboutMeMessage" style="float:left;"><?= $payment_instrument ?></div>
					<div style="clear:both;"></div>

					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;color: #00994B;">級別 :</div>
					<div class="AboutMeMessage" style="float:left;"><?= $payment_level ?></div>
					<div style="clear:both;"></div>

					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;color: #00994B;">時數 :</div>
					<div class="AboutMeMessage" style="float:left;"><?= $payment_min . lang('mins') ?></div>
					<div style="clear:both;"></div>

					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;color: #00994B;">堂數 :</div>
					<div class="AboutMeMessage" style="float:left;">2</div>
					<div style="clear:both;"></div>
					<hr style="margin: 8px 0;">
					<?
						if ($_SESSION["is_student"] == 1) {
							?>
							<form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;">
								<input type="hidden" name="time" value="<?= aes_crypt($payment_min, 1) ?>">
								<input type="hidden" name="instrument" value="<?= aes_crypt($_GET['category_id'], 1) ?>">
								<input type="hidden" name="level" value="<?= aes_crypt($payment_level_id, 1) ?>">
								<input type="hidden" name="tutor" value="<?= aes_crypt($tutor['id2'], 1) ?>">

								<div class="ProfileSectionTitle" style="float:left; margin-right:5px;">每堂收費 :</div>
								<div class="AboutMeMessage" style="float:left;">
									<span style="font-size:20px;color: #D90018;">$<span class="money"><?= $payment_charge ?></span></span>
								</div>
								<div style="clear:both;"></div>

								<div class="ProfileSectionTitle">折扣優惠碼 :
									<input type="text" name="code" value="" style="width: 80px;line-height: 100%;">
									<button class="btn btn-default exchange" style="padding: 0px 5px; background-color: #dddddd;">
										兌換
									</button>
								</div>

								<div style="color:#F00; display:none;" class="error" id="couponError">
									請輸入正確的優惠劵號碼
								</div>
								<div style="color:#F00; display:none;" class="error" id="couponError2">
									*$20優惠已滿額,多謝支持。有興趣學習音樂的同學,可以輸入 "INKY50" 以半價體驗兩堂音樂班。
								</div>
								<div style="clear:both;"></div>

								<div class="ProfileSectionTitle" style="float:left; margin-right:5px;font-size: 19px;font-weight: bold;">
									總收費 :
								</div>
								<div class="AboutMeMessage" style="float:left;">
									<span class="orgmoney" style="display:none;"><?= $payment_charge ?></span>
									<span style="font-size:14px; color: #000; text-decoration:line-through; display:none;" class="oldprice">$<span class="money"></span></span>
									<span style="font-size:20px;color: #D90018;" class="nowprice">$<span class="money"><?= $payment_charge * 2 ?></span></span>
								</div>
								<div style="clear:both;"></div>

								<button class="PayTutorBTN2 btn btn-primary paypal_loading" type="submit" style="margin-bottom:5px; margin-top:9px; background-color: #00994B; padding: 3px 12px;">
									繼續付款
								</button>
							</form>
						<? } else {
							?>
							<div class="course_payment_box">
								<form action="fastpaypal.php" class="LiAdminMsg" method="post" style="margin-bottom:0px;">
									<input type="hidden" name="time" value="<?= aes_crypt($payment_min, 1) ?>"><input type="hidden" name="instrument" value="<?= aes_crypt($_GET['category_id'], 1) ?>"><input type="hidden" name="level" value="<?= aes_crypt($payment_level_id, 1) ?>"><input type="hidden" name="tutor" value="<?= aes_crypt($tutor['id2'], 1) ?>">
									<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="submit" style="margin-top:5px; margin-bottom:5px;">
											聯絡管理員
										</button>
										<div>
											<div class="PayTutorBTN3 btn btn-danger">取消</div>
										</div>
									</div>
								</form>
							</div>

							<div class="ProfileSectionTitle" style="float:left; margin-right:5px;">每堂收費 :</div>
							<div class="AboutMeMessage" style="float:left;">
								<span style="font-size:20px;color: #D90018;">$<span class="money"><?= $payment_charge ?></span></span>
							</div>
							<div style="clear:both;"></div>

							<div class="ProfileSectionTitle">折扣優惠碼 :
								<input type="text" name="code" value="" style="width: 80px;line-height: 100%;">
								<button class="btn btn-default exchange" style="padding: 0px 5px; background-color: #dddddd;">
									兌換
								</button>
							</div>

							<div style="color:#F00; display:none;" class="error" id="couponError">
								請輸入正確的優惠劵號碼
							</div>
							<div style="color:#F00; display:none;" class="error" id="couponError2">
								*$20優惠已滿額,多謝支持。有興趣學習音樂的同學,可以輸入 "INKY50" 以半價體驗兩堂音樂班。
							</div>
							<div style="clear:both;"></div>

							<div class="ProfileSectionTitle" style="float:left; margin-right:5px;font-size:19px;font-weight: bold;">
								總收費 :
							</div>
							<div class="AboutMeMessage" style="float:left;">
								<span class="orgmoney" style="display:none;"><?= $payment_charge ?></span>
								<span style="font-size:14px; color: #000; text-decoration:line-through; display:none;" class="oldprice">$<span class="money"></span></span>
								<span style="font-size:20px;color: #D90018;" class="nowprice">$<span class="money"><?= $payment_charge * 2 ?></span></span>
							</div>
							<div style="clear:both;"></div>

							<button class="PayTutorBTN2 btn btn-primary" type="button" onclick="open_payment_tutor($(this),<?= ($payment_charge * 2) ?>)" style="margin-bottom:5px; margin-top:9px;background-color: #00994B; font-size: 18px; font-weight: bold; border-radius: 15px; border-color: #00994B;padding: 3px 12px;">
								繼續付款
							</button>
						<? } ?>

					<img src="img/payment_method.jpg" alt="" style="width:100%; margin-top:10px;"/></form>
				</div>
			</div>
			<?php */ ?>

		</div>
	</div>
	<div class="Profilecontainer">
		<div class="row">
			<div class="col-sm-8">
				<?php if (!empty($tutor["youtube"])) { ?>
					<div id="youtube" class="ProfileSection">
						<iframe width="100%" height="300" src="https://www.youtube.com/embed/<?= $tutor["youtube"] ?>?rel=0" frameborder="0" allowfullscreen></iframe>
					</div>
				<?php } ?>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("ABOUT ME") ?>
					</div>
					<div class="AboutMeMessage">
						<?= nl2br($tutor["self_intro"]) ?>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("TEACHING VENUE AND MODE") ?>
					</div>
					<div class="TutorSubjects">
						<div class="Subject">
							<?= _lang("VENUE") ?>
							:
							<?php
								if (!empty($teaching_venue)) {
									foreach ($teaching_venue as $key => $row) {
										echo $row["name_" . $langcode];
										if (($key + 1) != count($teaching_venue)) {
											echo ", ";
										}
									}
								}
							?>
						</div>
					</div>
					<div class="TutorSubjects">
						<div class="Subject">
							<?= _lang("MODE") ?>
							:
							<?php
								if (!empty($teaching_mode)) {
									foreach ($teaching_mode as $key => $row) {
										//only show one to one
										if ($row["id"] != 1)
											continue;
										else
											echo $row["name_" . $langcode];

										/*echo $row["name_" . $langcode];
										if (($key + 1) != count($teaching_mode)) {
											echo ", ";
										}*/
									}
								}
							?>
						</div>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("Other Information") ?>
					</div>
					<div class="AboutMeMessage">
						<?php
							echo _lang("Expected Student Age") . ": ";

							foreach ($tutor_expstudentage as $key => $row) {
								echo $row["name_" . $langcode];
								if (($key + 1) != count($tutor_expstudentage)) {
									echo ", ";
								}
							}

							echo "<br>";

							echo _lang("Rent Musical Instruments") . ": " . ($tutor["cansupplyinstrument"] == 1 ? _lang("Provided") : _lang("Not Provided")) . "<br>";
							echo _lang("Accompany") . ": " . ($tutor["canaccompany"] == 1 ? _lang("Provided") : _lang("Not Provided"));
						?>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle" style="padding-bottom: 10px;">
						<?= _lang("Trial Fee") ?>
					</div>
					<div class="AboutMeMessage">
						<?php
							if (!empty($teaching_instrument)) {
								echo '<ul class="nav nav-tabs">';
								foreach ($teaching_instrument as $key => $row) {
									echo '<li class="' . ($key == 0 ? "active" : "") . '"><a href="#instrument_trial_' . $key . '" class="instrument_' . $row["mas_instrument"] . '">' . $row["name_" . $langcode] . '</a></li>';
								}
								echo '</ul>';
							}

							if (!empty($teaching_instrument)) {
								echo '<div class="tab-content">';
								foreach ($teaching_instrument as $key => $row) {
									$tutor_expectcharge = get_tutor_expectcharge($id, $row["mas_instrument"], "tfee");

									echo '<div id="instrument_trial_' . $key . '" class="tab-pane fade ' . ($key == 0 ? "in active" : "") . '">';

									echo '<div class="table-responsive">
											  <table class="table">
											    <thead>
											      <tr>
											        <th width="25%">' . _lang("Grade") . '</th>
											        <th width="25%">' . _lang("30 mins") . '</th>
											        <th width="25%">' . _lang("45 mins") . '</th>
											        <th width="25%">' . _lang("60 mins") . '</th>
											      </tr>
											    </thead>
											    <tbody>';
									foreach ($tutor_expectcharge as $row2) {
										$trail_fee_grade = get_master_type_code("TRIAL_FEE_GRADE", $row2["grade_name"]);

										if ($row2["grade_name"] == 1) {
											$grade_name = '1 - 2';
										} else if ($row2["grade_name"] == 2) {
											$grade_name = '3 - 5';
										}
										$expaypalform1 = '';
										$expaypalform2 = '';
										$expaypalform3 = '';
										$boxform       = '<input type="hidden" name="instrument" value="' . aes_crypt($row2['mas_instrument'], 1) . '"/><input type="hidden" name="level" value="' . aes_crypt($row2["grade_name"], 1) . '"/><input type="hidden" name="tutor" value="' . aes_crypt($tutor['id2'], 1) . '"/><div class="header panel-heading" style="font-size:18px; color: #D90018; font-weight:bold; text-align:center;">優惠體驗班</div><div class="panel-body"><div class="fast_checkout" style="padding: 0px !important;">
                    <div class="ProfileSectionTitle" style="float:left; margin-right:5px; color: #00994B;">樂器 :</div>
                    <div class="AboutMeMessage" style="float:left;">' . $row['name_' . $langcode] . '</div>
                    <div style="clear:both;"></div>

                    <div class="ProfileSectionTitle" style="float:left; margin-right:5px; color: #00994B;">級別 :</div>
                    <div class="AboutMeMessage payment_level" style="float:left;">' . $grade_name . '</div>
                    <div style="clear:both;"></div>

                    <div class="ProfileSectionTitle" style="float:left; margin-right:5px; color: #00994B;">時數 :</div>
                    <div class="AboutMeMessage" style="float:left;"><span class="payment_min"></span>' . lang('mins') . '</div>
                	<div style="clear:both;"></div>

					<div class="ProfileSectionTitle" style="float:left; margin-right:5px; color: #00994B;">堂數 :</div>
					<div class="AboutMeMessage" style="float:left;">2</div>
					<div style="clear:both;"></div>

					<hr style="margin: 8px 0;">
					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;">每堂收費 :</div>
					<div class="AboutMeMessage" style="float:left;">
						<span style="font-size:20px;color: #D90018;">$<span class="orgmoney">60</span></span>
					</div>
					<div style="clear:both;"></div>
					<div class="ProfileSectionTitle">
                    折扣優惠碼 : <input type="text" name="code" value="" style="width: 80px;line-height: 100%; height:23px; margin-left:5px;"><button class="btn btn-default exchange" style="padding: 0px 5px; background-color: #dddddd; margin-left:5px;">兌換</button><div style="color:#F00; display:none;" class="error" id="couponError">' . _lang('請輸入正確的優惠劵號碼') . '</div><div style="color:#F00; display:none;" class="error" id="couponError2">
										*$20優惠已滿額,多謝支持。有興趣學習音樂的同學,可以輸入 "INKY50" 以半價體驗兩堂音樂班。
									</div></div>
					<div class="ProfileSectionTitle" style="float:left; margin-right:5px;font-size: 19px;font-weight: bold;">總收費 :</div>
					<div class="AboutMeMessage" style="float:left;">
									<span style="font-size:14px; color: #000; text-decoration:line-through; display:none;" class="oldprice">$<span class="money"></span></span> <span style="font-size:20px;color: #D90018;" class="nowprice">$<span class="money">120</span></span>
									</div><div style="clear:both;"></div>';
										if ($_SESSION["is_tutor"] != 1 && $_SESSION["is_student"] == 1) {
											$boxform .= '<button class="PayTutorBTN2 btn btn-primary paypal_loading" type="submit" style="margin-bottom:5px; margin-top:10px;">繼續付款</button>';
											$expaypalform2_1 = '';
											$expaypalform2_2 = '';
											$expaypalform2_3 = '';
										} else {
											$boxform .= '<button class="PayTutorBTN2 btn btn-primary " type="button" onclick="open_content_tutor($(this),200)" style="margin-bottom:5px; margin-top:10px;">繼續付款</button>';

											$boxform2        = '<input type="hidden" name="instrument" value="' . aes_crypt($row2['mas_instrument'], 1) . '"/><input type="hidden" name="level" value="' . aes_crypt($row2["grade_name"], 1) . '"/><input type="hidden" name="tutor" value="' . aes_crypt($tutor['id2'], 1) . '"/><div class="header panel-heading" style="white-space: normal; font-size:14px;">請先登入為學生。按<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">' . _lang("Please enter email.") . '</div><div style="color:#F00; display:none;" class="error" id="emailError2">' . _lang("Please check email format.") . '</div><div style="color:#F00; display:none;" class="error" id="emailError3">' . _lang("This email has used by someone.") . '</div></div><div>電話號碼</div><div><input type="text" name="tel" value="" maxlength="8"><div style="color:#F00; display:none;" class="error" id="mobnoError">' . _lang("Please enter mobile number.") . '</div><div style="color:#F00; display:none;" class="error" id="mobnoError2">' . _lang("Mobile number should be digital number.") . '</div></div><div style="clear:both;"></div><button class="PayTutorBTN2 btn btn-primary" type="submit" style="margin-top:5px; margin-bottom:5px;">聯絡管理員</button><div style="clear:both;"></div><div class="PayTutorBTN3 btn btn-danger">取消</div></div>';
											$expaypalform2_1 = '<div class="course_payment_box2"><form action="fastpaypal.php" class="LiAdminMsg" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(30, 1) . '"/>' . $boxform2 . '</form></div>';
											$expaypalform2_2 = '<div class="course_payment_box2"><form action="fastpaypal.php" class="LiAdminMsg" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(45, 1) . '"/>' . $boxform2 . '</form></div>';
											$expaypalform2_3 = '<div class="course_payment_box2"><form action="fastpaypal.php" class="LiAdminMsg" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(60, 1) . '"/>' . $boxform2 . '</form></div>';
										}
										$boxform .= '<div style="clear:both;"></div><div class="PayTutorBTN3 btn btn-danger">取消</div></div></div>';
										/*$expaypalform1 = '<button class="PayTutorBTN" type="button" onClick="open_payment_tutor($(this),' . $row2["charge_30min"] . ',30)">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(30, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;
										$expaypalform2 = '<button class="PayTutorBTN" type="button" onClick="open_payment_tutor($(this),' . $row2["charge_45min"] . ',45)">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(45, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;
										$expaypalform3 = '<button class="PayTutorBTN" type="button" onClick="open_payment_tutor($(this),' . $row2["charge_60min"] . ',60)">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(60, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;*/

										$expaypalform1 = '<button class="PayTutorBTN" type="button" onClick="contact_tutor();">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(30, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;
										$expaypalform2 = '<button class="PayTutorBTN" type="button" onClick="contact_tutor();">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(45, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;
										$expaypalform3 = '<button class="PayTutorBTN" type="button" onClick="contact_tutor();">立即上堂</button><div class="course_payment_box"><form action="fastpaypal.php" class="LiCodeForm" method="post" style="margin-bottom:0px;"><input type="hidden" name="time" value="' . aes_crypt(60, 1) . '"/>' . $boxform . '</form></div>' . $expaypalform2_1;

										echo '<tr>
											  <td>' . ($trail_fee_grade["name_" . $langcode]) . '</td>
											  <td>' . ($row2["charge_30min"] > 0 ? "$" . $row2["charge_30min"] . $expaypalform1 : _lang("N/A")) . '</td>
											  <td>' . ($row2["charge_45min"] > 0 ? "$" . $row2["charge_45min"] . $expaypalform2 : _lang("N/A")) . '</td>
											  <td>' . ($row2["charge_60min"] > 0 ? "$" . $row2["charge_60min"] . $expaypalform3 : _lang("N/A")) . '</td>
										   </tr>';
									}

									echo '</tbody>
											  </table>
											  </div>';
									echo '</div>';
								}
								echo '</div>';
							}
						?>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle" style="padding-bottom: 10px;">
						<?= _lang("Expected Fee") ?>
					</div>
					<div class="AboutMeMessage">
						<?php
							if (!empty($teaching_instrument)) {
								echo '<ul class="nav nav-tabs">';
								foreach ($teaching_instrument as $key => $row) {
									echo '<li class="' . ($key == 0 ? "active" : "") . '"><a href="#instrument_' . $key . '" class="instrument_' . $row["mas_instrument"] . '">' . $row["name_" . $langcode] . '</a></li>';
								}
								echo '</ul>';
							}

							if (!empty($teaching_instrument)) {
								echo '<div class="tab-content">';
								foreach ($teaching_instrument as $key => $row) {
									$tutor_expectcharge = get_tutor_expectcharge($id, $row["mas_instrument"], "fee");

									echo '<div id="instrument_' . $key . '" class="tab-pane fade ' . ($key == 0 ? "in active" : "") . '">';

									echo '<div class="table-responsive">
											  <table class="table">
											    <thead>
											      <tr>
											        <th width="25%">' . _lang("Grade") . '</th>
											        <th width="25%">' . _lang("30 mins") . '</th>
											        <th width="25%">' . _lang("45 mins") . '</th>
											        <th width="25%">' . _lang("60 mins") . '</th>
											      </tr>
											    </thead>
											    <tbody>';
									foreach ($tutor_expectcharge as $row2) {
										echo '<tr>
											        <td>' . $row2["grade_name"] . '</td>
											        <td>' . ($row2["charge_30min"] > 0 ? "$" . $row2["charge_30min"] : _lang("N/A")) . '</td>
											        <td>' . ($row2["charge_45min"] > 0 ? "$" . $row2["charge_45min"] : _lang("N/A")) . '</td>
											        <td>' . ($row2["charge_60min"] > 0 ? "$" . $row2["charge_60min"] : _lang("N/A")) . '</td>
											        </tr>';
									}

									echo '</tbody>
											  </table>
											  </div>';
									echo '</div>';
								}
								echo '</div>';
							}
						?>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle" style="padding-bottom: 10px;">
						<?= _lang("Visit Home Additional Fee") ?>
					</div>
					<div class="AboutMeMessage">
						<?php
							if (!empty($areas)) {
								echo '<ul class="nav nav-tabs">';
								foreach ($areas as $key => $row) {
									echo '<li class="' . ($key == 0 ? "active" : "") . '"><a href="#area_' . $key . '" >' . $row["name_" . $langcode] . '</a></li>';
								}
								echo '</ul>';
							}

							if (!empty($areas)) {
								echo '<div class="tab-content">';

								foreach ($areas as $key => $row) {

									$sql           = "select * from master_type_code where typeid = ? and extra1 = ? and deleted = ?";
									$parameters    = array('RESIDENCE_POSITIONCODE', $row['code'], 0);
									$rows_position = bind_pdo($sql, $parameters, "selectall");

									echo '<div id="area_' . $key . '" class="tab-pane fade ' . ($key == 0 ? "in active" : "") . '">';

									foreach ($teaching_area as $row2) {
										if ($row2["extra1"] == $row["code"]) {
											echo '<div class="col-md-3" ' . ((float)$row2["studenhome_addcharge"] > 0 ? 'style="color: #D90018; font-weight: bold;"' : '') . '>' . $row2["name_" . $langcode] . ' $' . (float)$row2["studenhome_addcharge"] . '</div>';
										}
									}

									echo '</div>';
								}
								echo '</div>';
							}
						?>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("MUSICAL INSTRUMENTS RESUME") ?>
					</div>
					<?php
						if (!empty($instrument_qualification)) {
							foreach ($instrument_qualification as $row) {
								echo '<div class="TutorSubjects">
										<div class="Subject">' . $row["instrument_name"] . '</div>
										<div class="SubjectLevel">' . _lang("Level") . ": " . $row["grade_name"] . '</div>
									</div>';
							}
						}
					?>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle uppercase">
						<a class="fancybox1" href="#accumulate_tutorial_hours" style="text-decoration: none; color: inherit;">
							<?= _lang("Accumulate Tutorial Hours") ?>
							<span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></a></div>
					<div class="SectionContent">
						<div><!--<span class="glyphicon glyphicon-time" aria-hidden="true"></span>-->
							<span class="stars">
								<?= $tutor["stars"] ?>
							</span></div>
						<!--<div><span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span> 15 Positive Review
								</div>-->
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("LAST LOGIN") ?>
					</div>
					<div class="SectionContent">
						<?= get_last_login_date($tutor["cmsloginid"]) ?>
					</div>
				</div>
				<div class="ProfileSection">
					<div class="ProfileSectionTitle">
						<?= _lang("WHERE I TEACH") ?>
					</div>
					<div class="SectionContent">
						<?php
							if (!empty($teaching_area)) {
								foreach ($teaching_area as $row) {
									echo '<li>' . $row["name_" . $langcode] . '</li>';
								}
							}
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php if (isset($_SESSION["cmsloginid"]) && isset($_SESSION["is_student"]) && $_SESSION["is_student"] == 1) { ?>
	<div id="contact_tutor_chat_box" style="display: none; overflow-x: hidden;">
		<div class="row">
			<div class="col-md-12">
				<h3 class="tc">
					<?= _lang("Leave Message for Tutor") ?>
				</h3>
				<?php if (empty($student_post_jobs)) {
					echo "請先<a href='webadmin/student_postjob_form.php'>發求學帖子</a>。<br>";
				} ?>
				<?= _lang("選擇已發出的求學帖子") ?>
				: <select name="job_id" id="job_id">
					<option value="">---
						<?= _lang("Please Select") ?>
						---
					</option>
					<?php
						foreach ($student_post_jobs as $row) {
							echo "<option value='" . $row["studentpostjob_id"] . "'>" . _lang("Job No.") . ": " . $row["postjob_no"] . " " . $row["instrument_name"] . " " . _lang("Level") . ": " . $row["level"] . "</option>";
						}
					?>
				</select> <br> <br>
				<p style="font-size: 16px;">
					<?= _lang("Tutor") . ": " . $tutor["nickname"]; ?>
					,<br>
				</p>
				<textarea style="width:100%;" rows="5" name="content" id="content" placeholder="<?= _lang("Please note the tips below.") ?>"></textarea>
				<div class="tr">
					<div style="font-size: 12px; color: red;">
						<?= _lang("Mobile no, email address and any contact is not allowed during the conversation.") ?>
					</div>
					<button class="ContactTutorBTN" type="button" onclick="contact_tutor_submit();" style="margin-top: 10px;">
						<?= _lang("Submit") ?>
					</button>
				</div>
				<?php if ($_SESSION["wlangcode"] == "en") { ?>
					<p style="color: #0012ff;font-size:12px; font-weight:100;">*Tips:<br> 1) Before confirmation and payment for trial lesson, the tutor and student will
						only have 5 conversation chances <br> 2) We suggest both parties to chat based on the following topics: <br>
						<span style="padding-left: 20px;"></span>a) Learning location &nbsp;&nbsp;&nbsp;b) Lesson time &nbsp;&nbsp;&nbsp;c) Music background &nbsp;&nbsp;&nbsp;d)
						Learning objective &nbsp;&nbsp;&nbsp;e) e) Arrangement of instrument and teaching material </p>
				<?php } else { ?>
					<p style="color: #0012ff;font-size:12px; font-weight:100;">*提示:<br> 1)於付款確定試堂前,導師與學生有5次來回對話機會 <br> 2)我們建議雙方於對話中就以下內容進行商討: <br>
						<span style="padding-left: 20px;"></span>a) 教學地點 &nbsp;&nbsp;&nbsp;b) 上課時間 &nbsp;&nbsp;&nbsp;c) 履歷及背景 &nbsp;&nbsp;&nbsp;d) 學習目的 &nbsp;&nbsp;&nbsp;e)
						教材及樂器安排 </p>
				<?php } ?>
			</div>
		</div>
	</div>
<?php } ?>
<div id="accumulate_tutorial_hours" style="display:none;">
	<h4><b>累積上課時數</b></h4>
	<p> 導師跟學生於MusicCircle進行配對後,會開始學習階段。當中每次透過MusicCircle 付款的時數,都會記錄於MusicCircle的系統內,導師累積時數愈多,導師排名愈高。 </p>
	<h4><b>累積時數的星級分配</b></h4>
	<p> MusicCircle會每天總結導師的累積時數,並按比例地分配各導師所得的星級,比例如下: </p>
	<table id="accumulate_tutorial_hours_table">
		<tr>
			<th>星級</th>
			<th class="nowrap">導師比例</th>
			<th>例子(以100位導師計算)</th>
		</tr>
		<tr>
			<td><span class="stars">5</span></td>
			<td>20% (最高)</td>
			<td>累積時數排名第1-20位</td>
		</tr>
		<tr>
			<td><span class="stars">4</span></td>
			<td>30%</td>
			<td>累積時數排名第21-50位</td>
		</tr>
		<tr>
			<td><span class="stars">3</span></td>
			<td>30%</td>
			<td>累積時數排名第51-80位</td>
		</tr>
		<tr>
			<td><span class="stars">2</span></td>
			<td>10%</td>
			<td>累積時數排名第81-90位</td>
		</tr>
		<tr>
			<td><span class="stars">1</span></td>
			<td>10%</td>
			<td>累積時數排名第91-100位</td>
		</tr>
	</table>
</div>

<div id="loading"><img src="img/loading_icon.gif" style="width: 100px;"></div>

<? include('_footer.php') ?>
<link rel="stylesheet" href="js/fancybox/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen"/>
<script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript">
	$(document).ready(function () {
		if ($("input[name='code']").val()) {
			$("input[name='code']").parent().children(".exchange").trigger("click");
		}

		$(".nav-tabs a").click(function () {
			$(this).tab('show');
		});
		$('.nav-tabs a').on('shown.bs.tab', function (event) {
			var x = $(event.target).text();         // active tab
			var y = $(event.relatedTarget).text();  // previous tab
			$(".act span").text(x);
			$(".prev span").text(y);
		});

		<?php if(isset($_GET["category_id"]) && (int)$_GET["category_id"] > 0){ ?>
		$("body").find(".instrument_<?=(int)$_GET["category_id"]?>").click();
		<?php } ?>

		$(".fancybox1").fancybox({
			maxWidth: 800,
			maxHeight: 350,
			fitToView: false,
			width: '100%',
			height: '100%',
			autoSize: false,
			closeClick: false,
			openEffect: 'none',
			closeEffect: 'none'
		});

		//paypal loading
		$(".paypal_loading").on("click", function () {
			$('#loading').slideDown(100);
		});
	});
	$('.fast_checkout .exchange').click(
		function () {
			var thisform = $(this).parent();
			var fee = Number($('.orgmoney', thisform.parent()).html());
			var coupon_code = $('input[name="code"]', thisform).val();
			jQuery.ajax({
				url: '_ajax.php',
				type: 'POST',
				data: {
					ajax: "coupon",
					limit_type: 'try',
					fee: (fee * 2),
					coupon: coupon_code
				},
				dataType: 'html', //dataType (default: Intelligent Guess (xml, json, script, or html))
				timeout: 1000,
				error: function (result) {
					//alert('Error Occur. Please try again.');
					//console.log(result.responseText);
				},
				success: function (json) {
					var json = JSON.parse(json);
					console.log(json);
					if (json.status == false) {
						if (coupon_code.toUpperCase() == "INKY20" || coupon_code.toUpperCase() == "IMC$20") {
							$('#couponError2', thisform.parent()).show();
						} else {
							$('#couponError', thisform.parent()).show();
						}

						$('.oldprice', thisform.parent()).hide();
						$('.nowprice .money', thisform.parent()).html(fee * 2);
					} else if (json.status == true) {
						$('#couponError', thisform.parent()).hide();
						$('#couponError2', thisform.parent()).hide();
						$('.oldprice', thisform.parent()).show();
						$('.oldprice .money', thisform.parent()).html(fee * 2);
						$('.nowprice .money', thisform.parent()).html(json.total);
					}
				}
			});
			return false;
		}
	);
	$('#LiProfileAdminMsg').submit(
		function () {
			var error = false;
			$('.error', this).hide();
			if (!$('textarea[name="msg"]', this).val()) {
				$("#msgError", this).show();
				error = true;
			}
			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;
			}
		}
	);
	$('.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;
			}
		}
	);
	$('.PayTutorBTN3').click(
		function () {
			$(this).parent().parent().parent().parent().hide();
			$('#LiFullbg').hide();
		}
	);
	function open_content_tutor(thisform) {
		//$('#LiFullbg').show();
		$('.course_payment_box,.course_payment_box .error').hide();
		$('.course_payment_box2', thisform.parent().parent().parent().parent().parent()).show();
	}
	function open_payment_tutor(thisform, money, time) {
		return;
		$('#LiFullbg').show();
		$('.course_payment_box input[name="code"]').val('');
		$('.course_payment_box .error').hide();
		$('.course_payment_box .oldprice').hide();
		$('.course_payment_box,.course_payment_box .error').hide();
		$('.course_payment_box', thisform.parent()).show();
		$('.course_payment_box .payment_min').html(time);
		$('.course_payment_box .orgmoney', thisform.parent()).html(money);
		$('.course_payment_box .nowprice .money', thisform.parent()).html((money * 2));
	}
	function payment_tutor(time, instrument, level, tutor) {
		if (confirm('你確認購買嗎?')) {
			location.href = 'fastpaypal.php?time=' + time + '&instrument=' + instrument + '&level=' + level + '&tutor=' + tutor;
		}
	}
	function contact_tutor() {
		<?php if($detect->isMobile() && !$detect->isTablet() && !isset($_SESSION["request_pc"]) && !isset($_SESSION["cmsloginid"])) { ?>
		location.href = "index_user.php";
		return false;
		<?php } else{ ?>
		//check if user login
		<?php
		if(!isset($_SESSION["cmsloginid"])){?>
		$('#LiFullbg').show();
		$('#course_payment_box .error').hide();
		$('#course_payment_box').show();
		<?
		//echo "alert('" . _lang("Please login first. If you have any problem, you can call 9446 0817 with Whatsapp to contact us.") . "'); return;";
		}else if(!isset($_SESSION["is_student"]) || $_SESSION["is_student"] == 0){
		echo "alert('" . _lang("You are not a student. You cannot contact tutor.") . "'); return;";
	}else {
		?>
		//popup box
		$.fancybox({
			//settings
			'type': 'inline',
			'maxWidth': 800,
			'maxHeight': 420,
			'fitToView': false,
			'width': '90%',
			'height': '90%',
			'autoSize': false,
			'closeClick': false,
			'openEffect': 'none',
			'closeEffect': 'none',
			'href': '#contact_tutor_chat_box'
		});
		<?php } ?>
		<?php } ?>


	}

	function contact_tutor_submit() {
		var tutor_id = <?=!empty($id) ? $id : ""?>;
		var content = $("#content").val();
		var job_id = $("#job_id").val();

		if (!job_id) {
			alert("<?=_lang("Please select job.");?>");
			return;
		}

		if (!tutor_id) {
			alert("<?=_lang("Cannot find tutor id.");?>");
			return;
		}

		if (!content) {
			alert("<?=_lang("Please enter message.");?>");
			return;
		}

		jQuery.ajax({
			url: '_ajax.php',
			type: 'POST',
			data: {
				ajax: "contact_tutor_submit",
				job_id: job_id,
				tutor_id: tutor_id,
				content: content,
			},
			dataType: 'html', //dataType (default: Intelligent Guess (xml, json, script, or html))
			timeout: 1000,
			error: function (result) {
				alert('Error Occur. Please try again.');
				console.log(result.responseText);
			},
			success: function (result) {
				//$('#loading').slideUp(100);
				//console.log(result);
				alert(result);
				$.fancybox.close();
			}
		});
	}

	function resizeImage() {
		//console.log($(window).width());
		if ($(window).width() <= 768) {
			$(".tutor_img").hide();
			$(".tutor_img2").show();
		} else {
			$(".tutor_img").show();
			$(".tutor_img2").hide();
		}

		//$(".tutor_img2").show();
	}

	resizeImage();

	$(window).resize(function () {
		resizeImage();
	});

	$(function () {
		$("#job_id").on("change", function () {

			var job_id = $(this).val(), tutor_id = "<?=$id?>";

			jQuery.ajax({
				url: '_ajax.php',
				type: 'POST',
				data: {
					ajax: "check_contact",
					job_id: job_id,
					tutor_id: tutor_id,
				},
				dataType: 'html', //dataType (default: Intelligent Guess (xml, json, script, or html))
				timeout: 1000,
				error: function (result) {
					//alert('Error Occur. Please refresh and try again.');
					console.log(result.responseText);
				},
				success: function (result) {
					//$('#loading').slideUp(100);
					//console.log(result);
					var json = result,
						obj = JSON.parse(json);

					if (obj.error == 1) {
						alert("Missing job id or tutor id.");
					} else {
						if (obj.matched_musical_instrument) {
							if (parseInt(obj.count_chat) > 0) {
								location.href = "webadmin/chat_index.php?type=1&first_chat_id=" + obj.first_chat_id;
							} else {

							}
						} else {
							$("#job_id").val("");

							alert("<?=_lang("Your job requirement does not match teaching musical instruments of tutor. You do not allow to chat with tutor.")?>");

							$.fancybox.close();

						}
					}
					//alert(result);
				}
			});
		});

		$.fn.stars = function () {
			return $(this).each(function () {
				$(this).html($('<span />').width(Math.max(0, (Math.min(5, parseFloat($(this).html())))) * 16));
			});
		};

		$('span.stars').stars();

		$("#fancybox_profile_img").fancybox({});
	});

	function _login() {
		$(".course_payment_box,.course_payment_box2").hide();
		$("#LiLoginMenu").click();
		$("#LiFullbg").hide();
	}
	<? if($_SESSION['profile_msg'] == true){?>
	alert('你的聯絡資料已被記錄,我們將盡快與你聯絡。');
	<? unset($_SESSION['profile_msg']); }?>
</script>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit