-
Notifications
You must be signed in to change notification settings - Fork 36
/
send.php
27 lines (23 loc) · 757 Bytes
/
send.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
<?php
include_once 'config.php';
$count = 0;
$users = $sql->query("SELECT * FROM `users`");
$send = $sql->query("SELECT * FROM `sends`")->fetch_assoc();
if ($send['send'] == 'yes') {
if ($send['step'] == 'send') {
if ($send['type'] == 'text') {
while ($row = $users->fetch_assoc()) {
sendMessage($row['from_id'], $send['text']);
$count++;
}
}
} elseif ($user['step'] == 'forward') {
while ($row = $users->fetch_assoc()) {
forwardMessage($from_id, $row['from_id'], $send['text']);
$count++;
}
} else {
die('Error');
}
}
echo json_encode(['status' => true, 'msg' => 'send is successfuly.', 'status_code' => 200], 448);;