-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnotification.php
More file actions
42 lines (35 loc) · 926 Bytes
/
notification.php
File metadata and controls
42 lines (35 loc) · 926 Bytes
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
<?php
// Receive Notification From Send / Reply
include_once 'includes/header.inc.php';
try {
$message_type = $_POST["message_type"];
} catch (Exception $e) {
echo "Error";
exit(0);
}
if ($message_type == "outgoing") {
try {
$message_id = $_POST["message_id"];
$mobile_number = $_POST["mobile_number"];
$shortcode = $_POST["shortcode"];
$status = $_POST["status"];
$timestamp = $_POST["timestamp"];
$credits_cost = $_POST["credits_cost"];
// Table Fields
$fields = array( "message_type" => "outgoing",
"shortcode" => $shortcode,
"message_id" => $message_id,
"status" => $status,
"credits_cost" => $credits_cost,
"timestamp" => $timestamp);
$base = new Base;
$base->insertNotification($fields);
echo "Accepted";
exit(0);
} catch (Exception $e) {
echo "Error"; exit(0);
}
} else {
echo "Error"; exit(0);
}
?>