-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_message.php
More file actions
165 lines (142 loc) · 5.44 KB
/
send_message.php
File metadata and controls
165 lines (142 loc) · 5.44 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
<?php
session_start();
?>
<?php
require_once("admin/includes/connection.php");
if (isset($_POST['submit'])) {
$email=$_POST['email'];
$message=$_POST['message'];
$sid=$_POST['s_id'];
if($email==""||$message=="")
{
$_SESSION['errormsg']="All Fields Are Required";
header("Location:send_message.php");
} else{
$query1="INSERT INTO `student_msgs`(`s_id`, `email`, `message`) VALUES ('$sid','$email','$message')";
global $connection;
$result= mysqli_query($connection, $query1);
if ($result) {
$_SESSION['successmsg']="Add successfully";
header("location:view_message.php");
} else {
$_SESSION['errormsg']="data not insert";
header("Location:view_message.php");
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<!-- Basic Page Info -->
<meta charset="utf-8">
<title>DeskApp - Bootstrap Admin Dashboard HTML Template</title>
<!-- Site favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="vendors/files/apple-touch-icon.png">
<link rel="icon" type="file/png" sizes="32x32" href="vendors/files/favicon-32x32.png">
<link rel="icon" type="file/png" sizes="16x16" href="vendors/files/favicon-16x16.png">
<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="vendors/styles/core.css">
<link rel="stylesheet" type="text/css" href="vendors/styles/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="src/plugins/datatables/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" type="text/css" href="src/plugins/datatables/css/responsive.bootstrap4.min.css">
<link rel="stylesheet" type="text/css" href="vendors/styles/style.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-119386393-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-119386393-1');
</script>
</head>
<body>
<?php
require_once("includes/header.php");
?>
<?php
require_once("includes/sidebar.php");
?>
<div class="mobile-menu-overlay"></div>
<div class="main-container col-md-8" style="margin-left:120px;">
<div class="">
<div class="min-height-300px">
<div class="pd-20 card-box mb-30">
<h3 class="p-3">Send Message To Admin</h3>
<!----------------------- success msg ---------------------------->
<?php
if (isset($_SESSION['successmsg'])) {
?>
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="d-flex align-items-center justify-content-start">
<i class="icon ion-ios-checkmark alert-icon tx-32 mg-t-5 mg-xs-t-0"></i>
<strong>Success!</strong> <?php echo $_SESSION['successmsg']; ?>
</div><!-- d-flex -->
</div><!-- alert -->
<?php
unset($_SESSION['successmsg']);
}
?>
<!----------------------- errormsg ---------------------------->
<?php
if (isset($_SESSION['errormsg'])) {
?>
<div class="alert alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="d-flex align-items-center justify-content-start">
<i class="icon ion-ios-checkmark alert-icon tx-32 mg-t-5 mg-xs-t-0"></i>
<strong>Alert!</strong> <?php echo $_SESSION['errormsg']; ?>
</div><!-- d-flex -->
</div><!-- alert -->
<?php
unset($_SESSION['errormsg']);
}
?>
<div class="wizard-content">
<form class="tab-wizard" action="" method="POST">
<section class="col-md-12">
<div class="row">
<div class="col-md-12">
<?php
$sid=$_SESSION['student_id'];
?>
<input type="hidden" name="s_id" value=" <?php echo $sid;?>" class="form-control">
<div class="form-group">
<label >Email</label>
<input type="email" name="email" class="form-control">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label >Message</label>
<input type="text" name="message" class="form-control">
</div>
</div>
</div>
<button class="btn btn-md btn-primary w-100" type="submit" name="submit">Submit</button>
</section>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- js -->
<script src="vendors/scripts/core.js"></script>
<script src="vendors/scripts/script.min.js"></script>
<script src="vendors/scripts/process.js"></script>
<script src="vendors/scripts/layout-settings.js"></script>
<script src="src/plugins/jquery-steps/jquery.steps.js"></script>
<script src="vendors/scripts/steps-setting.js"></script>
</body>
</html>