예제 #1
0
 $mass_result_for_parsing = array('' . $_number_order, system::show_tpl(array('user' => $_user), '/frontend/mycabinet/user_mail.php'), ADRESS_SITE, system::show_tpl(array('result' => mycabinet::get_Order($_number_order)), '/frontend/mycabinet/list_mail.php'), 'http://' . ADRESS_SITE . '/backend/orders/new/id/' . $_number_order);
 // парсим данные
 $message = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, nl2br($_arr['text']));
 // парсим заголовок письма
 $subject = replace_data($_arr['zag'], '%site%', ADRESS_SITE);
 $subject = replace_data($subject, '%number_order%', '' . $_number_order);
 // отправляем мыло
 sent_email_new($GLOBALS["mailadmin"], $message, "", $subject, $_user->email);
 //---------------------------------------------------------//
 //---------------------------------------------------------//
 //---------------------------------------------------------//
 //---------------------------------------------------------//
 //---------- Отправляем мыло useru ------------------------//
 //---------------------------------------------------------//
 // парсим тело письма
 $_arr = ___findarray('select * from message where id=5');
 // елементы для замены
 $mass_element_for_parsing = array('%number_order%', '%site%', '%order%', '%name%');
 // заменяеміе значения
 $mass_result_for_parsing = array('' . $_number_order, ADRESS_SITE, system::show_tpl(array('result' => mycabinet::get_Order($_number_order)), '/frontend/mycabinet/list_mail.php'), $_user->name);
 // парсим данные
 $message = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, nl2br($_arr['text']));
 // парсим заголовок письма
 $subject = replace_data($_arr['zag'], '%site%', ADRESS_SITE);
 $subject = replace_data($subject, '%number_order%', '' . $_number_order);
 // отправляем мыло
 sent_email_new($_user->email, $message, "", $subject, $GLOBALS["mailadmin"]);
 //---------------------------------------------------------//
 //---------------------------------------------------------//
 //---------------------------------------------------------//
 // очищаем корзину
