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
|
<?php $page_settings = array( 'formid' => 'Tutor_search', // for permission 'section' => 'Master', // parent/page title 'subsection' => 'Course Search', // page title 'domain' => 'tutor_search', // table/model name 'access' => 'GNr', // for permission );
require_once "check_login.php";
if (isset($_GET["reset"]) && $_GET["reset"] == 1 || !empty($_GET["student_postjob_id"])) { unset($_SESSION["tutor_search"]); }
if ($_SESSION["is_student"] != 1 && $_SESSION["cmsrole"] == "user") { //add alert message header("Location: index.php"); } else { //get this student info $sql = "select * from student_main where cmsloginid = ?"; $parameters = array($_SESSION["cmsloginid"]); $student = bind_pdo($sql, $parameters, "selectone");
//get post list $sql = "select * from student_postjob where studentmain_id = ? and status =? and deleted = ?"; $parameters = array($student["id"], 1, 0); $posts = bind_pdo($sql, $parameters, "selectall"); }
if ($_SESSION["cmsrole"] == "super_admin" || $_SESSION["cmsrole"] == "admin") { //get student list $sql = "select * from student_main where status = ? and deleted = ?"; $parameters = array(4, 0); $students = bind_pdo($sql, $parameters, "selectall");
//get post list $sql = "select * from student_postjob where status =? and deleted = ?"; $parameters = array(1, 0); $posts = bind_pdo($sql, $parameters, "selectall"); } $level_of_grades = get_master_type_code("LEVEL_OF_GRADE"); $music_theory_grades = get_master_type_code("MUSTHEORY_GRADE"); $locations = get_master_type_code("TEACH_POSITIONCODE"); $all_instruments = get_master_type_code("INSTRUMENT"); $teach_venues = get_master_type_code("TEACH_VENUS"); $teach_modes = get_master_type_code("TEACH_MODE"); $instrument_categories = get_master_type_code("INSTRUMENT_TYPE");
$_30min_fee = 0; $_30max_fee = 9999; $_45min_fee = 0; $_45max_fee = 9999; $_60min_fee = 0; $_60max_fee = 9999; $tutorreq_age_min = 0; $tutorreq_age_max = 100;
//get post request if (!empty($_GET["studentmain_id"]) && !empty($_GET["student_postjob_id"])) { //set value in filter form $studentmain_id = (int)$_GET["studentmain_id"]; $student_postjob_id = (int)$_GET["student_postjob_id"];
$sql = "select * from student_postjob where student_postjob.studentmain_id = ? and student_postjob.id = ? and student_postjob.deleted = ?"; $parameters = array($studentmain_id, $student_postjob_id, 0); $postjob = bind_pdo($sql, $parameters, "selectone");
$category_id = $postjob["mas_instrument"]; $_SESSION["tutor_search"]["category_id"] = $postjob["mas_instrument"]; $require_tutor_gender = $postjob["tutorreq_gender"]; $_SESSION["tutor_search"]["tutorreq_gender"] = $postjob["tutorreq_gender"]; $require_tutor_instrument_level = $postjob["level"]; //LEVEL OF GRADE $_SESSION["tutor_search"]["level"] = $postjob["level"]; /*$require_tutor_theory_level = $postjob["tutorreq_level"]; //theory grade $_SESSION["tutor_search"]["tutorreq_level"] = $postjob["tutorreq_level"];*/ $require_tutor_age_min = $postjob["tutorreq_age_min"]; $_SESSION["tutor_search"]["tutorreq_age_min"] = $postjob["tutorreq_age_min"]; $require_tutor_age_max = $postjob["tutorreq_age_max"]; $_SESSION["tutor_search"]["tutorreq_age_max"] = $postjob["tutorreq_age_max"];
$sql = "select mas_teachareacode from student_postjoblearndistrict where studentpostjob_id = ? and deleted = ?"; $parameters = array($student_postjob_id, 0); $require_tutor_mas_teachareacode = bind_pdo($sql, $parameters, "selectall"); foreach ($require_tutor_mas_teachareacode as $row) { $_SESSION["tutor_search"]["tutor_mas_teachareacode"][] = $row["mas_teachareacode"]; }
$sql = "select mas_teachmode from student_postjoblearnmode where studentpostjob_id = ? and deleted = ?"; $parameters = array($student_postjob_id, 0); $require_tutor_mas_teachmode = bind_pdo($sql, $parameters, "selectall"); foreach ($require_tutor_mas_teachmode as $row) { $_SESSION["tutor_search"]["tutor_mas_teachmode"][] = $row["mas_teachmode"]; }
$sql = "select mas_teachvenus from student_postjoblearnvenus where studentpostjob_id = ? and deleted = ?"; $parameters = array($student_postjob_id, 0); $require_tutor_mas_teachvenus = bind_pdo($sql, $parameters, "selectall"); foreach ($require_tutor_mas_teachvenus as $row) { $_SESSION["tutor_search"]["tutor_mas_teachvenus"][] = $row["mas_teachvenus"]; } }
if (isset($_SESSION["tutor_search"]["30mins_min_budget"]) && isset($_SESSION["tutor_search"]["30mins_max_budget"])) { $_30min_fee = $_SESSION["tutor_search"]["30mins_min_budget"]; $_30max_fee = $_SESSION["tutor_search"]["30mins_max_budget"]; }
if (isset($_SESSION["tutor_search"]["45mins_min_budget"]) && isset($_SESSION["tutor_search"]["45mins_max_budget"])) { $_45min_fee = $_SESSION["tutor_search"]["45mins_min_budget"]; $_45max_fee = $_SESSION["tutor_search"]["45mins_max_budget"]; }
if (isset($_SESSION["tutor_search"]["60mins_min_budget"]) && isset($_SESSION["tutor_search"]["60mins_max_budget"])) { $_60min_fee = $_SESSION["tutor_search"]["60mins_min_budget"]; $_60max_fee = $_SESSION["tutor_search"]["60mins_max_budget"]; }
if (isset($_SESSION["tutor_search"]["tutorreq_age_min"]) && isset($_SESSION["tutor_search"]["tutorreq_age_max"])) { $tutorreq_age_min = $_SESSION["tutor_search"]["tutorreq_age_min"]; $tutorreq_age_max = $_SESSION["tutor_search"]["tutorreq_age_max"]; } ?> <!DOCTYPE html> <html> <head> <?php require_once "_html_head.php"; ?> <link rel="stylesheet" href="css/tutor_student_search.css">
</head> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> <?php require_once "_header.php"; ?> <?php require_once "_menu.php"; ?>
<!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> <?= _lang($page_settings['subsection']) ?> <small> <?= _lang("Index") ?> </small> </h1> <ol class="breadcrumb"> <li> <?= _lang("Home") ?> </li> <li class="active"><a href="<?= $page_settings['domain'] ?>_index.php"><i class="fa"></i> <?= _lang($page_settings['subsection']) ?> </a></li> </ol> </section>
<!-- Main content --> <section class="content">
<!-- Your Page Content Here -->
<!-- main table --> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-body"> <iframe src="../course_category.php" style="width: 100%;overflow: hidden; visibility: hidden" frameborder="0" id="course_category_iframe" onload="resizeIframe(this)"></iframe> </div> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </section> </div> <!-- /.row -->
<!-- End of Your Page Content Here -->
<!-- /.content --> </div> <!-- /.content-wrapper -->
<?php require_once "_footer.php"; ?> <?php require_once "_aside.php"; ?> </div> <!-- ./wrapper -->
<div id="loading"><img src="../img/loading_icon.gif" style="width: 100px;"></div>
<!-- REQUIRED JS SCRIPTS --> <?php require_once "_html_script.php"; ?> <!--<link href="../css/agency.css" rel="stylesheet">--> <link href="../css/bootstrap-slider.css" rel="stylesheet"> <script src="../js/bootstrap-slider.js"></script> <script src="../js/jquery.dotdotdot.min.js"></script> <script src="../js/select2/select2.min.js"></script> <link href="../js/select2/select2.min.css" rel="stylesheet"> <script src="js/jquery.chained.min.js"></script> <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"> function resizeIframe(iframe) { iframe.height = iframe.contentWindow.document.body.scrollHeight + "px"; $("#course_category_iframe").contents().find("nav").remove(); $("#course_category_iframe").contents().find(".Categoryheader").remove(); $("#course_category_iframe").contents().find(".footer").remove(); $("#course_category_iframe").contents().find(".FooterBlack").remove(); $("#course_category_iframe").contents().find("#back-to-top").remove(); $("#course_category_iframe").contents().find("#footer_whatsapp").remove(); $("#course_category_iframe").contents().find("#chat-application").remove(); $("#course_category_iframe").contents().find("#chat-application-iframe").remove(); $("#course_category_iframe").contents().find(".page_breadcrumbs").parent().remove(); $("#course_category_iframe").contents().find("body").css("overflow-x", "hidden"); $("#course_category_iframe").css("visibility", "visible"); }
$(function () { /*$('#course_category_iframe').load(function(){
});*/ });
function tutor_search(start) { return true; $('#loading').slideDown(100);
if (!start) start = 0; //$('#loading').slideDown(100); //console.log("filter tutor"); var quick_search = $("#quick_search").val(); var category_id = $("#category_id").val(); //instrument var level = $("#level").val();
console.log(level);
//tutorreq_gender = JSON.stringify(tutorreq_gender);
var sort_by = $("input[name='sort_by']:checked").val();
jQuery.ajax({ url: '_ajax.php', type: 'POST', data: { ajax: "course_search", quick_search: quick_search, category_id: category_id, level: level, sort_by: sort_by, start: start }, dataType: 'html', //dataType (default: Intelligent Guess (xml, json, script, or html)) timeout: 10000, error: function (result) { //console.log(result); console.log(result.responseText); //alert('Error Occur. Please try again.'); //location.href="tutor_search_index.php?reset=1"; }, success: function (result) { $('#loading').slideUp(100); //console.log(result); if (result == "FAIL") { alert("Access Denied!"); } else { $("#tutor_list").empty().html(result);
$(".start").on("click", function () { var start = $(this).attr("data-value"); tutor_search(start); });
//resizeImage();
//text overflow $(".self_describemyself").dotdotdot();
$.fn.stars = function () { return $(this).each(function () { $(this).html($('<span />').width(Math.max(0, (Math.min(5, parseFloat($(this).html())))) * 16)); }); };
$('span.stars').stars(); }
$(".fancybox1").fancybox({ maxWidth: 800, maxHeight: 290, fitToView: false, width: '100%', height: '100%', autoSize: false, closeClick: false, openEffect: 'none', closeEffect: 'none' }); } });
}
$(function () { <?php if ($_SESSION["cmsrole"] == "super_admin" || $_SESSION["cmsrole"] == "admin") { echo '$("#student_postjob_id").chained("#studentmain_id");'; } ?>
$("#30mins_charge, #45mins_charge, #60mins_charge, #tutor_age").slider({});
$("#studentmain_id, #student_postjob_id").on("change", function () { //reload page var studentmain_id = $("#studentmain_id").val(); var student_postjob_id = $("#student_postjob_id").val(); //instrument location.href = 'tutor_search_index.php?studentmain_id=' + studentmain_id + '&student_postjob_id=' + student_postjob_id; //tutor_search(); });
//filter quick search $("#quick_search_submit").on("click", function () { tutor_search(); });
/*$("#category_id, #level, #tutorreq_level, #tutor_mas_teachareacode, #tutor_mas_teachvenus, #tutor_mas_teachmode").on("change", function () { tutor_search(); });*/
$("#category_id, #level, #tutor_mas_teachareacode, #tutor_mas_teachvenus, #tutor_mas_teachmode").on("change", function () { tutor_search(); });
//filter page //$(".start").on("click", function () { $(".start").on("click", function () { var start = $(this).attr("data-value"); tutor_search(start); });
//center image /*resizeImage();
$(window).resize(function () { resizeImage(); });*/
//text overflow $(".self_describemyself").dotdotdot();
//change select $("#category_id").select2({ width: "100%" });
$("#level").select2({ width: "100%" });
/*$("#tutorreq_level").select2({ disable_search: true, width: "100%" });*/
$("#tutor_mas_teachareacode").select2({ width: "100%", placeholder: "<?=_lang("Select Some Options")?>" });
$("#tutor_mas_teachvenus").select2({ width: "100%", placeholder: "<?=_lang("Select Some Options")?>" });
$("#tutor_mas_teachmode").select2({ width: "100%", placeholder: "<?=_lang("Select Some Options")?>" });
tutor_search(); //auto run the first time filter tutor
});
</script> </body> </html>
|