-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathussd.php
74 lines (57 loc) · 3.05 KB
/
ussd.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
<?php
$sessionId = $_POST["sessionId"];
$serviceCode = $_POST["serviceCode"];
$phoneNumber = $_POST["phoneNumber"];
$text = $_POST["text"];
$date1 = date("Y-m-d");
$todayssDate = str_replace('-', '/', $date1);
if ( $text == "" ) {
$response = "CON What would you like to do? \n";
$response .= "1. Make reservation \n";
} else if ( $text == "1" ) {
$response = "CON How many people will be in attendance? \n";
$response .= "2. 1-3 \n";
$response .= "3. 4-6 \n";
$response .= "4. 7-10 \n";
} else if ( $text == "2" ) {
$response = "CON When would you like to come \n";
$response .= "5. $todayssDate";
$response .= 6. date('Y-m-d', strtotime($todayssDate ." +1 days"));
$response .= "7. date('Y-m-d', strtotime($todayssDate ." +2 days"))";
$response .= "8. date('Y-m-d', strtotime($todayssDate ." +3 days"))";
$response .= "9. date('Y-m-d', strtotime($todayssDate ." +4 days"))";
$response .= "10. date('Y-m-d', strtotime($todayssDate ." +5 days"))";
$response .= "11. date('Y-m-d', strtotime($todayssDate ." +6 days"))";
} else if ( $text == "3" ) {
$response = "CON When would you like to come \n";
$response .= "5. $todayssDate";
$response .= "6. date('Y-m-d', strtotime($todayssDate ." +1 days"))";
$response .= "7. date('Y-m-d', strtotime($todayssDate ." +2 days"))";
$response .= "8. date('Y-m-d', strtotime($todayssDate ." +3 days"))";
$response .= "9. date('Y-m-d', strtotime($todayssDate ." +4 days"))";
$response .= "10. date('Y-m-d', strtotime($todayssDate ." +5 days"))";
$response .= "11. date('Y-m-d', strtotime($todayssDate ." +6 days"))";
} else if ( $text == "4" ) {
$response = "CON When would you like to come \n";
$response .= "5. $todayssDate";
$response .= "6. date('Y-m-d', strtotime($todayssDate ." +1 days"))";
$response .= "7. date('Y-m-d', strtotime($todayssDate ." +2 days"))";
$response .= "8. date('Y-m-d', strtotime($todayssDate ." +3 days"))";
$response .= "9. date('Y-m-d', strtotime($todayssDate ." +4 days"))";
$response .= "10. date('Y-m-d', strtotime($todayssDate ." +5 days"))";
$response .= "11. date('Y-m-d', strtotime($todayssDate ." +6 days"))";
} else if ($text == "5"){
$response = "END You have made a reservation for $todayssDate";
} else if ($text == "6"){
$response = "END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +1 days"))";
} else if ($text == "7"){
$response = "END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +2 days"))";
}else if ($text == "8"){
$response = "END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +3 days"))";
}else if ($text == "9"){
$response = " END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +4 days"))";
}else if ($text == "10"){
$response = "END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +5 days"))";
}else if ($text == "11"){
$response = "END You have made a reservation for date('Y-m-d', strtotime($todayssDate ." +6 days"))";
}