-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecklist.php.original2
More file actions
executable file
·281 lines (253 loc) · 6.98 KB
/
checklist.php.original2
File metadata and controls
executable file
·281 lines (253 loc) · 6.98 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
<?php
// Directory define
define('INC', 'includes/');
define('MODAL', 'modals/');
// Variables - Basic
$model = $_POST['model'];
$type = $_POST['type'];
$os = $_POST['os'];
$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'];
$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> \r\n";
}
function info($var) {
echo $var;
}
$n = 1;
function radio() {
global $n;
$val = ['n/a', 'y', 'n'];
for ($j=0; $j < count($val); $j++) {
echo "<label class='radio-inline'>\r\n";
echo "<input type='radio' name='check_".$n."' id='check_".$n."' value='".$val[$j]."'>".strtoupper($val[$j])."\r\n";
echo "</label>";
}
}
$question_array = [];
?>
<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">Check 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 ($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">참고 자료</h3>
</div>
<div class="panel-body">
<?php include('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>구분#1</th>
<th>구분#2</th>
<th>검수 사항</th>
<th>확인</th>
<th>비고</th>
<th>예시</th>
<th>위키</th>
</tr>
</thead>
<tbody>
<?php
// include 디렉토리 설정
$files = scandir(INC, 0);
$modals = scandir(MODAL, 0);
// modal 불러오기
for ($i = 2; $i < count($modals); $i++) {
$modalFiles = [];
include MODAL . $modals[$i];
$modalFiles = array_push($modalFiles, $modals[$i]);
}
// 조건에 의한 불러오기
for ($i = 2; $i < count($files); $i++) {
// 파일 불러오기
$check = [];
$check['id'] = basename($files[$i], '.php');
include_once INC . $files[$i];
// row 시작
echo "<tr>\r\n";
// 자동 번호 매기기
echo "<td>".$n."</td>\r\n";
// 구분#1
if (preg_match('/^common/i', $files[$i])) {
echo "<td>공통</td>\r\n";
}
// 구분#2
echo "<td>\r\n";
if (empty($check['구분'])) {
echo "공통";
} else {
echo $check['구분'];
}
echo "</td>\r\n";
// 검수사항
echo "<td>".$check['검수사항']."</td>\r\n";
// 확인
echo "<td>\r\n";
$checkVal = ['n/a', 'y', 'n'];
for ($j = 0; $j < count($checkVal); $j++) {
echo "<label class='radio-inline'>\r\n";
echo "<input type='radio' name='".$check['id']."' id='".$check['id']."' value='".$checkVal[$j]."'>".strtoupper($checkVal[$j])."\r\n";
echo "</label>\r\n";
}
echo "</td>\r\n";
// 비고 & 공지
echo "<td>\r\n";
if (!empty($check['비고']) && !empty($check['공지일'])) {
echo "<ul>\r\n";
echo "<li>".$check['비고']."</li>\r\n";
echo "<li><small>공지일: ".$check['공지일']."</small></li>\r\n";
echo "</ul>\r\n";
} elseif (!empty($check['비고']) && empty($check['공지일'])) {
echo "<ul>\r\n";
echo "<li>".$check['비고']."</li>\r\n";
echo "</ul>\r\n";
} elseif (empty($check['비고']) && !empty($check['공지일'])) {
echo "<ul>\r\n";
echo "<li><small>공지일: ".$check['공지일']."</small></li>\r\n";
echo "</ul>\r\n";
} else {
null;
}
echo "</td>\r\n";
// 예시
echo "<td>\r\n";
$modalFile = MODAL . $check['id'] . ".php";
if (file_exists($modalFile)) {
echo "<a href='#". $check['id'] ."' data-toggle='modal'>보기</a>\r\n";
}
echo "</td>\r\n";
// 위키
echo "<td>\r\n";
if (empty($check['위키'])) {
echo "–";
} else {
echo "<a href='".$check['위키']."' target='_blank'>보기</a>";
}
echo "</td>\r\n";
// row 끝내기
echo "</tr>\r\n";
$n++;
$fileList = [];
$fileList = array_push($fileList, $files[$i]);
}
?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<pre class="pre-scrollable">
<?php
print_r($modalFiles);
print_r($fileList);
print_r($files);
var_dump($n);
var_dump($check);
var_dump($_POST);
var_dump($question_array);
unset($n);
var_dump($n);
?>
</pre>
</div>
</div>
</div>
</div>