-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite.php
More file actions
170 lines (153 loc) · 4.91 KB
/
write.php
File metadata and controls
170 lines (153 loc) · 4.91 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
<?php
/*
File: write.php
Author: Jaspers
Created by 2018-07-10
Goal: 게시판 글 쓰기 화면(Write)
Description:
2018-07-11 / Jasper / CKEditor 추가
2018-07-12 / Jasper / 수행시간 측정 추가
*/
require('jasper.php');
?>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>게시물 글쓰기(Post Writing) - Board/Jaspers</title>
<link rel="stylesheet" type="text/css" href="./css/mystyle.css">
<script src="//cdn.ckeditor.com/4.10.0/standard/ckeditor.js"></script>
<script src="./script/myscripts.js"></script>
</head>
<body>
<?php
$board = new JasperBoard();
$boardFn = new BoardFn();
$start = $boardFn->getExecutionTime(); // 수행시간 측정(시작)
$boardName = $_GET['name'];
?>
<?php
require('write_ok.php');
?>
<h3>게시물 글쓰기(Post Writing)</h3>
<script>
var editor;
CKEDITOR.on( 'instanceReady', function( ev ) {
editor = ev.editor;
document.getElementById( 'readOnlyOn' ).style.display = '';
editor.on( 'readOnly', function() {
document.getElementById( 'readOnlyOn' ).style.display = this.readOnly ? 'none' : '';
document.getElementById( 'readOnlyOff' ).style.display = this.readOnly ? '' : 'none';
});
});
function toggleReadOnly( isReadOnly ) {
editor.setReadOnly( isReadOnly );
}
</script>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]) . "?name=" . $boardName;?>">
<table class="tg_general" style="width:100%;">
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2; width:10%;">
<span style="font-weight:bold;">제목(Subject)</span>
</td>
<td style="text-align:left;">
<input type="text" name="subject" class="input_box" value="<?php echo $subject;?>">
<span class="error">* <?php echo $subjectErr;?></span>
</td>
</tr>
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2; width:10%">
<span style="font-weight:bold;">작성자(Author)</span>
</td>
<td style="text-align:left;">
<input type="text" name="author" class="input_box" value="<?php echo $author;?>">
<span class="error">* <?php echo $authorErr;?></span>
</td>
</tr>
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2; width:10%">
<span style="font-weight:bold;">비밀번호(Password)</span>
</td>
<td style="text-align:left;">
<input type="password" name="passwd" class="input_box" value="<?php echo $passwd;?>">
<span class="error">* <?php echo $passwdErr;?></span>
</td>
</tr>
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2; width:10%">
<span style="font-weight:bold;">비밀번호 확인(Password Check)</span>
</td>
<td style="text-align:left;">
<input type="password" name="passwd2" class="input_box" value="<?php echo $passwd2;?>">
<span class="error">* <?php echo $passwdChkErr;?></span>
</td>
</tr>
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2; width:10%">
<span style="font-weight:bold;">양식(Mode)</span>
</td>
<td style="text-align:left;">
<?php $boardFn->printMode(NULL); ?>
</td>
</tr>
<tr>
<td class="tg-nknw" style="background-color:#E2E2E2;" colspan="2">
<span style="font-weight:bold;">내용(Memo)</span>
</td>
<tr>
<td colspan="2" style="height:200px;text-align:left;">
<br>
<textarea class="ckeditor" name="memo" rows="5" cols="40"><?php echo $memo;?></textarea>
<span class="error">* <?php echo $memoErr;?></span>
<br>
</td>
</tr>
</table>
<!-- 하단 -->
<table style="width:100%">
<tr>
<td>
<input type="submit" name="submit" value="작성(Write)" class="button" style="color:#000;">
<?php
echo "<a href=\"list.php?name=$boardName\" class=\"button\">목록(List)</a>";
?>
</td>
</tr>
</table>
</form>
<!-- W3C -->
<table style="width:100%">
<tr>
<td>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="//jigsaw.w3.org/css-validator/images/vcss"
alt="올바른 CSS입니다!" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="//jigsaw.w3.org/css-validator/images/vcss-blue"
alt="올바른 CSS입니다!" />
</a>
</td>
</tr>
</table>
<!-- 수행시간(Execution time) -->
<?php
$end = $boardFn->getExecutionTime();
$time = $end - $start;
echo "\t\t\t<br>";
echo "\t\t\t<span class=\"time_font\">";
echo "수행시간(Execution Time):";
echo $time . "초(Sec)</span>";
echo "\t\t\t<br>";
echo "\t\t\t<span class=\"time_font\">";
echo "시작시간(Start Time):";
echo $start . "초(Sec)</span>";
echo "\t\t\t<br>";
echo "\t\t\t<span class=\"time_font\">";
echo "종료시간(End Time):";
echo $end . "초(Sec)</span>";
?>
</body>
</html>