-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_create_zin.php
254 lines (201 loc) · 9.7 KB
/
admin_create_zin.php
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
<!DOCTYPE html>
<html>
<head>
<?php include 'admin_head.php'; ?>
</head>
<body>
<header>
<?php include 'admin_header.php'; ?>
</header>
<section id="bbdd_sc">
<div id="bbdd_sc_wrap">
<div id="bbdd_sc_area">
<!-- <div class="sc_contain">
<div class="sc_list_area"> -->
<div class="view_wrap">
<div class="view_wrap_line">
<div class="contEditor">
<center>
<h3>매거진 만들기</h3>
</center>
<?php
include 'bbdd_db_conn.php';
$sqlStandingZin = "SELECT * FROM zin WHERE publish = 'standing'";
$resultStandingZin = $conn->query($sqlStandingZin) or die($conn->error);
$rowStandingZin = $resultStandingZin->fetch_assoc();
// $standing_zin_column = $rowStandingZin['zin_column'];
// $standing_zin_color = $rowStandingZin['zin_color'];
// $standing_title_color = $rowStandingZin['title_color'];
// $standing_point_color = $rowStandingZin['point_color'];
// $standing_nav_color = $rowStandingZin['nav_color'];
$sqlZinNow = "SELECT * FROM zin WHERE publish='now' AND display = 'on' ORDER BY id DESC LIMIT 1";
$resultZinNow = $conn->query($sqlZinNow) or die($conn->error);
$rowZinNow = $resultZinNow->fetch_assoc();
$standing_zin_column = $rowZinNow['zin_column'];
$standing_zin_color = $rowZinNow['zin_color'];
$standing_title_color = $rowZinNow['title_color'];
$standing_point_color = $rowZinNow['point_color'];
$standing_nav_color = $rowZinNow['nav_color'];
$uname = $_SESSION['username'];
$query = "SELECT * FROM user_data WHERE username= '$uname'";
$result = $conn->query($query);
$rows = mysqli_fetch_assoc($result);
$username = $rows['username'];
$author = $rows['author'];
$adminCast = "admin";
$editorCast = "editor";
$authorCast = "author";
session_start();
$URL = "./admin_zinList.php";
if(!isset($_SESSION['username'])) {
?> <script>
alert("권한이 없습니다.");
location.replace("<?php echo $URL?>");
</script>
<?php }
//cast: admin||editor인 경우
else if($_SESSION['cast']==$adminCast || $_SESSION['cast']==$editorCast) {
// else if($_SESSION['username']==$username || $_SESSION['cast']==$admin) {
?>
<form class="createForm" action="admin_create_zin_action.php" method="POST" enctype="multipart/form-data">
<p >
<div class="createInput">
<label class="createGrid1">작성자: </label><?=$author?>
<input class="createGrid2" type="hidden" name="author" value="<?=$author?>" required />
</div>
</p>
<p >
<div class="createInput">
<label class="createGrid1">아이디: </label><?=$username?>
<input class="createGrid2" type="hidden" name="username" value="<?=$username?>" required />
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 제목</label>
<input class="createGrid2" id="zin_title" name="title" placeholder="매거진 제목" required />
<div class="createGrid3" id="zinTitleConf"></div>
<div>
<p>
* 따옴표('), 큰따옴표(")는 사용할 수 없습니다.<br>
** 한글 20글자 이내, 영문 24글자 이내 (띄어쓰기 포함)
</p>
</div>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 표지</label>
<input class="createGrid2" type="file" name="img" required />
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 설명</label>
<textarea class="createGrid2" name="zin_detail" placeholder="매거진 설명" rows="10" cols="20" required></textarea>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 발행일</label>
<input class="createGrid2" name="date" type="date" required/>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 배경색</label>
<input class="createGrid2" name="zin_color" type="color" value="#ffffff"/>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 타이틀 폰트 색</label>
<input class="createGrid2" name="title_color" type="color" value="#ffffff"/>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 포인트 색</label>
<input class="createGrid2" name="point_color" type="color" value="#ffffff"/>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">매거진 메뉴 색</label>
<input class="createGrid2" name="nav_color" type="color" value="#ffffff"/>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">공개 상태</label>
<!-- <textarea class="createGrid2" name="display" placeholder="작가소개" rows="10" cols="20"required></textarea> -->
<div class="createGrid2">
<input class="display_btn" type="radio" id="on_btn"name="display" value="on">
<label for="on_btn">외부공개</label><br>
<input class="display_btn" type="radio" id="ok_btn"name="display" value="ok" checked>
<label for="ok_btn">내부공개</label><br>
<input class="display_btn" type="radio" id="off_btn"name="display" value="off">
<label for="off_btn">비공개</label><br>
</div>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">발행상태</label>
<!-- <textarea class="createGrid2" name="display" placeholder="작가소개" rows="10" cols="20"required></textarea> -->
<div class="createGrid2">
<input class="publish_btn" type="radio" id="standing_btn"name="publish" value="standing">
<label for="standing_btn">상시발행</label><br>
<input class="publish_btn" type="radio" id="now_btn"name="publish" value="now">
<label for="now_btn">기획발행</label><br>
<input class="publish_btn" type="radio" id="ready_btn"name="publish" value="ready" checked>
<label for="ready_btn">발행 대기</label><br>
</div>
</div>
</p>
<p>
<div class="createInput">
<label class="createGrid1">상시 발행시 매거진 포맷</label>
<!-- <textarea class="createGrid2" name="display" placeholder="작가소개" rows="10" cols="20"required></textarea> -->
<div class="createGrid2">
<input class="zin_column_btn" type="radio" id="two_btn"name="zin_column" value="2">
<label for="two_btn">2줄</label><br>
<input class="zin_column_btn" type="radio" id="three_btn"name="zin_column" value="3">
<label for="three_btn">3줄</label><br>
<input class="zin_column_btn" type="radio" id="four_btn"name="zin_column" value="4" checked>
<label for="four_btn">4줄</label><br>
<input class="zin_column_btn" type="radio" id="five_btn"name="zin_column" value="5.3">
<label for="five_btn">5줄</label><br>
</div>
</div>
</p>
<p>
<input type="submit">
<button name="cancel"><a href = "javascript:history.back()" class="cancel_btn">취소</a></button>
</p>
</form>
<?php
} else {
?>
<script>
alert("권한이 없습니다.");
location.replace("<?php echo $URL?>");
</script>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</section>
<footer>
<?php include 'admin_footer.php'; ?>
</footer>
<?php include "admin_jsGroup.php";?>
<script>
admin_frontListColor("<?php echo $standing_zin_color; ?>", "<?php echo $standing_title_color; ?>", "<?php echo $standing_point_color; ?>", "<?php echo $standing_nav_color; ?>");
</script>
</body>
</html>