예제 #2
0
function get_h1()
{
    global $zag_radel;
    global $dbname;
    // ищем в table ACTION сам action и если он есть то выхватываем имя раздела
    //$_res=findpole_universal_full($_GET['action'],"content","action",1,"return");
    $_res = ___findpole('select content.h1_' . $_GET['lang'] . ' from content where action="' . $_GET['action'] . '"', 'h1_' . $_GET['lang']);
    //echo "----_res-----".$_res."<br>";
    if (!$_res) {
        if (isset($_GET['grupa']) and intval($_GET['grupa']) > 0) {
            // строим запрос
            $_sql = 'SELECT * FROM catalog_tree where id=' . $_GET['grupa'];
            // выполняем запрос + при необходимости выводим сам запрос
            $result = mysql::query_one($_sql, 0);
            if ($result) {
                $_res = $result->h1;
            } else {
                $_res = 'Такого товара нет!';
            }
            //echo "----_res-----".$_res."<br>";
        } else {
            if (isset($_GET['goods']) and $_GET['action'] == "catalog" and intval($_GET['goods']) > 0) {
                // строим запрос
                $_sql = 'SELECT * FROM catalog where id=' . intval($_GET['goods']) . ' and status=1';
                // выполняем запрос + при необходимости выводим сам запрос
                $result = mysql::query_one($_sql, 0);
                if ($result) {
                    $_res = $result->name;
                } else {
                    $_res = 'Такого товара нет!';
                }
            } else {
                if (isset($_GET['action'])) {
                    if ($_GET['action'] == 'news') {
                        if (!isset($_GET['url'])) {
                            if (TYPE_NEWS == 0 or !isset($_GET['type'])) {
                                // нашли поля
                                $_arr = ___findarray('select h1, title from ceo where id=1');
                            } else {
                                // нашли поля
                                switch ($_GET['type']) {
                                    case 1:
                                        $_idd = 6;
                                        break;
                                    case 2:
                                        $_idd = 7;
                                        break;
                                    default:
                                        $_idd = 1;
                                        break;
                                }
                                // нашли поля
                                $_arr = ___findarray('select h1, title from ceo where id=' . $_idd);
                            }
                            if ($_arr['h1'] != '') {
                                $_res = $_arr['h1'];
                            } else {
                                $_res = $_arr['title'];
                            }
                        } else {
                            $_res = ___findpole('select zag from news where url="' . $_GET['url'] . '"', 'zag');
                        }
                    } else {
                        if ($_GET['action'] == 'gallery') {
                            if (!isset($_GET['url'])) {
                                $_arr = ___findarray('select h1, title from ceo where id=2');
                                if ($_arr['h1'] != '') {
                                    $_res = $_arr['h1'];
                                } else {
                                    $_res = $_arr['title'];
                                }
                                if (isset($_GET['id'])) {
                                    $_res .= ', ' . ___findpole('select pole from gallery_grupa where id=' . $_GET['id'], 'pole');
                                }
                            } else {
                                $_res = ___findpole('select pole from gallery_grupa where url="' . $_GET['url'] . '"', 'pole');
                            }
                        } else {
                            if ($_GET['action'] == 'search') {
                                $_arr = ___findarray('select h1, title from ceo where id=13');
                                if ($_arr['h1'] != '') {
                                    $_res = $_arr['h1'];
                                } else {
                                    $_res = $_arr['title'];
                                }
                            } else {
                                if ($_GET['action'] == 'voting') {
                                    $_arr = ___findarray('select h1, title from ceo where id=12');
                                    if ($_arr['h1'] != '') {
                                        $_res = $_arr['h1'];
                                        if (isset($_GET['arhiv'])) {
                                            $_res = 'Архив голосований';
                                        }
                                    } else {
                                        $_res = $_arr['title'];
                                    }
                                } else {
                                    if ($_GET['action'] == 'catalog') {
                                        $_arr = ___findarray('select h1, title from ceo where id=3');
                                        if ($_arr['h1'] != '') {
                                            $_res = $_arr['h1'];
                                        } else {
                                            $_res = $_arr['title'];
                                        }
                                    } else {
                                        if ($_GET['action'] == 'brand') {
                                            $_arr = ___findarray('select h1, title from ceo where id=9');
                                            if ($_arr['h1'] != '') {
                                                $_res = $_arr['h1'];
                                            } else {
                                                $_res = $_arr['title'];
                                            }
                                        } else {
                                            if ($_GET['action'] == 'basket') {
                                                $_arr = ___findarray('select h1, title from ceo where id=10');
                                                if ($_arr['h1'] != '') {
                                                    $_res = $_arr['h1'];
                                                } else {
                                                    $_res = $_arr['title'];
                                                }
                                            } else {
                                                if ($_GET['action'] == 'mycabinet') {
                                                    $_arr = ___findarray('select h1, title from ceo where id=11');
                                                    if ($_arr['h1'] != '') {
                                                        $_res = $_arr['h1'];
                                                    } else {
                                                        $_res = $_arr['title'];
                                                    }
                                                } else {
                                                    if ($_GET['action'] == 'filter') {
                                                        // имя текущего раздела
                                                        $_res = filter::get_name_curent_filter();
                                                    } else {
                                                        if ($_GET['action'] == 'registration') {
                                                            $_arr = ___findarray('select h1, title from ceo where id=8');
                                                            if ($_arr['h1'] != '') {
                                                                $_res = $_arr['h1'];
                                                            } else {
                                                                $_res = $_arr['title'];
                                                            }
                                                        } else {
                                                            /*
                                                             * костыль для 3 новостей
                                                             */
                                                            if (isset($_GET['type']) and $_GET['type'] == 1) {
                                                                $_res = $zag_radel['news1'];
                                                            } else {
                                                                if (isset($_GET['type']) and $_GET['type'] == 2) {
                                                                    $_res = $zag_radel['news2'];
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    $_res = $zag_radel['main'];
                }
            }
        }
    }
    return $_res;
}
예제 #3
0
 /**
  *  получаем метатеги для текущего контроллера
  *	@param  int parent_id
  */
 static function get_title()
 {
     return ___findarray('select title,description,keywords, h1 from ceo where action="' . mysql_escape_string($_GET['action']) . '"');
 }
예제 #4
0
 if ($_POST) {
     if (!registration::is_Autorize() and !captcha::check_captcha()) {
         //выводим сообщение
         Message::GetMessage(0, v::getI18n('message_error_captcha'));
         echo "<meta http-equiv='refresh' content='2;URL=/catalog/goods/" . $_POST['id'] . "'>";
     } else {
         //---------------------------------------------------------//
         //---------- Отправляем мыло админу------------------------//
         //---------------------------------------------------------//
         // парсим тело письма
         $_arr = ___findarray('select * from message where id=7');
         // елементы для замены
         $mass_element_for_parsing = array('%fio%', '%email%', '%q%', '%id%', '%link%', '%name_good%');
         // заменяеміе значения
         // имя товара
         $_arr1 = ___findarray('select * from catalog where id=' . intval($_POST['id']));
         // если неавторизован
         if (!registration::is_Autorize()) {
             $mass_result_for_parsing = array($_POST['FORM']['fio'], $_POST['FORM']['email'], $_POST['FORM']['q'], $_POST['id'], MAIN_PATH . '/catalog/goods/' . $_POST['id'], $_arr1['name']);
             $_email = $_POST['FORM']['email'];
         } else {
             $_user = registration::get_User($_SESSION['log']);
             $mass_result_for_parsing = array($_user->name, $_user->email, $_POST['FORM']['q'], $_POST['id'], MAIN_PATH . '/catalog/goods/' . $_POST['id'], $_arr1['name']);
             $_email = $_user->email;
         }
         // парсим данные
         $message = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, $_arr['text']);
         // парсим заголовок письма
         $subject = replace_data($_arr['zag'], '%site%', ADRESS_SITE);
         // отправляем мыло
         sent_email_new($GLOBALS["mailadmin"], nl2br($message), "", $subject, $_email);