示例#1
0
 ob_start();
 require_once INC_DIR . 'PHPMailer/class.phpmailer.php';
 $mail = new PHPMailer();
 $mail->SetFrom("admin@" . SITE_NAME, "Сайт " . SITE_NAME . "");
 $mail->AddAddress($this->sets['ishop_mail'], $this->sets['ishop_mail']);
 $mail->Subject = 'Заказ на сайте №' . $last_id . '/' . date('y') . '';
 $mail->MsgHTML($tcont . $cont);
 $mail->Send();
 if (!empty($_POST['pemail'])) {
     $mail->ClearAddresses();
     $mail->AddAddress($_POST['pemail'], $_POST['pemail']);
     $mail->Send();
 }
 //СМС-центр ОТПРАВКА СМС
 if (class_exists('ExtraCMS')) {
     $classSMS = ExtraCMS::gi();
     if ($classSMS->getValue('bool_sms_enable')) {
         if ($classSMS->getValue('bool_sms_order')) {
             $classSMS->sendSMSProduct($SMSParamsArray);
         }
     }
 }
 ////////////////////////
 ob_end_clean();
 // $_SESSION['kvitanc'] = array(
 // 'fio' => $_POST['pfio'],
 // 'adr' => $_POST['padr'],
 // 'sum' => $summa,
 // 'order_id' => $last_id
 // );
 unset($_SESSION[CART]);
