Beispiel #1
0
<?php

include "models/function.php";
IncludeClass::inc(array("Product"));
if (isset($_POST["go"])) {
    $nn = DB::selectAI("price");
    $attr = AttrValue::conbine($_POST["attr"], $_POST["val"]);
    if (isset($_POST["related"]) and $_POST["related"]) {
        $related = array_slice($_POST["related"], 0, 3);
        $data_related = serialize($related);
    } else {
        $data_related = "";
    }
    $arrText = array("section" => $_POST['section'], "collection" => $_POST['collection'], "exclusive" => $_POST['exclusive'], "name" => $_POST['name'], "nomer" => $_POST['nomer'], "code" => $_POST['code'], "size" => $_POST['size'], "material" => $_POST['material'], "proba" => $_POST['proba'], "vstavki" => $_POST['vstavki'], "weight" => $_POST['weight'], "price" => $_POST['price'], "price_old" => $_POST['price_old'], "attr" => $attr, "related" => $data_related, "title" => $_POST['title'], "description" => $_POST['description'], "keywords" => $_POST['keywords']);
    if ($_POST["go"] == "save") {
        $arrText += array('nn' => $nn, 'sk40' => 0, 'sk50' => 0);
        if (isset($arrText['related']) && !empty($arrText['related'])) {
            //$next_sql = " AND NOT id=";
            $proverka = DB::selectParam('price', 'nomer', $arrText['nomer'], false, false, false, false);
            $arr_prov = array("related" => $arrText['related']);
            if ($proverka != false && empty($proverka['related'])) {
                foreach ($proverka as $prov) {
                    DB::update(DB::updateSql("price", $arr_prov), $arr_prov, $prov['id']);
                }
            }
        }
        $lastId = DB::insert(DB::insertSql("price", $arrText), $arrText);
    } else {
        $lastId = $_POST["go"];
        if (isset($arrText['related']) && !empty($arrText['related'])) {
            $next_sql = " AND NOT id=" . $lastId;
Beispiel #2
0
include "models/function.php";
$param = "provider";
if (isset($_POST["go"])) {
    if ($_POST["go"] == "save") {
        array_pop($_POST);
        DB::insert(DB::insertSql($param, $_POST), $_POST);
        header("Location: pricelist.php");
    } else {
        $id = array_pop($_POST);
        DB::update(DB::updateSql($param, $_POST), $_POST, $id);
        header("Location: pricelist.php");
    }
}
if (isset($_POST["update"])) {
    IncludeClass::inc(array('Price'));
    Price::importPrice($_FILES, $_POST["update"]);
    header("Location: pricelist.php");
}
if (isset($_GET["delete"])) {
    Delete::del($_GET["title"], $_GET["delete"]);
    header("Location: pricelist.php");
}
$records = DB::select($param);
require_once 'view/tpl_top.php';
?>
<div class="app app-header-fixed">
    <?php 
include "view/tpl_popup_provider.php";
include "view/header.php";
$active_h = "class=\"active\"";
Beispiel #3
0
<?php

include "models/function.php";
IncludeClass::inc(array("Catalog"));
$param = "catalog";
$record = false;
if (isset($_GET['top'])) {
    $id_prod = $_GET['top'];
    $sql = "UPDATE price SET nn = 0 WHERE id = {$id_prod}";
    DB::updatePM($sql);
}
if (isset($_GET['down'])) {
    $id = $_GET['id'];
    $sql_count = "SELECT count(nn)as amount FROM price WHERE section={$id}";
    $count = DB::selectSql($sql_count);
    $id_prod = $_GET['down'];
    $sql = "UPDATE price SET nn =" . $count[0]['amount'] . " WHERE id = {$id_prod}";
    DB::updatePM($sql);
}
if (isset($_POST["go"])) {
    $table = $_POST["table"];
    if ($table == "catalog") {
        if (!$_POST["name_en"]) {
            $_POST["name_en"] = Rename::replace($_POST["name_ru"]);
        } else {
            $_POST["name_en"] = Rename::replace($_POST["name_en"]);
        }
        $array = array("name_ru" => $_POST['name_ru'], "name_en" => $_POST['name_en'], "parent" => $_POST['parent'], "title" => $_POST['title'], "desc" => $_POST['desc'], "keywords" => $_POST['keywords']);
    } else {
        $array = array("name_ru" => $_POST['name_ru'], "title" => $_POST['title'], "text" => $_POST['text'], "parent" => 0);
        $src = DB::filesUpload($_FILES['photo'], $_POST["table"]);
Beispiel #4
0
<?php

include "models/function.php";
IncludeClass::inc(array("Pages"));
$param = "section";
$record = false;
if (isset($_POST["go"])) {
    $obj = new Pages();
    if (!$_POST["url"]) {
        $url = replaceStr(translitIt($_POST["name"]));
    } else {
        $url = $_POST["url"];
    }
    if ($_POST["go"] == "save") {
        $obj->insertSection($obj->insertSectionSql(), $_POST["section"], $url, trimStr($_POST["name"]));
        header("Location: " . $_SERVER['REQUEST_URI']);
    } else {
        $obj->updateSection($obj->updateSectionSql(), $_POST["section"], $url, trimStr($_POST["name"]), $_POST['go']);
        header("Location: " . $_SERVER['REQUEST_URI']);
    }
}
if (isset($_POST["pages"])) {
    if ($_POST["pages"] == "insert") {
        array_pop($_POST);
        DB::insert(DB::insertSql("pages", $_POST), $_POST);
        header("Location: " . $_SERVER['REQUEST_URI']);
    } else {
        array_pop($_POST);
        $id = array_pop($_POST);
        DB::update(DB::updateSql("pages", $_POST), $_POST, $id);
        header("Location: " . $_SERVER['REQUEST_URI']);