-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathajax_send_command.php
More file actions
38 lines (37 loc) · 1.34 KB
/
ajax_send_command.php
File metadata and controls
38 lines (37 loc) · 1.34 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
<?
// ===================================================================
// Sim Roulette -> AJAX
// License: GPL v3 (http://www.gnu.org/licenses/gpl.html)
// Copyright (c) 2016-2025 Sim Roulette, https://sim-roulette.com
// ===================================================================
include("_func.php");
//$com=htmlspecialchars_decode(str_replace('#','#',str_replace('+','+',str_replace('!','&',urldecode($_GET['command'])))));
if ($result = mysqli_query($db, 'SELECT `model`,`data` FROM `devices` WHERE `id`='.(int)$_GET['device']))
{
if ($row = mysqli_fetch_assoc($result))
{
if (strpos($row['model'],'SR-Nano')!==false)
{
$data=unserialize($row['data']);
if ($data['modem']=='SIM5320' || $data['modem']=='SIM5360' || $data['modem']=='SIM7100')
{
$com=str_replace('clear_sms','modem>send:AT+CMGD=0,4',$_GET['command']);
}
else
{
$com=str_replace('clear_sms','modem>send:AT+CMGDA=5',$_GET['command']);
}
}
elseif (strpos($row['model'],'SR-Box-2')!==false)
{
$com=str_replace('clear_sms','modem>pack:AT+CMGD=0,4',$_GET['command']);
}
else
{
// $com=str_replace('clear_sms','modem>pack:AT+CMGDA="DEL ALL"##ALL##1',$_GET['command']);
$com=str_replace('clear_sms','modem>pack:AT+CMGDA=5##ALL##1',$_GET['command']);
}
}
}
sr_command((int)$_GET['device'],$com);
?>Команда отправлена