-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact_us.php
67 lines (59 loc) · 1.9 KB
/
contact_us.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
<!DOCTYPE html>
<?php
include 'classes/session.php';
Session :: sessionStart();
if(@!Session :: get_session('email')){
header("location:login.php");
}
else{
include 'nav.php';
include 'classes/contact_employee.php';
echo "<br><br><br><br><br><br>";
$sender_id = Session :: get_session('id') ;
$user = new person();
$user->select_mesage_type(new contact_us());
$messages = $user->view_chat($user_id);
$order = "general";
?>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="contact_employee.css">
</head>
<body>
<section>
<h3></h3>
<div class="messages">
<?php
foreach($messages as $Message){
if(Session::get_session('id') == $Message['receiver_id']){
?>
<div class="receiver_message">
<p><?=$Message['message_content']?></p>
</div>
<?php }
else{
?>
<div class="sender_message">
<p><?=$Message['message_content']?></p>
</div>
<?php }}?>
</div>
<form method="post" action="" class="input-group">
<textarea required="" name="message"></textarea>
<input type="submit" value="send" name="send_message">
</form>
</section>
</body>
</html>
<?php
if(isset($_POST['send_message'])){
$message_content = $_POST['message'];
$sender_id = Session::get_session('id');
if(Session::get_session('admin'))
$receiver_id = $user_id;
$user->write_message($sender_id, $receiver_id, $order, $message_content);
header("location:contact_us.php");
}}
?>