-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend-message.php
More file actions
210 lines (162 loc) · 6.98 KB
/
send-message.php
File metadata and controls
210 lines (162 loc) · 6.98 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
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
<?php
include_once("header.php");
include_once("navigation.php");
include_once("adminsidebar.php");
include_once('connection.php');
echo '<div data-aos="fade-right" data-aos-duration="1500">';
echo '<div id="page-content-wrapper">';
echo '<div class="alert alert-success" id="messagealert" style="display: none;"><h3 align="center"><i class="fa fa-thumbs-o-up"></i> Message Succesfully Sent!</h3></div>';
if (isset($_GET['id']) && isset($_GET["cname"])){
$id = $_GET['id'];
$cname = $_GET['cname'];
$sql = "SELECT * FROM registration WHERE FULLNAME = '$cname'";
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($result);
}
?>
<br/><br/>
<div>
<div class="col-md-6" style="border-right: 2px dotted grey; padding-right: 50px;">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-9">
<h3 class="title"><i class="fa fa-signal" aria-hidden="true"></i> Send Sms</h3>
</div>
</div>
<br/>
<fieldset>
<div class="form-horizontal">
<!-- Email input-->
<div class="form-group">
<label class="col-md-3 control-label" for="sms">Recepient</label>
<div class="col-md-9">
<input id="sms" name="sms" type="text" onblur="removeMessageAlert()" placeholder="eg. 09123456789" class="form-control" value="<?php if (isset($_GET['id'])) { echo $row['PCONTACT'];}?>">
</div>
</div>
<!-- Message body -->
<div class="form-group">
<label class="col-md-3 control-label" for="message">Your message</label>
<div class="col-md-9">
<textarea class="form-control" id="message" name="message" onblur="removeMessageAlert()" placeholder="Please enter your message here..." rows="5"></textarea>
</div>
</div>
<!-- Form actions -->
<div class="form-group">
<label class="col-md-3 control-label" for="submit"></label>
<div class="col-md-9">
<button class="btn btn-primary btn-lg btn-block" onclick="sendSms()">Send SMS</button>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-9">
<h3 class="title"><i class="fa fa-share" aria-hidden="true"></i> Send Email</h3>
</div>
</div>
<div class="form-horizontal">
<br/>
<fieldset>
<!-- Email input-->
<div class="form-group">
<label class="col-md-3 control-label" for="email">E-mail</label>
<div class="col-md-9">
<input id="email" name="email" type="text" onblur="removeMessageAlert()" placeholder="example@example.com" class="form-control" value="<?php if (isset($_GET['id'])) { echo $row['EMAIL'];}?>">
</div>
</div>
<!-- Subject input-->
<div class="form-group">
<label class="col-md-3 control-label" for="email">Subject</label>
<div class="col-md-9">
<input id="subject" name="subject" type="text" onblur="removeMessageAlert()" placeholder="Subject" class="form-control">
</div>
</div>
<!-- Message body -->
<div class="form-group">
<label class="col-md-3 control-label" for="message">Your message</label>
<div class="col-md-9">
<textarea class="form-control" id="message1" onblur="removeMessageAlert()" name="message" placeholder="Please enter your message here..." rows="5"></textarea>
</div>
</div>
<!-- Form actions -->
<div class="form-group">
<label class="col-md-3 control-label" for="message"></label>
<div class="col-md-9">
<button class="btn btn-primary btn-lg btn-block" onclick="sendEmail()">Submit</button>
</div>
</div>
</fieldset>
</div>
</fieldset>
</form>
</div> <!-- col-md-6 -->
<div class="col-md-5" style=" padding-left: 50px;">
<div class="col-md-1">
<i class="fa fa-search fa-2x" onclick="displayContact()"></i>
</div>
<div class="col-md-8">
<input type="text" id="displayContact" onkeyup="displayContact()" class="form-control">
</div>
<div class="col-md-3">
<input type="button" value="search" class="btn btn-primary">
</div>
<br/><br/>
<div class="row">
<div id="displayContactDiv">
<?php
$sql = "SELECT * FROM contact";
$result = mysqli_query($conn,$sql);
echo "<table class='table table-bordered table-hover table-striped'>";
echo '<tr>
<th>Name</th>
<th>Phone Number</th>
<th>Email</th>
<th>Del</th></tr>';
while ($row = mysqli_fetch_array($result)){
echo '<tr>
<td>'.$row["CNAME"].'</td>
<td>'.$row["CNUM"].'</td>
<td>'.$row["CEM"].'</td>
<td><center><button class="btn-danger" onclick="deleteContact('.$row["ID"].')"><i class="fa fa-trash-o" style="color: white"></i></button></center></td>
</tr>';
}
echo '</table>';
?>
</div>
<div id="addToContacts">
<br/>
<h3> <i class="fa fa-book"></i> Add Contact <small id="successAdded" style="display: none">Succeessfully added...</small></h3>
<br/>
<div class="form-group">
<label class="col-md-4 control-label" for="email">Name: </label>
<div class="col-md-8">
<input id="contactName" type="text" placeholder="eg. nicole" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="email">Phone Number: </label>
<div class="col-md-8">
<input id="contactPhone" type="text" placeholder="eg. 09123456789" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="email">Email Address: </label>
<div class="col-md-8">
<input id="contactEmail" type="email" placeholder="example@example.com" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label class="col-md-8 control-label" for="email"></label>
<div class="col-md-4">
<br/>
<input type="button" value="Add to Contacts" class="btn btn-warning" onclick="addToContacts()">
</div>
</div>
</div><!-- addtoContacts -->
</div><!-- row -->
<br/><br/><br/>
</div> <!-- col-md-6 -->
</div> <!-- row -->
<?php
include_once('footeradmin.php');
?>