-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecklist.php
More file actions
executable file
·484 lines (429 loc) · 18.1 KB
/
checklist.php
File metadata and controls
executable file
·484 lines (429 loc) · 18.1 KB
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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<?php
// session start
session_start();
// Directory define
define('COMMON', 'inc/common/');
define('MODAL', 'inc/modals/');
define('INC', 'inc/');
define('CR', "\r\n");
// include('inc.find.php');
include('db.php');
// Variables - Basic
$_SESSION = $_POST;
$model = $_POST['model'];
$type = $_POST['type'];
$os = $_POST['os'];
switch($_SESSION['dest']) {
case 'EU': case 'CIS':
$region = $_SESSION['region'] = 'Europe';
break;
case 'Asia': case 'MEA': case 'SEA': case 'SWA': case 'IND': case 'AUS': case 'NZL':
$region = $_SESSION['region'] = 'Asia';
break;
case 'CHN': case 'CMCC': case 'CTC': case 'CU': case 'HK': case 'TW':
$region = $_SESSION['region'] = 'China';
break;
case 'LTN': case 'MEX': case 'COL': case 'ARG':
$region = $_SESSION['region'] = 'Latin';
break;
}
$dest = $_POST['dest'];
$language = $_POST['language'];
$person = $_POST['person'];
$date = date('Y/m/d');
$time = date('Y/m/d H:i:s');
// Variables - Detailed
$battery = $_POST['battery'];
$network = $_POST['network'];
if (isset($_POST['sim'])) {
$sim = $_POST['sim'];
}
$book = $_POST['book'];
if (isset($_POST['waterproof'])) {
$waterproof = $_POST['waterproof'];
}
// 특이사항 label용
function label($var) {
echo "<span class=\"label label-info\">$var</span>".CR;
}
function info($var) {
echo $var;
}
$n = 1;
?>
<div class="container">
<div id="checklist">
<div class="row">
<!-- 모델 정보 -->
<div class="col-sm-7">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Information</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
<dt>모델명</dt>
<dd><?php info($model); ?></dd>
<dt>자재 / OS</dt>
<dd><?php info($type); ?> / <?php info($os); ?></dd>
<dt>언어 (출향지)</dt>
<dd><?php info($language); ?> (<?php info($dest); ?>)</dd>
<dt>검수자 (검수일)</dt>
<dd><?php info($person); ?> (<abbr title="<?php echo $time; ?>"><?php info($date); ?></abbr>)</dd>
<dt>특이사항</dt>
<dd>
<?php
if ($battery == "sep") {
label("분리형");
} else {
label("일체형");
}
if ($network == "3g") {
label("3G");
} elseif ($network == "lte") {
label("LTE");
} else {
label("Wi-Fi Only");
}
if (isset($sim)) {
if ($sim == "ss") {
label("Single SIM");
} elseif ($sim == "ds") {
label("Dual SIM");
} elseif ($sim == "na") {
null;
} else {
label("SS/DS");
}
}
if ($book == "qsg") {
label("QSG 합본");
} elseif ($book == "sim") {
label("SS/DS 합본");
} elseif ($book == "series") {
label("시리즈 합본");
}
if (isset($waterproof)) {
if ($waterproof == "yes") {
label("방수");
}
}
?>
</dd>
</dl>
</div>
</div>
</div>
<!-- 참고 자료 -->
<div class="col-sm-5">
<div id="reference">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Reference</h3>
</div>
<div class="panel-body">
<?php include(INC.'inc.check.ref.php'); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-10">
<div class="page-header">
<h3>Quality Checklist</h1>
</div>
</div>
<!-- PASS / FAIL 표기 -->
<div class="col-sm-2">
<div class="bg-success">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-bordered table-hover table-condensed" id="chkTable">
<thead>
<tr>
<th>No.</th>
<th>자재</th>
<th>출향지</th>
<th>언어</th>
<th>분류</th>
<th>검수 사항</th>
<th>확인</th>
<th>비고</th>
<th>예시</th>
<th>위키</th>
</tr>
</thead>
<tbody>
<?php
// modal 불러오기
$modals = scandir(MODAL, 0);
for ($i = 2; $i < count($modals); $i++) {
$modalFiles = [];
include MODAL . $modals[$i];
$modalFiles = array_push($modalFiles, $modals[$i]);
}
function td($var) {
echo "<td>".$var."</td>".CR;
}
function radio() {
global $n;
$checkVal = ['n/a', 'y', 'n'];
$id = 'radio_'.$n;
echo "<td>".CR;
for ($i = 0; $i < count($checkVal); $i++) {
echo "<label class='radio-inline'>".CR;
echo "<input type='radio' name='".$id."' id='".$id."' value='".$checkVal[$i]."'>".strtoupper($checkVal[$i]).CR;
echo "</label>".CR;
}
echo "</td>".CR;
}
function spread($result) {
global $n;
while($get = $result->fetch_assoc()) {
echo "<tr>".CR;
td($n);
td($get['type']);
td($get['destination']);
td($get['language']);
td($get['category']);
td($get['question']);
radio();
if (!isset($get['comment']) && !isset($get['date'])) {
echo "<td></td>".CR;
} elseif(!isset($get['date']) && isset($get['comment'])) {
echo "<td>".CR;
echo "<ul>".CR;
echo "<li>".$get['comment']."</li>".CR;
echo "</ul>".CR;
echo "</td>".CR;
} elseif (isset($get['date']) && !isset($get['comment'])) {
$noti_date = date('Y.m.d', strtotime($get['date']));
echo "<td>".CR;
echo "<ul>".CR;
echo "<li>공지일: ".$noti_date."</li>".CR;
echo "</ul>".CR;
echo "</td>".CR;
} elseif (isset($get['date']) && isset($get['comment'])) {
$noti_date = date('Y.m.d', strtotime($get['date']));
echo "<td>".CR;
echo "<ul>".CR;
echo "<li>".$get['comment']."</li>".CR;
echo "<li><small>공지일: ".$noti_date."</small></li>".CR;
echo "</ul>".CR;
echo "</td>".CR;
}
// td($get['example']);
echo "<td>";
if(isset($get['example'])) {
echo "<a href='#".$get['example']."' data-toggle='modal'>보기</a>";
} else {
null;
}
echo "</td>".CR;
if(isset($get['wiki'])) {
echo "<td>";
echo "<a href='".$get['wiki']."' target='_blank'>보기</a>";
echo "</td>".CR;
} else { echo "<td></td>".CR; }
echo "</tr>".CR;
$n++;
unset($get);
}
}
if ($language == 'English') { //영어
null;
} else { // 다국어
// 공통
$sql = "SELECT * FROM Common WHERE type = '공통' AND region = '공통' AND destination = '공통' AND language = '공통' AND category = '공통'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
// 자재
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '공통' AND destination = '공통' AND language = '공통' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
if ($region == "China" && $language == "Chinese") {
// China 공통
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '공통' AND language = '".$language."' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
switch(true) {
case ($dest == 'HK'):
case ($dest == 'TW'):
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '".$dest."' AND language = '".$language."' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
break;
case ($dest != 'HK' || $dest != 'TW'):
// CHN 공통
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = 'CHN' AND language = '".$language."' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
// break;
// CMCC / CTC / CU
switch($dest) {
case 'CMCC':
case 'CTC':
case 'CU':
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '".$dest."' AND language = '".$language."' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
break;
}
}
} else {
// 지역
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '공통' AND language = '공통' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
// 출향지
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '".$dest."' AND rtl = '".($language == "Arabic"||$language == "Farsi"||$language == "Urdu"||$language == "Hebrew" ? 'Y' : 'N')."' AND language = '공통' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
// 언어
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND destination = '".$dest."' AND language = '".$language."' AND category = '공통' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
}
}
switch (true) {
// 네트워크
case ($network == '3g'):
case ($network == 'lte'):
$sql = "SELECT * FROM Common WHERE destination = '".$dest."' AND language = '".$language."' AND category = '3G/LTE' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
break;
case ($network == 'wifi'):
$sql = "SELECT * FROM Common WHERE language = '".$language."' AND category = 'Wi-Fi 전용' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
break;
}
switch ($battery) {// 배터리
case 'uni':
$temp = $conn->query("SELECT * FROM Common WHERE type = '".$type."' AND destination = '".$dest."' AND language = '".$language."' AND category = '일체형'");
if($temp->num_rows == 0) {
// $sql = "SELECT * FROM Common WHERE region = '".$region."' AND language = '공통' AND category = '일체형' AND 다국어 = 'Y'";
if ($dest == 'CIS') {
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND destination = '".$dest."' AND language = '공통' AND category = '일체형' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
} else {
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND region = '".$region."' AND language = '공통' AND category = '일체형' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
}
} else {
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND destination = '".$dest."' AND language = '공통' AND category = '일체형' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
$sql = "SELECT * FROM Common WHERE type = '".$type."' AND destination = '".$dest."' AND language = '".$language."' AND category = '일체형' AND 다국어 = 'Y'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
}
break;
case 'sep':
break;
}
switch($book) {
case 'qsg_multi':
$sql = "SELECT * FROM Common WHERE category = '책 - QSG 합본'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
case 'qsg_single':
$sql = "SELECT * FROM Common WHERE category = '책 - QSG'";
if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
spread($result);
break;
case 'sim':
break;
case 'series':
break;
}
// // 공통 항목 불러오기
// $sql = "SELECT * FROM Common WHERE type LIKE '공통' AND category LIKE '공통' ORDER BY Common . id ASC";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// // 공통 + 자재
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '공통' AND language like '공통' AND 영어 LIKE 'Y' AND 다국어 LIKE 'Y' AND category LIKE '공통'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// // 공통 + 자재 + 영/다
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '공통' AND language like '공통' AND " . ($language == "English" ? "영어 LIKE 'Y' AND 다국어 LIKE 'N'" : "영어 LIKE 'N' AND 다국어 LIKE 'Y'")." AND category LIKE '공통'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// // 공통 + 자재 + 출향
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '".$dest."' AND language like '공통' AND 영어 LIKE 'Y' AND 다국어 LIKE 'Y' AND category LIKE '공통'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// // 배터리 일체형/분리형 구분
// switch($battery) {
// case 'uni':
// if ($dest == "EU") {
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '".$dest."' AND language like '공통' AND 영어 LIKE 'Y' AND 다국어 LIKE 'Y' AND category LIKE '배터리 일체형'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// } else {
// null;
// }
// break;
// case 'sep':
// break;
// default:
// break;
// }
// // 공통 + 자재 + 출향 + 영/다
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '".$dest."' AND language like '".$language."' AND " . ($language == "English" ? "영어 LIKE 'Y' AND 다국어 LIKE 'N'" : "영어 LIKE 'N' AND 다국어 LIKE 'Y'")." AND category LIKE '공통'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// // 3G / LTE / Wi-Fi
// switch($network) {
// case '3g':
// case 'lte':
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '".$dest."' AND language like '".$language."' AND " . ($language == "English" ? "영어 LIKE 'Y' AND 다국어 LIKE 'N'" : "영어 LIKE 'N' AND 다국어 LIKE 'Y'")." AND category LIKE '3G/LTE'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// break;
// case 'wifi':
// $sql = "SELECT * FROM Common WHERE type LIKE '".$type."' AND destination LIKE '".$dest."' AND language like '".$language."' AND " . ($language == "English" ? "영어 LIKE 'Y' AND 다국어 LIKE 'N'" : "영어 LIKE 'N' AND 다국어 LIKE 'Y'")." AND category LIKE 'Wi-Fi 전용'";
// if (!$result = $conn->query($sql)) {echo "sorry.".CR; echo "Errno:".$conn->errno.CR; echo "Error:".$conn->error.CR; exit; }
// if ($result->num_rows === 0) {echo "nothing to add"; }
// spread($result);
// break;
// default:
// break;
// }
// 방수일 때
// 합본일 때
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<pre class="pre-scrollable">
<?php
print_r(get_included_files());
print_r($_POST);
print_r($_SESSION);
unset($n);
?>
</pre>
</div>
</div>
</div>
</div>