-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact_employee.php
62 lines (56 loc) · 1.98 KB
/
contact_employee.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
<!DOCTYPE html>
<?php
include 'nav.php';
include 'classes/contact_employee.php';
echo "<br><br><br><br><br><br>";
$order_id = $_GET['order_id'];
$employee_id = $_GET['employee_id'];
$user_id = $_GET['user_id'];
$user = new person();
$user->select_mesage_type(new comamunication_between_employee_and_customer());
$messages = $user->view_chat($order_id);
?>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="contact_employee.css">
</head>
<body>
<section>
<h3></h3>
<div class="messages" style="position:relative">
<?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('employee'))
$receiver_id = $user_id;
else
$receiver_id = $employee_id;
$user->write_message($sender_id, $receiver_id, $order_id, $message_content);
//header("location:contact_employee.php?order_id=".$order_id."&employee_id=".$employee_id."&user_id=".$user_id);
}
?>