-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevent_view.php
More file actions
140 lines (114 loc) · 4.41 KB
/
event_view.php
File metadata and controls
140 lines (114 loc) · 4.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="건호" content="width=device-width, initial-scale=1.0">
<title>QnA</title>
<link rel="stylesheet" href="Free_view.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Electrolize&display=swap" rel="stylesheet">
<script
src="https://kit.fontawesome.com/af4e1eff79.js"
crossorigin="anonymous"></script>
</head>
<body>
<ul class="bar_menu">
<li class="bar_logo">
<i class="fa-solid fa-car-crash"></i>
<a href="index.php"><b>BugiTV</b></a>
</li>
<li><a href="rank.php">Ranking</a></li>
<li><a href="comunication.php">Community </a></li>
<li><a href="QnA.php">QnA</a></li>
<li><a href="event.php">Event</a></li>
</ul>
<?php
ini_set( 'display_errors', '0' );
$seq = $_GET["seq"];
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");
$sql = "select * from event where seq = '$seq'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$title = $row["title"];
$content = $row["content"];
$userId = $row["userId"];
$time = $row["time"];
?>
<div class="BackGround">
</div> <!-----BackGround-->
<div class="Main">
<div class="title">
<h2>1</h2>
<h1>event_View</h1>
</div>
<div class="bar2"><h1 class="write_title2">작성 제목</h1></div>
<div class="search-input"><?=$title?></div>
<div class="bar3"> <h1 class="write_title2">작성 내용</h1></div>
<div class="content_table">
<?=$content?>
</div>
<div class="wab">
<div class="WriterAndbtn">
<div id="revise">수정</div>
<div id="delete" onclick="location.href = 'QnAEnroll.php?option=del&seq=<?=$seq?>'">삭제</div>
</div>
</div>
<div class="Writer">
<?=$userId?>
</div>
<?php
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");//공백란에 디비 비번 입력
$sql = "select * from eventComment where eventNum=$seq";
$result = mysqli_query($con, $sql);
$total_rows = mysqli_num_rows($result);
?>
<div id="form-commentInfo">
<div id="comment-count">댓글 <span id="count"><?=$total_rows?></span></div>
<form name ="QnA_comment" method = "post" action = "QnAEnroll.php">
<input type="text" name = "comment" id="comment-input" placeholder="댓글을 입력해 주세요.">
<input name ="seq" hidden value="<?=$seq?>">
<input name ="option" hidden value="eventComment">
<button id="submit">등록</button>
<div id=comments> </div>
</form>
<?php
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");//공백란에 디비 비번 입력
$sql ="select * from eventComment where eventNum='$seq'";
$result = mysqli_query($con,$sql);
$total_rows = mysqli_num_rows($result);
$i=0;
while($i<$total_rows){
$row = $result->fetch_assoc();
$id = $row["userId"];
$text = $row["text"];
$time = $row["time"];
echo"
<div class=\"coment_writer\">
<div class=\"inline\">$id</div>
<div class=\"inline\">$time</div>
<div class=\"conment_box\">
$text
</div>
<div class=\"pull-right\">
<div id=\"delete\">삭제</div>
</div>
</div>
";
$i++;
}
?>
<div class="paging">
<a href="#" class="num ">1</a>
<a href="#" class="num ">2</a>
<a href="#" class="num ">3</a>
<a href="#" class="num"> > </a>
<a href="#" class="bt">마지막</a>
</div>
</div> <!---------form-commentInfo-->
</div> <!-------con-->
</body>
<script>
</script>
</html>