function pusher() { IMBAuth::checkOAuth(); // pr($_POST); if ($_POST['ids'] == "") { die("Please insert Customer ID"); } if ($_POST['camp_id'] == "") { die("Please insert Campaign ID"); } $ids = addslashes($_POST['ids']); $ps = new PushNotCamp(); $ps->getByID(addslashes($_POST['camp_id'])); $exp = explode(",", $ids); $arrAcc = array(); foreach ($exp as $ac) { $arrAcc[] = trim(rtrim($ac)); } //from acc get device ID Pusher::sendUsingAccountArray($arrAcc, $ps, 1); //1 for testing }
public static function pusher4PopUp($ids) { // IMBAuth::checkOAuth(); // pr($_POST); if ($ids == "") { die("Please insert Customer ID"); } // if($camp_id == "")die("Please insert Campaign ID"); $ps = new PushNotPopUp(); // $arrPS = $ps->getWhere("camp_app_popup = 1 AND camp_active = 1 ORDER BY camp_id DESC LIMIT 0,1"); //berdasarkan request 27 Jan 2016, skrg bisa multiple send push not $arrPS = $ps->getWhere("camp_app_popup = 1 AND camp_active = 1 ORDER BY camp_id DESC"); if (count($arrPS) > 0) { foreach ($arrPS as $ps) { // $ps = $arrPS[0]; // $exp = explode(",", $ids); // $arrAcc = array(); // foreach ($exp as $ac) { // $arrAcc[] = trim(rtrim($ac)); // } //dijadikan singular... $arrAcc = array(); $arrAcc[] = $ids; $_POST['no_echo'] = 1; //from acc get device ID Pusher::sendUsingAccountArray($arrAcc, $ps, 0); //1 for testing } } }