forked from deeus/test01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
212 lines (174 loc) · 5.96 KB
/
index.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
<?php
header('Content-type: text/html; charset=utf-8');
session_start();
//error_reporting(E_ALL);
include('include/db_connect.php');
if (isset($_GET['action'])){
if($_GET['action'] == "logout"){
session_unset();
session_destroy(); // разрушаем сессию
}
};
if (isset($_SESSION['user_id'])) {
$user_login=$_SESSION['user_login'];
$user_fio=$_SESSION['user_fio'];
}
?>
<html>
<head>
<meta charset="utf-8" />
<title>Стена сообщений - Главная</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="bootstrapValidator.min.css">
<link rel="stylesheet" href="mystyles.css">
</head>
<body>
<!-- подкл Меню сайта -->
<?php
require_once 'include/head.php';
?>
<!-- main div -->
<div class="container">
<!-- main blocks -->
<div class="row">
<div class="container">
<div class="container">
</div>
</div>
<!-- user block up -->
<?php
if (isset($_SESSION['user_login'])) {
?>
<div class="container ">
<div class="row">
<div class="hidden-lg hidden-md hidden-sm col-xs-12">
<div class="panel panel-default" >
<div class="panel-heading">
<b>Учетная запись</b>
</div>
<div class="panel-body">
<div class="username " id="username">
<label>
<?php
echo $user_fio;
?>
</label>
</div>
<div class="row">
</br>
</div>
<div class="exitbutton " id="exitbutton">
<a class="btn btn-primary " href="?action=logout">
<i class="fa fa-sign-out "></i> Выйти
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
<!-- user block up -->
<!-- up form block -->
<div class="container ">
<?php
if (isset($_SESSION['user_login'])) {
?>
<div class="row">
<div class="msg col-lg-8 col-md-8 col-sm-8 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<b>Сообшение</b>
</div>
<div class="panel-body">
<!-- Сообщение об успешной отправке -->
<div class="alert alert-success alert-dismissible collapse" role="success" id="authMessage">
<button class="close" type="button" onclick="$('.alert').hide();">
<span>×</span>
</button>
<strong>Сообщение отправлено!</strong>
</div>
<form class="form-horisontal " id="messageForm" method="POST" onSubmit="return false;">
<div class="form-group ">
<textarea id="msgtext" name="msgtext" class="textmsg form-control" rows="3"></textarea>
<input type="hidden" name="author_fio" value="<?php echo $user_fio; ?>">
<input type="hidden" name="author_login" value="<?php echo $user_login; ?>">
</div>
<div class="row">
</div>
<div class="sendbutton " id="sendbutton">
<button id="addPost" name="addPost" class="btn btn-primary " type="submit" >
<i class="fa fa-check"></i> Отправить
</button>
<button class="btn btn-default " type="reset" onClick="resetForm();">
<i class="fa fa-times"></i> Очистить
</button>
</div>
</form>
</div>
</div>
</div>
<div class="usr col-lg-4 col-md-4 col-sm-4 hidden-xs">
<!-- -->
<div class="panel panel-default" >
<div class="panel-heading">
<b>Учетная запись</b>
</div>
<div class="panel-body">
<div class="username " id="username">
<label>
<?php
echo $user_fio;
?>
</label>
</div>
<div class="row">
</br>
</div>
<div class="exitbutton " id="exitbutton">
<a class="btn btn-primary " href="?action=logout">
<i class="fa fa-sign-out"></i> Выйти
</a>
</div>
</div>
</div>
</div>
</div>
<hr>
<?php
}
?>
<!-- Вывод постов -->
<div class="newMessageDiv">
</div>
<?php require_once 'include/posts.php'; ?>
</div>
<!-- main block -->
<hr>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="js/maskedinput.min.js"></script>
<script src="js/bootstrapValidator.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
/*
}
else {
//die(header("Location: auth.php"));
//header("Location: auth.php");
}
*/
?>