mysql_query($sql); $phone = $_REQUEST['phone']; $mess = $_REQUEST['mess']; $body = "Телефон: $phone"; mailer($par->adminemail,$par->adminemail,$par->server." Заказ звонка",$body); $_SESSION['sent'] = 1; $_SESSION['sent_text'] = $mess; $SendTime=date('Y-m-d H:i',time()); $phone2 = $varsline['phone_sent']; SendSms($phone2,'DO Podolie','Новый заказ обратного звонка на номер '.$phone.'',$SendTime); $refer = $_SERVER['HTTP_REFERER']; echo '<script> document.location.href = "'.$refer.'"; </script>'; exit(); }else{ $_SESSION['sent'] = 1; $_SESSION['sent_text'] = "Вы робот!"; $refer = $_SERVER['HTTP_REFERER']; echo '<script> document.location.href = "'.$refer.'"; </script>'; exit();
<?php require_once "framework/header.inc.php"; require_once "sms.php"; SendSms("سلام تست وب سرویس", "9155089018"); die; /*require_once("framework/PasswordHash.php"); $dt = PdoDataAccess::runquery("select * from BSC_persons where (UserName='' or UserName is null) AND NationalID<>''"); foreach($dt as $row) { $defaultPass = $row["NationalID"]; $hash_cost_log2 = 8; $hasher = new PasswordHash($hash_cost_log2, true); $newPass = $hasher->HashPassword(md5($defaultPass)); PdoDataAccess::runquery("update BSC_persons set UserName=?, UserPass=? where PersonID=?", array($row["NationalID"],$newPass, $row["PersonID"])); echo $row["PersonID"] . " : " . (PdoDataAccess::GetExceptionCount()>0 ? "false" : "true") . "<br>"; flush(); ob_flush(); } print_r(ExceptionHandler::PopAllExceptions()); die();*/ ?> <META http-equiv=Content-Type content="text/html; charset=UTF-8" ><body dir="rtl"> <? if(isset($_POST["submit"])) { merging($_POST["main"],$_POST["sub"]); }
{ foreach ($completed["email"] as $item) { $sql = "UPDATE `task_to_user` SET email_sended = 1 " . "WHERE task_id = '" . $item["task_id"] . "' AND user_id = '" . $item["user_id"] . "'; "; $db->query($sql); } foreach ($completed["phone"] as $item) { $sql = "UPDATE `task_to_user` SET phone_sended = 1 " . "WHERE task_id = '" . $item["task_id"] . "' AND user_id = '" . $item["user_id"] . "'; "; $db->query($sql); } } //получаем список тех, кому нужно сообщить о таске $task_list = GetTaskList($db); //отправляем $completed = array("email" => array(), "phone" => array()); foreach ($task_list as $item) { //если нужно отправить email if ($item["email_notify"] == 1) { if (SendEmail($item)) { //добавить в $completed array_push($completed["email"], $item); } } if ($item["phone_notify"] == 1) { if (SendSms($task)) { //добавить в $completed array_push($completed["phone"], $item); } } } //Saving send state SaveState($completed, $db);