Ejemplo n.º 1
0
function getcat_action($cat)
{
    $superquery = new superquery();
    if ($cat == "cart") {
        $category = array("parrent_id" => 2, "template" => "cart", "title" => "корзина");
    } else {
        $category_arr = $superquery->db("SELECT * FROM smrt_ctg WHERE link = '" . $cat . "'") or die(mysql_error());
        $category = mysql_fetch_array($category_arr);
    }
    return $category;
}
Ejemplo n.º 2
0
 function types_list()
 {
     $superquery = new superquery();
     $arr_types = $superquery->db("SELECT * FROM smrt_types");
     $types = mysql_fetch_array($arr_types);
     if (mysql_num_rows($arr_types) > 0) {
         do {
             $types_list .= "<tr class='grey'><td>{$types['id']}</td><td>{$types['name_types']}</td><td>{$types['lang']}</td><td><a href='http://" . $_SERVER['HTTP_HOST'] . "/admin/?option=types&delete_types={$types['id']}' class='btn'>delete</a></td></tr>";
         } while ($types = mysql_fetch_array($arr_types));
     }
     return $types_list;
 }
Ejemplo n.º 3
0
 function addlang($addlang_code, $addlang_name)
 {
     $superquery = new superquery();
     $refresh = new refresh();
     $lang_add_types = $superquery->db("INSERT INTO `language` (code, name) VALUES ('{$addlang_code}','{$addlang_name}')");
     $refresh->redirect('options');
 }
Ejemplo n.º 4
0
function vendors_link()
{
    $superquery = new superquery();
    $arr_vendors = $superquery->db("SELECT * FROM smrt_vendors WHERE lang='" . $_GET['lang'] . "'");
    $vendors = mysql_fetch_array($arr_vendors);
    do {
        $vend_list .= "<li><a href=''>{$vendors['name_vendors']}</a></li>";
    } while ($vendors = mysql_fetch_array($arr_vendors));
    return $vend_list;
}
Ejemplo n.º 5
0
function language_list()
{
    $superquery = new superquery();
    $lang_arr_types = $superquery->db("SELECT * FROM `language`");
    $lang_types = mysql_fetch_assoc($lang_arr_types);
    do {
        $res .= "<li><a href='/{$lang_types['code']}/'>{$lang_types['name']}</a></li>";
    } while ($lang_types = mysql_fetch_assoc($lang_arr_types));
    return $res;
}
Ejemplo n.º 6
0
<?php

session_start();
if (isset($_POST['id'])) {
    include "config/config_db.php";
    include "config/class.php";
    $id = $_POST['id'];
    $superquery = new superquery();
    $products_arr = $superquery->db("SELECT * FROM smrt_shop WHERE id='{$id}'");
    $products = mysql_fetch_assoc($products_arr);
    if (!$_SESSION['products']) {
        $_SESSION['products'] = array();
    }
    $cnt = count($_SESSION['products']);
    if (!$_SESSION['item_count']) {
        $_SESSION['item_count'] = 0;
    }
    for ($i = 0; $i <= $cnt; $i++) {
        if ($_SESSION['products'][$i]['id'] == $id) {
            $match = 1;
        }
    }
    if ($match != 1) {
        $_SESSION['item_count'] = $_SESSION['item_count'] + 1;
        $_SESSION[$id]['id'] = $products['id'];
        $_SESSION[$id]['title'] = $products['title'];
        $_SESSION[$id]['images'] = $products['images'];
        $_SESSION[$id]['price'] = $products['price'];
        $_SESSION[$id]['count'] = 1;
        array_push($_SESSION['products'], $_SESSION[$id]);
    } else {