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
|
<?php include('_init.php');
if ($_SESSION["is_student"] != 1) { header("Location: index.php"); exit; }
$student = get_student($_SESSION["student_login"]); if(empty($student) || $student["status"] != 4 || $student["approved"] != 1){ echo "<script>alert('請先完善你的檔案。'); location.href='student_profile.php';</script>"; exit; }
$page_settings['domain'] = "student_postjob";
$sql = "select profile_id,(select id from `student_main` where cmsloginid = tb.user_id LIMIT 1) as 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");
if ($row_profile['profile_id'] == 4) { /*$sql = "select count(*) as count from student_postjob as tb where studentmain_id = ? and deleted = ? and (select count(*) from `order` where job_id = tb.id and deleted = 0 and `status` = 'paid') = 0 order by createdate DESC"; $parameters = array($row_profile['id'], 0); $count_product = bind_pdo($sql, $parameters, "selectone");*/
$sql = "select *,(select count(*) from `order` where job_id = tb.id and deleted = 0 and (order_type = ? or order_type = ?)) as count from student_postjob as tb where studentmain_id = ? and deleted = ? order by createdate DESC"; $parameters = array("try", "formal", $row_profile['id'], 0); $all_job_info = bind_pdo($sql, $parameters, "selectall");
$sql = "select * from `order` where studentmain_id = ? and deleted = ? and (order_type = ? or order_type = ?) order by createdate desc"; $parameters = array($_SESSION["student_login"], 0, "try", "formal"); $all_order_info = bind_pdo($sql, $parameters, "selectall"); } ?> <!DOCTYPE html> <html lang="en"> <head> <?php include('_head.php'); ?> <link href="css/style_k.css?v=<?= time(); ?>" type="text/css" rel="stylesheet"> </head>
<body> <?php include('_header.php') ?>
<?php include('_dialog.php') ?>
<div class="ProfileContent"> <div class="Profilecontainer"> <div class="row"> <div class="col-md-12">
<p id="post_jobs_desc"> 同學可查看已發帖子及課堂記錄,得知帖子及課堂最新動態! </p>
<div class="post_job_tab"> <a href="student_postjob_form.php"> <div class="post_job_tab_1 tc"> <?= _lang("Post") ?> </div> </a>
<a href="student_postjob_index.php"> <div class="post_job_tab_2 tc active"> <?= _lang("Posted")." / "._lang("Lesson Record") ?>
<div style="position: relative; display: none;" class="unread_order_container"> <span class="badge" style="background: #CC1342; position: absolute; top: -15px; left: -8px;"></span> </div> </div> </a> </div>
<!--<div class="scroll_left_right_container"> <div class="scroll_left_right"><img src="../img/scroll_left_right.png"></div> </div>-->
<div class="tab_container"> <?php if (!empty($_GET["update"])) { echo '<div class="tc msg_text">' . _lang("Updated") . '</div>'; } ?>
<p style="color: #CC1342; font-weight: bold;"><?=_lang("Posted")?></p>
<div class="table-responsive" style="margin-bottom: 50px;"> <table id="example2" class="table table-bordered table-hover datatable-with-filter"> <thead> <tr> <!--<th class="no-filter" style="width:80px;"><?= _lang('Sort') ?></th>--> <th style=""><?= lang("Post No.") ?></th> <th style="" class="no-filter nowarp"><?= lang("樂器") ?></th> <th class="no-filter nowarp"><?= lang("級別") ?></th> <th class="no-filter" style=""> <? /* if ($row_profile['profile_id'] != 4) { ?> <a href="<?= $page_settings['domain'] ?>_form.php" class="btn btn-sm btn-primary pull-right"> <?= _lang('Create') ?> </a> <? } else { ?> <? if ($count_product['count'] < 2) { ?> <a href="<?= $page_settings['domain'] ?>_form.php" class="btn btn-sm btn-primary pull-right"> <?= _lang('Create') ?> </a> <? } ?> <? }*/ ?> </th> </tr> </thead>
<tbody> <?php foreach ($all_job_info as $row) {
//Status
if (isset($_GET["show"]) && !empty($_GET["show"])) { $show = "&show=all"; } else { $show = ""; } ?>
<tr>
<td> <?="J".str_pad($row["id"], 5, "0", STR_PAD_LEFT); ?> </td>
<td> <? $sql = "select name_" . get_langcode() . " as name from master_type_code where id = ? and typeid = ? and deleted = ? LIMIT 1"; $parameters = array($row["mas_instrument"], 'INSTRUMENT', 0); $row_instrument = bind_pdo($sql, $parameters, "selectone"); ?> <?= $row_instrument["name"] ?> </td> <td> <?= $row["level"] ?> </td>
<td class="tr"> <div class="btn-group"> <? //if ($row['count'] == 0) { ?> <a href="<?= $page_settings['domain'] ?>_form.php?id=<?= $row['id'] ?>" class="btn btn-sm btn-primary"> <i class="fa fa-pencil" aria-hidden="true"></i> </a> <? //} ?> </div> </td> </tr> <?php } ?> </tbody>
</table> </div>
<p style="color: #CC1342; font-weight: bold;"><?=_lang("Lesson Record")?></p>
<div class="table-responsive" style="margin-bottom: 50px;"> <table id="example2" class="table table-bordered table-hover datatable-with-filter"> <thead> <tr> <th style=""><?= lang("課堂編號") ?></th> <th style="" class="no-filter nowarp"><?= lang("樂器") ?></th> <th class="no-filter nowarp"><?= lang("級別") ?></th> <th class="no-filter" style=""></th> </tr> </thead> <tbody> <?php foreach ($all_order_info as $row) { //Status /*if (isset($_GET["show"]) && !empty($_GET["show"])) { $show = "&show=all"; } else { $show = ""; } $row_tutor = get_tutor($row['tutormain_id']); $row_student = get_student($row['studentmain_id']);*/ if(!empty($row['job_id'])){ if ($row['order_type'] == 'course') { $row_job = get_teacherpostjob($row['job_id']); //$row_residence["name_cn"] = $row_job['address_cn']; } else { $row_job = get_studentpostjob($row['job_id']); /*$sql = "select name_cn,name_en from master_type_code where id = ? and typeid = 'TEACH_POSITIONCODE' LIMIT 1"; $parameters = array($row['mas_residencecode']); $row_residence = bind_pdo($sql, $parameters, "selectone");*/ }
$mas_instrument = $row_job['mas_instrument']; }else{ $mas_instrument = $row['mas_instrument']; }
$sql = "select name_cn,name_en from master_type_code where id = ? and typeid = 'INSTRUMENT' LIMIT 1"; $parameters = array($mas_instrument); $row_instrument = bind_pdo($sql, $parameters, "selectone");
//check if not read notification $sql = "select count(*) as unread from notification where table_name = ? and table_id = ? and cmsloginid = ? and deleted = ? and `read` = ? and read_date is null"; $parameters = array("order", $row['id'], $_SESSION["cmsloginid"], 0, 0); $result = bind_pdo($sql, $parameters, "selectone");
$style = ""; if($result["unread"] >= 1){ $style = "color: #CC1342; font-weight: bold;"; } ?> <tr style="<?=$style?>"> <td class='listtxt' style='padding-left:5'><?= short_code($row["order_no"], 2, -5) ?></td> <td class='listtxt' style='padding-left:5'><?= $row_instrument["name_cn"] ?></td> <td class='listtxt' style='padding-left:5'> <?php 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級以上'; } } else if ($row['order_type'] == 'course') { if ($row['level'] == 1) { echo "初級"; } else if ($row['level'] == 3) { echo "中級"; } } ?> </td> <td class="tr"> <div class="btn-group"> <a href="order_form.php?id=<?= $row['id'] ?>" class="btn btn-sm btn-primary"> <i class="fa fa-pencil" aria-hidden="true"></i> </a> </div> </td> </tr> <?php } ?> </tbody>
</table> </div> </div>
</div> </div> </div> </div> <? include('_footer.php') ?> <script> $(function () {
}); </script>
</body> </html>
|