示例#2
0
if (strpos($_SERVER['REQUEST_URI'], 'templates') !== false || strpos($_SERVER['REQUEST_URI'], '/i.php') !== false) {
    header("HTTP/1.0 404 Not Found");
    include '404.html';
    exit;
}
session_start();
//TODO подключение файлов с настройкими бд, путей, редактируемых полей
require_once "includes/kanfih.php";
/* подключение бд */
require INC_DIR . 'dbconnect.php';
/* подключение разных полезных функций */
require_once INC_DIR . "functions.php";
if (file_exists('extraSystem.class.php') && file_exists(INC_DIR . 'smspilot.class.php')) {
    include_once 'extraSystem.class.php';
    include_once INC_DIR . 'smspilot.class.php';
    ExtraCMS::initIndexFile();
}
l('start');
$site = Site::gI();
Site::gI()->Check_Mysql();
$sets = $site->GetSettings();
include_once "includes/beznal_eboxes.php";
$ebox = $site->GetEditBoxes(array_keys($edit_boxes));
if (!isset($_SESSION['langv'])) {
    $_SESSION['langv'] = 'rus';
}
//TODO Переадресация с других доменов на $domen_name
// $domen_name = ((!empty($sets['redirect'])) ? 'www.' : '').SITE_NAME;
// if($_SERVER['HTTP_HOST'] != $domen_name)
// {
// header("HTTP/1.1 301 Moved Permanently");
示例#3
0
    function add_feedback($value, $email, $form_data = array(), $poh = 0, $order_call_form = 'feedback/feedback')
    {
        $frm = '';
        $value = explode('/', $value);
        if ($_GET['id'] == $value['1'] && $_GET['module'] == $value['0'] || $poh && (isset($_POST['order_call_form']) || $value[1] == 'all')) {
            if (isset($_POST['send']) && !isset($_POST['keystring']) || isset($_POST['send']) && isset($_POST['keystring']) && isset($_SESSION['captcha_keystring']) && $_POST['keystring'] == $_SESSION['captcha_keystring']) {
                // if(isset($_SESSION['mail_send']) && $_SESSION['mail_send'] == 1 && !$poh) {
                // $_SESSION['mail_send'] = 0;
                // header('Location: '.$_SERVER['HTTP_REFERER']);
                // exit;
                // }
                // $_SESSION['mail_send'] = 1;
                $ctm = "";
                $forma_d = array('Время' => date('d-m-Y H:i', time()), 'IP' => $_SERVER['REMOTE_ADDR'], 'Раздел' => $this->content['title']);
                foreach ($forma_d as $id => $val) {
                    $ctm .= "" . $id . ": " . $val . "<br><br>";
                }
                foreach ($form_data as $id => $val) {
                    if (isset($_POST['p' . $id])) {
                        if ($val['1'] == 'text') {
                            $ctm .= $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                        } elseif ($val['1'] == 'phone') {
                            $ctm .= $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                        } elseif ($val['1'] == 'email') {
                            $ctm .= $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                        } elseif ($val['1'] == 'data') {
                            $ctm .= $val['0'] . ": " . date('d-m-Y', strtotime($_POST['p' . $id])) . "<br>";
                        } elseif ($val['1'] == 'passport') {
                            $ctm .= $val['0'] . ": серия: " . $_POST['p' . $id . '_1'] . " номер: " . $_POST['p' . $id . '_2'] . " дата выдачи: " . $_POST['p' . $id . '_3'] . " кем выдан: " . $_POST['p' . $id . '_4'] . "<br>";
                        } elseif ($val['1'] == 'checkbox') {
                            $chk = !empty($_POST['p' . $id]) ? 'да' : 'нет';
                            $ctm .= $val['0'] . ": " . $chk . "<br>";
                        } elseif ($val['1'] == 'checkboxes') {
                            $ctm .= $val['0'] . ": ";
                            $i = 1;
                            foreach ($_POST['p' . $id] as $box_id => $box_val) {
                                $ctm .= $box_val;
                                if ($i != count($_POST['p' . $id])) {
                                    $ctm .= ', ';
                                }
                                $i++;
                            }
                            $ctm .= "<br>";
                        } elseif ($val['1'] == 'select') {
                            $ctm .= $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                        } elseif ($val['1'] == 'textarea') {
                            $ctm .= $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                        } elseif ($val['1'] == 'keystring') {
                        } else {
                            if ($val['1'] != 'file') {
                                $ctm .= "" . $val['0'] . ": " . $_POST['p' . $id] . "<br>";
                            }
                        }
                    }
                }
                $mail_content = ' 
				<html> 
					<body> 
						<p>Письмо с сайта ' . SITE_NAME . '.</p> 
						' . $ctm . '
					</body> 
				</html>';
                ob_start();
                require_once INC_DIR . 'PHPMailer/class.phpmailer.php';
                $mail = new PHPMailer();
                $mail->SetFrom('admin@' . SITE_NAME, 'Сайт ' . SITE_NAME);
                $mail->AddAddress($email, $email);
                $mail->Subject = $_SERVER['HTTP_HOST'] . " - " . 'письмо с сайта';
                $mail->MsgHTML($mail_content);
                if (isset($_FILES['p2'])) {
                    foreach ($_FILES['p2']['name'] as $fileid => $fileval) {
                        $mail->AddAttachment($_FILES['p2']['tmp_name'][$fileid], $fileval);
                    }
                }
                $mail->Send();
                unset($mail);
                unset($_POST['send']);
                /* Отправка СМС */
                if (class_exists('ExtraCMS')) {
                    $classSMS = ExtraCMS::gi();
                    if ($classSMS->getValue('bool_sms_enable')) {
                        if ($classSMS->getValue('bool_sms_telephone') && isset($_POST['order_call_form'])) {
                            $smstitle = 'Заказ звонка';
                            $FIO = trim($_POST['p0']);
                            $phone = isset($_POST['p1']) ? trim($_POST['p1']) : '';
                            $message = isset($_POST['p2']) ? trim($_POST['p2']) : '';
                            $classSMS->sendSMS("Заказ звонка. ФИО: " . $FIO . ". Тел: " . $phone . ". Сообщение: " . $message);
                            if ($FIO != '' && $phone != '') {
                                $classSMS->sendSMS("" . $smstitle . ". ФИО: " . $FIO . ". Тел: " . $phone . ". Сообщение: " . $message);
                            }
                        }
                        if ($classSMS->getValue('bool_sms_feedback') && !isset($_POST['order_call_form'])) {
                            $smstitle = 'Обратная связь';
                            $FIO = trim($_POST['pfio']);
                            $phone = isset($_POST['ptel']) ? trim($_POST['ptel']) : '';
                            $message = isset($_POST['p0']) ? trim($_POST['p0']) : '';
                            if ($FIO != '' && $phone != '') {
                                $classSMS->sendSMS("" . $smstitle . ". ФИО: " . $FIO . ". Тел: " . $phone . ". Сообщение: " . $message);
                            }
                        }
                    }
                }
                /* Отправка СМС - конец */
                ob_end_clean();
                $frm = '<div class="sent">Ваше письмо отправлено!</div>';
            } else {
                $dr = array();
                if (class_exists('Reg') && !empty($_SESSION['user'])) {
                    $usr = Reg::gI()->user;
                    @($inf = unserialize($usr['info']));
                    $dr = array('email' => @$usr['email'], 'fio' => @$inf['7'] . ' ' . $inf['8'] . ' ' . $inf['9'], 'tel' => @$inf['15'], 'adr' => @$inf['21']);
                }
                $frm .= $this->view($order_call_form, array('form_data' => $form_data, 'txt_data' => $dr));
            }
            return $frm;
        }
    }