Example #1
0
<?php

require_once 'init.php';
require_once cf\Config::path . 'mailer/class.phpmailer.php';
$page = cf\api\page\get('contacts');
$smarty->assign('pageId', $page['id']);
$smarty->assign('pageText', cf\api\page\getText($page['id']));
if (isset($_POST['name'])) {
    $mail = new PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->AddAddress("*****@*****.**");
    $mail->Subject = 'Сообщение с ortorise.ru';
    $name = stripslashes(trim($_POST['name']));
    $phone = trim($_POST['phone']);
    $email = trim($_POST['email']);
    $mail->Body = $name . ' (' . $email . ', ' . $phone . ") пишет: \n" . stripslashes(trim($_POST['msg']));
    if (@$mail->Send()) {
        header('Location: /contacts?state=ok');
    } else {
        header('Location: /contacts?state=error');
        // $mail->ErrorInfo
    }
}
$smarty->assign('state', isset($_REQUEST['state']) ? $_REQUEST['state'] : false);
show('contacts', $page['name'], array(), $page['title'], $page['keywords'], $page['descr']);
Example #2
0
<?php

require_once 'init.php';
$page = cf\api\page\get('main');
$smarty->assign('pageId', cf\api\page\getID('about'));
$smarty->assign('pageText', $smarty->fetch('index.tpl'));
$crumbs = array();
show('page', null, $crumbs, $page['title'], $page['keywords'], $page['descr']);
Example #3
0
<?php

require_once 'init.php';
require_once cf\Config::path . 'api/shop.php';
$page = cf\api\page\get('products');
$smarty->assign('pageId', $page['id']);
$smarty->assign('pageText', cf\api\page\getText($page['id']));
$categories = cf\api\shop\getCategoriesTree();
$smarty->assign('categories', $categories);
$products = array();
foreach ($categories as $cat) {
    $products[$cat['id']] = cf\api\shop\getProducts($cat['id']);
    foreach ($products[$cat['id']] as &$product) {
        $info = cf\api\shop\getProduct($product[0]);
        $product['attributes'] = $info['attributes'];
    }
}
$smarty->assign('products', $products);
$smarty->assign('reviews', cf\query2arrays("SELECT author, review FROM reviews ORDER BY sort_order LIMIT 4"));
show('products', $page['name'], array(), $page['title'], $page['keywords'], $page['descr']);
Example #4
0
File: buy.php Project: sd-studio/or
<?php

require_once 'init.php';
require_once cf\Config::path . 'cart.php';
$page = cf\api\page\get('buy');
$smarty->assign('pageId', $page['id']);
$smarty->assign('pageText', cf\api\page\getText($page['id']));
if (isset($_POST['name'])) {
    $name = stripslashes(trim($_POST['name']));
    $phone = trim($_POST['phone']);
    $email = trim($_POST['email']);
    $address = trim($_POST['address']);
    $comment = trim($_POST['comment']);
    $delivery = 'Курьером';
    switch ($_POST['delivery']) {
        case 'pickup':
            $delivery = 'Самовывоз';
            break;
        case 'post':
            $delivery = 'Почта России';
            break;
        case 'ems':
            $delivery = 'EMS Russian Post';
            break;
    }
    $payment = 'Наличными курьеру';
    switch ($_POST['payment']) {
        case 'bank':
            $payment = 'Квитанция через банк';
            break;
        case 'cod':
Example #5
0
File: map.php Project: sd-studio/or
<?php

require_once 'init.php';
require_once cf\Config::path . 'api/shop.php';
$page = cf\api\page\get('map');
if (!$page) {
    $page = cf\api\page\get('error');
}
$smarty->assign('pageText', cf\api\page\getText($page['id']));
$smarty->assign('pageId', $page['id']);
$smarty->assign('articles', cf\api\page\getTree('articles', false, 1, '/articles'));
$smarty->assign('categories', cf\api\shop\getCategoriesTree());
show('map', $page['name'], $crumbs, $page['title'], $page['keywords'], $page['descr']);
Example #6
0
<?php

require_once cf\Config::path . 'api/gallery.php';
$smarty->assign('hitsCategory', cf\api\page\get('hits'));
$hits = prepareProducts(cf\api\shop\getProducts('hits', array(), 0, 3));
$smarty->assign('hits', $hits);
$smarty->assign('newCategory', cf\api\page\get('new'));
$new = prepareProducts(cf\api\shop\getProducts('new', array(), 0, 3));
$smarty->assign('new', $new);
$smarty->assign('discountCategory', cf\api\page\get('discount'));
$discount = prepareProducts(cf\api\shop\getProducts('discount', array(), 0, 3));
$smarty->assign('discount', $discount);
$smarty->assign('products', array_merge($hits, $new, $discount));
$smarty->assign('banners', cf\api\gallery\getImages($page['id']));
$smarty->assign('blocks', cf\api\page\getHierarchy($page['id'], true, 1));
$smarty->assign('newslist', cf\query2arrays("\n\tSELECT IFNULL(code,cf_news.id) AS code,name,image,short_txt \n\tFROM cf_news \n\tINNER JOIN cf_news_in_category ON cf_news.id=cf_news_in_category.news_id\n\tWHERE cf_news_in_category.category_id = :pid\n\tORDER BY dt DESC\n", array('pid' => $page['id'])));
Example #7
0
<?php

require_once 'init.php';
$page = cf\api\page\get(cf\param::get('id'));
$smarty->assign('pageText', cf\api\page\getText($page['id']));
$smarty->assign('pageId', $page['id']);
$crumbs = array();
foreach ($page['branch'] as $p) {
    $crumbs[] = array('name' => $p['menu_name'], 'link' => $p['path']);
}
show('page', $page['name'], $crumbs, $page['title'], $page['keywords'], $page['descr']);
Example #8
0
<?php

try {
    require_once 'init.php';
    $page = cf\api\page\get(array_key_exists('id', $_REQUEST) ? $_REQUEST['id'] : 'home');
    if (!$page) {
        header("Location: /error");
        exit;
    }
    $crumbs = array();
    foreach ($page['branch'] as $p) {
        $crumbs[] = array('name' => $p['menu_name'], 'link' => $p['path']);
    }
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . $page['code'] . '.php')) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/' . $page['code'] . '.php';
    }
    $smarty->assign('page', $page);
    $smarty->assign('pageText', cf\api\page\getText($page['id']));
    $smarty->assign('crumbs', $crumbs);
    $tpl = 'page';
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/templates/' . $page['code'] . '.tpl')) {
        $tpl = $page['code'];
    }
    $smarty->display((strlen($page['template']) ? $page['template'] : $tpl) . '.tpl');
} catch (Exception $e) {
    header("Location: /error");
    exit;
}
Example #9
0
<?php

require_once 'init.php';
$page = cf\api\page\get('reviews');
$smarty->assign('pageId', $page['id']);
$smarty->assign('pageText', cf\api\page\getText($page['id']));
$smarty->assign('reviews', cf\query2arrays("SELECT author, review FROM reviews ORDER BY sort_order"));
show('reviews', $page['name'], array(), $page['title'], $page['keywords'], $page['descr']);