Exemple #1
0
function getNextNumberFromSql($sql, $field, $starting = '')
{
    $newconn = create_db_connection();
    $newconn->openselect(parseAndReplaceAll($sql));
    $maxvalue = $starting;
    if (!$newconn->eof()) {
        $maxvalue = $newconn->getvalue($field);
        $newconn->close();
    }
    return getNextNumber($maxvalue);
}
Exemple #2
0
        $subject = "Коцюбинський";
        //email body
        $message_body = "Клиент очень ждет Вашего звонка:" . "\n<br>\n\n" . "Имя: \n " . $user_name . "\n<br>\n\n" . "Телефон: \n " . $user_tel . "\n<br>\n\n" . "Email: \n " . $user_email . "\n<br>\n\n" . "Комментарий/Вопрос: \n " . $user_comment . "<br><br> URL откуда пришла заявка: " . $_POST["location"];
        //proceed with PHP email.
        $headers = 'From: kotsyubynsk' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'Reply-To: ' . $user_email . '' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        $send_mail = mail($to_email, $subject, $message_body, $headers);
        if (!$send_mail) {
            //If mail couldn't be sent output error. Check your PHP email configuration (if it ever happens)
            $output = json_encode(['type' => 'error', 'text' => 'Could not send mail! Please check your PHP mail configuration.']);
            exit($output);
        } else {
            $url = 'https://docs.google.com/forms/d/e/1FAIpQLScQ3EbazmFje0cY4GmLT3Zvsu_aWOeBX97p44C53MO3qfWdtw/formResponse';
            // куда слать, это атрибут action у гугл формы
            $data = array();
            // массив для отправки в гугл форм
            $data['entry.1898095542'] = getNextNumber();
            $data['entry.441979965'] = $user_name;
            $data['entry.1437418522'] = $user_tel;
            $data['entry.1863557833'] = $user_email;
            $data['entry.1058019864'] = $user_comment;
            $data = http_build_query($data);
            $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => $data));
            $context = stream_context_create($options);
            // создаем контекст отправки
            $result = file_get_contents($url, false, $context);
            $output = json_encode(['type' => 'message', 'text' => 'Hi ' . $user_name . ' Thank you for your email']);
            exit($output);
        }
    }
} else {
    $output = json_encode(['type' => 'error', 'text' => 'You have already submitted the form with the data']);
Exemple #3
0
        $subject = "Коцюбинський";
        //email body
        $message_body = "Клиент очень ждет Вашего звонка:" . "\n<br>\n\n" . "Телефон: \n " . $user_tel . "\n<br>\n\n" . "<br><br> URL откуда пришла заявка: " . $_POST["location"];
        //proceed with PHP email.
        $headers = 'From: kotsyubynsk' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'Reply-To: ' . $user_name . '' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        $send_mail = mail($to_email, $subject, $message_body, $headers);
        if (!$send_mail) {
            //If mail couldn't be sent output error. Check your PHP email configuration (if it ever happens)
            $output = json_encode(['type' => 'error', 'text' => 'Could not send mail! Please check your PHP mail configuration.']);
            exit($output);
        } else {
            $url = 'https://docs.google.com/forms/d/e/1FAIpQLSfPLeeQvq8DP3V8Dcm94KNlUFOQ9ITEOwvT1JNdr7bdVWdsrQ/formResponse';
            // куда слать, это атрибут action у гугл формы
            $data = array();
            // массив для отправки в гугл форм
            $data['entry.1268529292'] = getNextNumber();
            $data['entry.557716529'] = $user_tel;
            $data['entry.1641626580'] = $user_popup;
            $data = http_build_query($data);
            $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => $data));
            $context = stream_context_create($options);
            // создаем контекст отправки
            $result = file_get_contents($url, false, $context);
            $output = json_encode(['type' => 'message', 'text' => 'Hi ' . $user_name . ' Thank you for your email']);
            exit($output);
        }
    } else {
        $output = json_encode(['type' => 'error', 'text' => 'You have already submitted the form with the data']);
        exit($output);
    }
} else {
Exemple #4
0
        $subject = "Коцюбинський";
        //email body
        $message_body = "Клиент очень ждет Вашего звонка:" . "\n<br>\n\n" . "Имя: \n " . $user_name . "\n<br>\n\n" . "Телефон: \n " . $user_tel . "\n<br>\n\n" . "<br><br> URL откуда пришла заявка: " . $_POST["location"];
        //proceed with PHP email.
        $headers = 'From: kotsyubynsk' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'Reply-To: ' . $user_name . '' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        $send_mail = mail($to_email, $subject, $message_body, $headers);
        if (!$send_mail) {
            //If mail couldn't be sent output error. Check your PHP email configuration (if it ever happens)
            $output = json_encode(['type' => 'error', 'text' => 'Could not send mail! Please check your PHP mail configuration.']);
            exit($output);
        } else {
            $url = 'https://docs.google.com/forms/d/e/1FAIpQLSedWl8hFUYn1fAEH0bnK8sz4Aac99fIc4Eq14zhV40yiOiNVA/formResponse';
            // куда слать, это атрибут action у гугл формы
            $data = array();
            // массив для отправки в гугл форм
            $data['entry.1861509295'] = getNextNumber();
            $data['entry.680486686'] = $user_name;
            $data['entry.511847549'] = $user_tel;
            $data = http_build_query($data);
            $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => $data));
            $context = stream_context_create($options);
            // создаем контекст отправки
            $result = file_get_contents($url, false, $context);
            $output = json_encode(['type' => 'message', 'text' => 'Hi ' . $user_name . ' Thank you for your email']);
            exit($output);
        }
    } else {
        $output = json_encode(['type' => 'error', 'text' => 'You have already submitted the form with the data']);
        exit($output);
    }
} else {