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
|
<?php require_once "check_login.php";
$page_settings['domain'] = "course";
$nowtime = time(); //$nowtime = strtotime('2016-11-01');
$sql = "select profile_id,user_id from `profile_user` as tb where user_id = ? and deleted = ? LIMIT 1"; $parameters = array($_SESSION['cmsloginid'],0); $row_profile = bind_pdo($sql, $parameters, "selectone");
$row = get_course_detail((int)$_GET['id']);
if($row_profile['profile_id'] == 4){ $page_settings = array( 'formid' => 'Co2', // for permission 'section' => 'Master', // parent/page title 'subsection' => 'Lesson Detail', // page title 'domain' => 'course', // table/model name 'access' => 'GNu', // for permission ); $sql99 = "select id from `student_main` where cmsloginid = ? LIMIT 1"; $parameters99 = array((int)$row_profile['user_id']); $row_user = bind_pdo($sql99, $parameters99, "selectone");
if($row_user['id'] != $row['studentmain_id']){ $path = $page_settings['domain'].'_index.php'; @header("Location: {$path}"); echo "<script language='JavaScript'>window.location='{$path}'</script>"; } }else if($row_profile['profile_id'] == 3){ $page_settings = array( 'formid' => 'Co1', // for permission 'section' => 'Master', // parent/page title 'subsection' => 'Tutorial History', // page title 'domain' => 'course', // table/model name 'access' => 'GNu', // for permission ); $sql99 = "select id from `tutor_main` where cmsloginid = ? LIMIT 1"; $parameters99 = array((int)$row_profile['user_id']); $row_user = bind_pdo($sql99, $parameters99, "selectone"); if($row_user['id'] != $row['tutormain_id']){ $path = $page_settings['domain'].'_index.php'; @header("Location: {$path}"); echo "<script language='JavaScript'>window.location='{$path}'</script>"; } }
if($row){ $action = 'Modify'; // Add or Modify
$sql99 = "SELECT * FROM sys_cms_login WHERE cmsloginid=?"; $parameters99 = array((int)$row{'cmsloginid'}); $row_user = bind_pdo($sql99, $parameters99, "selectone"); }else{ //$action = 'Add'; // Add or Modify $path = $page_settings['domain'].'_index.php'; @header("Location: {$path}"); echo "<script language='JavaScript'>window.location='{$path}'</script>"; exit(); }
$sql = "select postjob_no,mas_instrument from student_postjob where id = ? and deleted = ?"; $parameters = array($row['job_id'],0); $row_job = bind_pdo($sql, $parameters, "selectone");
$sql = "select tutor_no,nickname as name from tutor_main where id = ? and deleted = ?"; $parameters = array($row['tutormain_id'],0); $row_tutor = bind_pdo($sql, $parameters, "selectone");
$sql = "select student_no,contactname as name from student_main where id = ? and deleted = ?"; $parameters = array($row['studentmain_id'],0); $row_student = bind_pdo($sql, $parameters, "selectone");
$sql = "select name_cn from master_type_code where id = ? and typeid = ? and deleted = ?"; $parameters = array($row['mas_residencecode'],'TEACH_POSITIONCODE',0); $row_positioncode = bind_pdo($sql, $parameters, "selectone");
$sql = "select name_cn from master_type_code where id = ? and typeid = ? and deleted = ?"; $parameters = array($row['course_venus'],'TEACH_VENUS',0); $row_venus = bind_pdo($sql, $parameters, "selectone");
$sql = "select name_cn from master_type_code where id = ? and typeid = 'INSTRUMENT' LIMIT 1"; $parameters = array($row_job['mas_instrument']); $row_instrument = bind_pdo($sql, $parameters, "selectone");
?> <!DOCTYPE html> <html> <head> <?php require_once "_html_head.php"; ?> </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($action == "Add" ? "Create" : "Update") ?> </small> </h1> <ol class="breadcrumb"> <li> <?= _lang("Home") ?> </li> <li> <a href="<?= $page_settings['domain'] ?>_index.php?category_id=<?= (int)$_GET["category_id"] ?>&msg=4"><i class="fa"></i> <?= _lang($page_settings['subsection']) ?> </a></li> </ol> </section>
<!-- Main content --> <section class="content">
<!-- Your Page Content Here -->
<!-- main form --> <form action="<?= $page_settings['domain'] ?>_process.php" class="myform" id="myform" method="POST" enctype="multipart/form-data"> <? if($row['id']){?> <input type="hidden" name="id" value="<?= _h($row['id2']) ?>"/> <? }?> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <div class="col-md-4"> <div class="btn-group"> <? if($row_profile['profile_id'] == 1 || $row_profile['profile_id'] == 2){?> <a href="order_form.php?id=<?=$row['id']?>" class="btn btn-default"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?= _lang('Back') ?> </a> <? }else{?> <a href="<?= $page_settings['domain'] ?>_index.php" class="btn btn-default"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?= _lang('Back') ?> </a> <? }?> <? if($row_profile['profile_id'] == 3){?> <? if($nowtime > strtotime($row['datetime'])){?> <? if($row['tutor_status']==0){?> <input type="hidden" name="tutor_status" value="1"/> <button class="btn btn-default btn-warning" type="submit" style="color:#FFF;"> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> 確認上課</button> <? }else{?> <button class="btn btn-default btn-success" type="button" style="color:#FFF;"> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> 已上課</button> <? }?> <? }?> <? }else if($row_profile['profile_id'] == 4 && $row['student_status']==0){?> <? if($nowtime > strtotime($row['datetime'])){?> <input type="hidden" name="student_status" value="1"/> <button class="btn btn-default btn-warning" type="button" style="color:#FFF;" onclick="if(confirm('確定投訴課堂?')){$('#myform').submit();}"> <i class="glyphicon glyphicon-remove-sign" aria-hidden="true"></i> 投訴課堂</button> <? }?> <? }?> <?php if( ($row_profile['profile_id'] == 1 || $row_profile['profile_id'] == 2) && $row["tutor_status"] == 1 && $row["deduct_tutorial_mins"] == 0){ ?> <input type="hidden" name="deduct_tutorial_mins" value="1"/> <button class="btn btn-danger" type="button" style="color:#FFF;" onclick="if(confirm('確定扣減上課時數?')){$('#myform').submit();}"> <i class="glyphicon glyphicon-remove-sign" aria-hidden="true"></i> 扣減上課時數</button> <?php } ?> <?php if(($row_profile['profile_id'] == 1 || $row_profile['profile_id'] == 2) && $row["student_status"] == 1 && $row["solution_status"] == 0){?> <input type="hidden" name="solution_status" value="1"/> <button class="btn btn-warning" type="button" style="color:#FFF;" onclick="if(confirm('確定已解決問題?')){$('#myform').submit();}"> <i class="glyphicon glyphicon-ok-sign" aria-hidden="true"></i> 確認解決投訴問題</button> <?php } ?> </div> <!-- <div class="col-md-6"> <h3 class="box-title"><?= _h($row["name_{$_SESSION["wlangcode"]}"]) ?> (<?= _h($row["code"]) ?>)</h3> </div> <div class="col-md-3"> <em><?= _lang('Updated') ?>: <time><?= _h($row["lastupdate"]) ?></time> (<?= _h($row["lastupby"]) ?>)</em> </div> --> </div> </div> <!-- /.box-header --> <div class="box-body"> <table width="100%" border="0" cellpadding="0" cellspacing="2"> <tr> <th width="120" align="right" valign="top" height="40" style="text-align:right;"><?=lang("Order No.") ?></th> <td valign="top" class=''> </td> <td valign="top" class=''><div class="col-sm-8 form-group"> <?=$row['order_no']?> </div></td> </tr> <tr> <th width="120" align="right" valign="top" height="40" style="text-align:right;"><?=lang("工作號碼") ?></th> <td valign="top" class=''> </td> <td valign="top" class=''><div class="col-sm-8 form-group"> <?=$row_job['postjob_no']?> - <?=$row_instrument['name_cn']?> </div></td> </tr> <tr> <th width="120" align="right" valign="top" height="40" style="text-align:right;">學生</th> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row_student['student_no']?> <?=$row_student['name']?> </div></td> </tr> <tr> <th width="120" align="right" valign="top" height="40" style="text-align:right;">導師</th> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row_tutor['tutor_no']?> <?=$row_tutor['name']?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>上課地區</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row_positioncode["name_cn"]?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>上課地區</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row_venus['name_cn']?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>學習級數</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <? if($row['order_type'] == 'try'){ if ($row['level'] == 1) { echo '1 - 2'; }elseif ($row['level'] == 2) { echo '3 - 5'; }elseif ($row['level'] == 3) { echo _lang("6 or above 6"); } }else if($row['order_type'] == 'formal'){ if ($row['level'] < 8) { echo $row['level']; }else if($row['level'] == 9){ echo '8級以上'; } } ?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>學習時間長度</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row['course_length']?> <?=_lang("mins")?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>學習堂數</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row['course_count']?> </div></td> </tr> <tr> <td width="120" align="right" valign="top" class=''>上課日期 / 時間</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <?=$row['datetime']?> </div></td> </tr> <? if($row_profile['profile_id'] == 4 && $nowtime > strtotime($row['datetime'])){?> <tr> <td width="120" align="right" valign="top" class=''>投訴內容</td> <td width="5" valign="top" class=''>: </td> <td class=''><div class="col-sm-8 form-group"> <? if($row['complaint']){?> <?=nl2br($row['complaint'])?> <? }else{?> <textarea name="complaint" cols="50" class="form-control" maxlength="10"><?=$row['complaint']?></textarea> <div style="color:#F00; display:none;" class="error" id="complaintError"><?=_lang("請輸入你的投訴內容")?></div> <? }?> </div></td> </tr> <? }?> <?php if( ($_SESSION["cmsrole"] == "super_admin" || $_SESSION["cmsrole"] == "admin") && $row["tutor_status"] == 1 && $row["deduct_tutorial_mins"] == 1){ ?> <tr> <th width="120" align="right" valign="top" height="40" style="text-align:right;">備註</th> <td valign="top" class=''> </td> <td valign="top" class=''> <div class="col-sm-8 form-group"> 已扣減上課時數 <?=$row["deduct_tutorial_mins_date"]?> </div> </td> </tr> <?php } ?> </table> <!-- End Content --> </td> </tr> <tr> <td align="left" valign="middle"> </td> </tr> </table> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </form>
<!-- End of Your Page Content Here -->
</section> <!-- /.content --> </div> <!-- /.content-wrapper -->
<?php require_once "_footer.php"; ?> <?php require_once "_aside.php"; ?> </div> <!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS --> <?php require_once "_html_script.php"; ?> </body> <? if($row_profile['profile_id'] == 4){?> <script type="text/javascript"> $('textarea[name="complaint"]').keydown( function(){ if($(this).val().length >= 600){ return false; } } ); $('#myform').submit( function(){ var error = false; $('#couponError').hide(); if(!$('textarea[name="complaint"]').val()){ error = true; $('#complaintError').show(); } if(error == false){ return true; }else{ return false; } } ); </script> <? }?> </html>
|