function doAutosend($frequency) { echo "autosending for '{$frequency}' <br/>\n"; global $uid; $do = DB_DataObject::factory(playsms_featAutoSend); $do->frequency = $frequency; $do->find(); if ($frequency == "startup") { gw_waitForStartup(); } while ($do->fetch()) { echo "sending {$do->id}, {$do->frequency}, {$do->number}, \"{$do->msg}\"... <br/>\n"; if (gpcode2gpid($uid, $do->number)) { websend2group("admin", $do->number, $do->msg); } else { websend2pv("admin", $do->number, $do->msg); } } }
$p_num = $_POST[p_num_text]; } $sms_to = $p_num; $msg_flash = $_POST[msg_flash]; $msg_unicode = $_POST[msg_unicode]; $message = $_POST[message]; if (($p_num || $sms_to) && $message) { $sms_type = "text"; if ($msg_flash == "on") { $sms_type = "flash"; } $unicode = "0"; if ($msg_unicode == "on") { $unicode = "1"; } list($ok, $to) = websend2pv($username, $sms_to, $message, $sms_type, $unicode); for ($i = 0; $i < count($ok); $i++) { if ($ok[$i]) { $error_string .= "Your SMS for `" . $to[$i] . "` has been delivered to queue<br>"; } else { $error_string .= "Fail to sent SMS to `" . $to[$i] . "`<br>"; } } header("Location: menu.php?inc=send_sms&op=sendsmstopv&message=" . urlencode($message) . "&err=" . urlencode($error_string)); } else { header("Location: menu.php?inc=send_sms&op=sendsmstopv&message=" . urlencode($message) . "&err=" . urlencode("You must select receiver and your message should not be empty")); } break; case "sendsmstogr": $message = $_GET[message]; $db_query = "SELECT * FROM playsms_tblUserGroupPhonebook WHERE uid='{$uid}' ORDER BY gp_name";
$type = trim($_GET[type]); if ($u && $p) { if (!validatelogin($u, $p)) { echo "ERR 100"; die; } } if ($ta) { switch ($ta) { case "PV": if ($to && $msg) { $transparent = false; if ($trn) { $transparent = true; } $smslog_id = websend2pv($u, $to, $msg); if ($smslog_id) { echo "OK {$smslog_id}"; } else { echo "ERR 200"; } } else { echo "ERR 201"; } die; break; case "BC": if ($to && $msg) { $transparent = false; if ($trn) { $transparent = true;