-
Notifications
You must be signed in to change notification settings - Fork 0
/
smsapi.html
105 lines (88 loc) · 2.99 KB
/
smsapi.html
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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="bootstrap-5.0.2-dist/bootstrap-5.0.2-dist/css/bootstrap-grid.css">
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<title>Hello, world!</title>
</head>
<style>
#td {
padding: 30px;
}
table {
width: 100%;
}
@media only screen and (max-width: 600px) {
body {
margin: 0px;
}
}
</style>
<body style="margin:0 20% 0 20%;text-align: center;">
<table class="table-bordered blu">
<tr>
<td colspan="2"></td>
<td colspan="4">prevoz</td>
</tr>
<tr>
<td>vozac</td>
<td>tel broj</td>
<td colspan="2">trgnuvnje</td>
<td colspan="2">pristiganje</td>
</tr>
<tr>
<td>sasko M</td>
<td>070792644</td>
<td>10.1.22</td>
<td>15h</td>
<td>10.1.22</td>
<td>18h</td>
</tr>
</table>
<br>
<input id="name" class="input-group" type="text" placeholder="name">
<input id="phone" class="input-group" type="text" placeholder="phone">
<input id="2fa" style="display: none;" class="input-group" type="text" placeholder="2fa">
<button class="btn btn-outline-dark" onclick="sendSMS()" type="button" value="hello">sends sms</button>
<script>
var twofanumber = Math.floor(Math.random() * 10000);
var smsSent = false;
function sendSMS() {
var name = document.getElementById("name");
var phone = document.getElementById("phone");
var twofa = document.getElementById("2fa");
twofa.style.display = "block";
if (twofanumber != twofa.value) {
const Http = new XMLHttpRequest();
const url = "https://trigger.macrodroid.com/0294954a-6bbb-45f9-880a-204ead3ac7ee/sendsms?name=" + name.value + "&phone=" + phone.value + "&2fa=" + twofanumber;
Http.open("GET", url);
if(!smsSent){
Http.send();
smsSent = true;
}else{
window.alert("veke e isprated sms kod na "+phone.value);
}
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
}
} else {
window.alert("kodot e tocen, uspesno zakazavte mesto");
}
}
</script>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</body>
</html>