alexa-tracking

Batasin sms

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/54ddc2b9bfcb17d04b8b456d/batasin-sms
Poll: error batasin sms
error batasin sms perhari 0% (0 votes)
error batasin sms perhari 0% (0 votes)
Batasin sms
help gan, ini kenapa ya IF nya ga mau jalan?emoticon-Bingung (S)

//----------------------------------------auto replay-----------------------------------------------
// query untuk membaca SMS yang belum diproses
$hasil = mysql_query("SELECT SenderNumber,ID,HOUR(ReceivingDateTime),TextDecoded FROM inbox WHERE Processed = '0'",$db);
while ($data = mysql_fetch_array($hasil))
{
// membaca ID SMS
$id = $data['ID'];

// membaca no pengirim
$noPengirim = $data['SenderNumber'];

// membaca pesan SMS dan mengubahnya menjadi kapital
$msg = strtoupper($data['TextDecoded']);
$waktu = $data['HOUR(ReceivingDateTime)'];
//pembanding
$d = date("Y-m-d");
$banding = mysql_query("SELECT TextDecoded FROM inbox WHERE DATE_FORMAT(ReceivingDateTime,'%Y-%m-%d') = ".$d." and SenderNumber = ".$noPengirim." order by ID Desc limit 0,1",$db2);
$inf = mysql_fetch_array($banding);
$pesan = strtoupper($inf['TextDecoded']);
$x= explode(" ", $pesan);
$y = explode("#", $x[1]);
// memecah pesan berdasarkan karakter <spasi>

$pecah = explode(" ", $msg);
$pecah2 = explode("#", $pecah[1]);

$jam = date("H");
$tanggal = date("dmy");
if(($pecah2[0] != $y[0]) && ($pecah2[1] != $y[1]) && ($pecah2[2] != $y[2])){

if (($pecah[0] == "GOC") && ($waktu<=23))

{

$reply1 ="Terimakasih data anda akan kami proses";
$hasil4 = mysql_query("INSERT INTO outbox(DestinationNumber, TextDecoded, CreatorID) VALUES ('$noPengirim', '$reply1', 'Gammu')",$db);
$hasil4 = mysql_query("UPDATE inbox SET Processed = '1' WHERE ID = '$id'",$db);
$masuk = mysql_query("INSERT INTO goc_sms.inbox (UpdatedlnDB,ReceivingDateTime,SenderNumber,TextDecoded,ID,Processed) SELECT UpdatedInDB,ReceivingDateTime,SenderNumber,TextDecoded,ID,Processed FROM gammu.inbox WHERE Processed = '1' order by ID desc limit 0,1");
}else if($waktu >=23){

$reply3 = "Mohon maaf, sms anda melewati jam 12 malam";
$hasil5 = mysql_query("INSERT INTO outbox(DestinationNumber, TextDecoded, CreatorID) VALUES ('$noPengirim', '$reply3', 'Gammu')",$db);
$hasil5 = mysql_query("UPDATE inbox SET Processed = '2' WHERE ID = '$id'",$db);

}else{

$reply2 = "Mohon maaf format anda salah. Format benar: GOC(spasi)idtoko#tglsales(ddmmyy)#kdproduk/qty, kdproduk/qty, kdproduk/qty,kdproduk/qty";
$hasil3 = mysql_query("INSERT INTO outbox(DestinationNumber, TextDecoded, CreatorID) VALUES ('$noPengirim', '$reply2', 'Gammu')",$db);
$hasil3 = mysql_query("UPDATE inbox SET Processed = '2' WHERE ID = '$id'",$db);
}

}
}

https://www.facebook.com/jakarta.software

itu bisa di group di sqlnya aja bro.

untuk diskusi bisa PM ane via FB aja
×