-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshorttable.php
More file actions
197 lines (181 loc) · 5.47 KB
/
shorttable.php
File metadata and controls
197 lines (181 loc) · 5.47 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
<?php
session_start();
if(!isset($_SESSION['login_session'])){
header("Location:./index.html");
}
if(!isset($_SESSION['login_session'])){
header("Location:./index.html");
}
$host = 'localhost';
$user = 'root';
$pw = 'chanki';
$dbname = 'healthcare';
$dbconnection = new mysqli($host, $user, $pw, $dbname);
$dbconnection->set_charset("utf8");
$team_table_query = "SELECT name ,letter, time from shorttable where teamname like '{$_SESSION['login_session']['teamName']}' and open like 'false'";
$all_table_query = "SELECT name ,letter, time FROM shorttable where open like 'true' ";
$res_team_query = $dbconnection ->query($team_table_query);
$res_all_query = $dbconnection ->query($all_table_query);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>한줄게시판</title>
<style>
body {
margin:0;
padding:0;
margin-top:0px;
padding-top : 0px ;
}
.left_menu {
height: 15%;
width: 100%;
display: block;
z-index: 1;
background-color: #454545;
overflow: hidden;
margin: 0px;
padding: 0px;
font-size: 1.2rem;
clear:both;
}
.left_menu a {
padding: 10px 8px 15px 16px;
text-decoration: none;
font-size: 1.2rem;
color: white;
display: inline-block;
}
.left_menu a:hover {
color: #f1f1f1;
}
.status_bar{
text-align: center;
background-color: #E0E2E3;
padding: 5px 10px;
border-radius: .4rem;
display: block;
}
.message-input , .team-table,.all-table{
text-align: center;
width: 100%;
display: inline-block;
border-radius: .4rem;
background-color: #E0E2E3;
margin-top: 40px;
}
table {
border-collapse: separate;
border-spacing: 0;
text-align: left;
line-height: 1.5;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
margin : auto;
}
table th {
/* width: 100px; */
display: inline-flex;
padding: 10px;
font-weight: bold;
text-align: center;
vertical-align: top;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
background: #eee;
}
table td {
/* width: 150px; */
padding: 10px;
text-align: center;
vertical-align: top;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
color: white;
background-color: #454545;
display: inline-flex;
}
.message-input input{
border-style: dotted;
border-width: 3px;
}
.input_button input{
background-color: #282C34;
border-style: none;
padding: 15px;
border-radius : .4rem;
font-size : 1rem;
color : white;
width :15%;
margin: 10px;
}
</style>
</head>
<body>
<div class="left_menu">
<a href="./mypage_dashboard.php">Dashboard</a>
<a href="./mypage.php">건강정보 입력</a>
<a href="./mypageRank.php">팀 내의 경쟁순위</a>
<a href="./shorttable.php">게시판</a>
<a href="./logout.php" style="float : right">logout</a>
<a href="./myinfo.php" style="float : right">개인 설정</a>
<a href="./gamdok.php" style="float : right">감독 메뉴</a>
</div>
<div class="main_page">
<div class="status_bar">
<h4>
<?=$_SESSION['login_session']['teamName']; ?>(팀)에 속해 계시는 <?=$_SESSION['login_session']['name']; ?>님 반갑습니다.
<?php if ($_SESSION['login_session']['director'] == "true") {print "직책 : 감독";} else {print "일반 사용자입니다";}?>
</h4>
</div>
</div>
<div class="message-input">
<form class="input" action="tableInput.php" method="post">
<h4>한줄게시판 입니다.</h4>
<input type="radio" id="r1" name="open" value="true" />
<label for="r1"><span></span>전체한테 글을 날립니다.</label>
<input type="radio" id="r2" name="open" checked="checked" value="false" />
<label for="r2"><span></span>팀원한테만 글을 보여줍니다. </label>
<input style="display: block; width: 100%; height: 50px;"type="text" name="table" placeholder="자신의 생각을 공유해보세요">
<div class="input_button">
<input type="submit" name="Join-button">
<input type="reset" name="reset-button">
</div>
</div>
<div class="team-table">
<h4>팀원끼리의 방명록입니다.</h4>
<?php
if($res_all_query){
while($row1 = mysqli_fetch_row($res_team_query)) {
echo "<table>";
echo "<tr>";
echo "<th>이름 </th> <td> {$row1[0]} </td>";
echo "<th>내용 </th> <td> {$row1[1]} </td>";
echo "<th>시간</th> <td> {$row1[2]} </td>";
echo "</tr>";
echo "</table>";
}
}?>
</div>
<div class="all-table">
<h4>모두의 방명록입니다.</h4>
<?php
if($res_team_query){
while($row2 = mysqli_fetch_row($res_all_query)) {
echo "<table>";
echo "<tr>";
echo "<th>이름: </th> <td> {$row2[0]} </td>";
echo "<th>내용: </th> <td> {$row2[1]} </td>";
echo "<th>시간: </th> <td> {$row2[2]} </td>";
echo "</tr>";
echo "</table>";
}
}?>
</div>
</form>
</body>
</html>