-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkirim_checkall.php
45 lines (39 loc) · 920 Bytes
/
kirim_checkall.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
<?php
include 'sistem/db/MysqliDb.php';
$db = new MysqliDb();
// $data = array('haha');
// $post = $_POST['param1'];
if (!empty($_POST['param1'])) {
$post = $_POST['param1'];
$retVal = $_POST['isine'] ;
$data = $post;
foreach ($data as $key) {
// $hasil[] = $key;
$db->where('id_pelanggan', $key);
$pel = $db->getOne('pelanggan');
$arraydata[] = array(
'id'=>$pel['id_pelanggan'],
'no_telp'=>$pel['no_telepon'],
'isi'=> $retVal
);
}
foreach ($arraydata as $key ) {
$sms = array(
'DestinationNumber'=>$key['no_telp'],
'TextDecoded'=>$key['isi'],
'CreatorID'=>'Gammu'
);
$db->insert('outbox', $sms);
$notif = array(
'id_pelanggan'=>$key['id'],
'isi_notifikasi'=>$key['isi'],
'jenis_notifikasi'=>'K'
);
$db->insert('notifikasi', $notif);
}
echo json_encode('Sukses kirim sms');
} else {
echo json_encode('tidak memilih checklist');
}
// print_r($data);
?>