-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcliente_javascript.php
160 lines (157 loc) · 4.12 KB
/
cliente_javascript.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
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
<?php
#
error_reporting(E_ERROR|E_WARNING);
ini_set('display_errors', '1');
?>
<html>
<head>
<script>
//
function objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
//
//
function EnviarWhatsApp(){
//
//
apikey=document.getElementById("apikey").value;
//
//
puerto=document.getElementById("puerto").value;
//
//
linea=document.getElementById("linea").value;
//
//
fono=document.getElementById("fono").value;
mensaje=document.getElementById("mensaje").value;
//
// copiar a los sgtes fonos
fono_cc_1=document.getElementById("fono_cc_1").value;
fono_cc_2=document.getElementById("fono_cc_2").value;
fono_cc_3=document.getElementById("fono_cc_3").value;
//
if(fono=="" || mensaje==""){
alert("Fono o Mensaje esta vacio !!!");
return;
}
//
// SOLO 3 OPCIONES DISPONIBLES POR EL MOMENTO
// PDF PNG vacio
tipo_adjunto=document.getElementById("tipo_adjunto").value;
//
// https://www.algo.tld/carpeta/fotos/imagen.png
url_adjunto=document.getElementById("url_adjunto").value;
//
// DEBE IR EN BLANCO SIEMPRE POR EL MOMENTP
url_documento="";
//
//
// URL DEL ENDPOINT ( NO CAMBIAR )
url_endpoint="https://whapi.online/api/servidor.php";
//
// PUERTO DEL ENDPOINT ( NO CAMBIAR )
puerto_endpoint="443";
//
//
//
var vars=
"&puerto="+puerto+
"&apikey="+apikey+
"&linea="+linea+
"&fono="+fono+
"&fono_cc_1="+fono_cc_1+
"&fono_cc_2="+fono_cc_2+
"&fono_cc_3="+fono_cc_3+
"&mensaje="+mensaje+
"&tipo_adjunto="+tipo_adjunto+
"&url_adjunto="+url_adjunto+
"&url_documento="+url_documento;
//
console.log("linea="+linea);
console.log("fono destino="+fono);
console.log("fono_cc_1="+fono_cc_1);
console.log("fono_cc_2="+fono_cc_2);
console.log("fono_cc_3="+fono_cc_3);
console.log("url="+url_endpoint);
console.log("puerto="+puerto_endpoint);
//
console.log("Enviando: "+vars);
//
//
ajaxEnviarWhatsApp=objetoAjax();
ajaxEnviarWhatsApp.open("POST",url_endpoint,true);
ajaxEnviarWhatsApp.onreadystatechange=function() {
if (ajaxEnviarWhatsApp.readyState==1) {
// cargando
}
if (ajaxEnviarWhatsApp.readyState==4) {
respuesta = ajaxEnviarWhatsApp.responseText;
alert("Respuesta="+respuesta);
console.log("Respuesta="+respuesta);
}
}
ajaxEnviarWhatsApp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajaxEnviarWhatsApp.send(vars);
}
</script>
<title>WHAPI.ONLINE</title>
</head>
<body>
<h1>WHAPI.ONLINE => Enviar WhatsApp:</h1>
<br>
<h3>FONO EMISOR::</h3>
<input type="text" id="linea" value="569XXXXXXXX" >
<br>
<h3>PUERTO DESTINO:</h3>
<input type="text" id="puerto" value="PUERTO-SERVIDOR-WHATSAPP">
<br>
<h3>APIKEY TOKEN:</h3>
<input type="text" value="AQUI-VA-SU-APIKEY-TOKEN" id="apikey">
<hr>
<br>
<h3>FONO DESTINO:</h3>
<input type="text" id="fono" value="569ZZZZZZZZ">
<br>
<h3>FONO DESTINO COPIA 1:</h3>
<input type="text" id="fono_cc_1" value="">
<br>
<h3>FONO DESTINO COPIA 2:</h3>
<input type="text" id="fono_cc_2" value="">
<br>
<h3>FONO DETINO COPIA 3:</h3>
<input type="text" id="fono_cc_3" value="">
<br>
<h3>MENSAJE:</h3>
<input type="text" id="mensaje" value="Hola :)
😄😆🙂😏
🤩🥸😎🤓
🧐🤨🤪😜
Somos Whapi.OnLine!
<?php echo "Time=".time(); ?>">
<br>
<h3>TIPO ADJUNTO ( vacio - PDF - PNG ) :</h3>
<input type="text" id="tipo_adjunto" value="PNG">
<br>
<h3>URL ADJUNTO (https://www.algo.tld/carpeta/archivo.png):</h3>
<input type="text" id="url_adjunto" value="https://whapi.online/assets/img/whapi_demo.png">
<br>
<br>
<input type="button" onClick="javascript:EnviarWhatsApp()" value="Enviar WhatsApp">
<br>
</body>
</html>