-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_message.php
168 lines (99 loc) · 3.43 KB
/
view_message.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
<?php
include('template/header.php');
$err = $_SESSION['err']??null;
unset($_SESSION['err']);
if(isset($_GET['msg_id'])){
$msg_id = $_GET['msg_id'];
}
else{
$err = "<div class='alert alert-danger alert-dismissible fade show col-sm-11' role='alert'>Message not found.
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
</div>";
}
?>
<?php
include('class/view.php');
$display = new display();
$result = $display->display_table_cndtn('message_box',"msg_id='$msg_id'");
$row=mysqli_fetch_assoc($result);
?>
<?php
if($row["msg_to"]==$_SESSION['login_emp_id']){
include('class/update.php');
$update = new update_data();
$update->update_msg_status($msg_id);
}
?>
<form class="bg-light h-100 mt-4 pl-5 pt-3">
<div class="form-group row">
<?php echo "$err"; ?>
</div>
<div class="form-group row">
<div class="col-sm-3"></div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="msgfrom" class="col-sm-2 col-form-label">From</label>
<div class="col-sm-6">
<span class="form-control">
<?php $result2 = $display->display_table_cndtn('employee',"emp_id={$row['msg_from']}");
$emp_name = mysqli_fetch_assoc($result2);
echo $emp_name['emp_name'];
?>
</span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="msgto" class="col-sm-2 col-form-label">To</label>
<div class="col-sm-6">
<span class="form-control">
<?php $result2 = $display->display_table_cndtn('employee',"emp_id={$row['msg_to']}");
$emp_name = mysqli_fetch_assoc($result2);
echo $emp_name['emp_name'];
?>
</span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="msgdate" class="col-sm-2 col-form-label">Date</label>
<div class="col-sm-3">
<span class="form-control"><?php echo $row['msg_date'] ?></span>
</div>
<div class="col-sm-3">
<span class="form-control"><?php echo $row['msg_time'] ?></span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="msgtitle" class="col-sm-2 col-form-label">Subject</label>
<div class="col-sm-6">
<span class="form-control"><?php echo $row['msg_title'] ?></span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="inputMsg" class="col-sm-2 col-form-label">Message</label>
<div class="col-sm-6">
<span class="form-control"><?php echo $row['msg_desc'] ?></span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-1"></div>
<label for="msgstatus" class="col-sm-2 col-form-label">Status</label>
<div class="col-sm-6">
<span class="form-control"><?php echo $row['msg_status'] ?></span>
</div>
</div>
<div class="form-group row">
<div class="col-sm-2"></div>
<label for="goback" class="col-sm-2 col-form-label"></label>
<div class="col-sm-4">
<a href="javascript:history.go(-1)"><input type="button" class="btn-primary form-control" id="goback" name="goback" value="Go to previous page"></a>
</div>
</div>
</form>
<?php include('template/footer.php'); ?>