} 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"]); if ($src != false) { $array += array("src" => $src); } } if ($_POST["go"] == "save") { $array += array("nn" => DB::selectAI($table)); DB::insert(DB::insertSql($table, $array), $array); } else { $id = $_POST["go"]; DB::update(DB::updateSql($table, $array), $array, $id);
<?php include "controller/function.php"; $table = "catalog"; $title = "Каталог продукции"; $records = false; if (isset($_POST["go"])) { if ($_POST["name_en"]) { $url = Rename::replace($_POST["name_en"]); } else { $url = Rename::replace($_POST["name_ru"]); } $save = array("parent" => $_POST["section"], "name_ru" => $_POST["name_ru"], "name_en" => $url, "title" => $_POST['title'], "desc" => $_POST['desc'], "keywords" => $_POST['keywords']); if ($_POST["go"] == "save") { $save += array("nn" => DB::selectAI($table)); DB::insert(DB::insertSql($table, $save), $save); header("Location: " . $_SERVER['REQUEST_URI']); } else { DB::update(DB::updateSql($table, $save), $save, $_POST['go']); header("Location: " . $_SERVER['REQUEST_URI']); } } if (isset($_GET["delete"])) { DB::del($_GET["title"], $_GET["delete"]); if (isset($_GET["act"]) and $_GET["act"]) { header("Location: production.php?id=" . $_GET["act"] . "&table=catalog"); } else { header("Location: production.php"); } } if (isset($_GET["id"])) {
<? include "controller/function.php"; $table = "catalog"; $title = "Каталог продукции"; $records = false; if (isset($_POST["go"])) { if ($_POST["name_en"]) { $url = Rename::replace($_POST["name_en"]); } else { $url = Rename::replace($_POST["name_ru"]); } $save = array( "parent"=>$_POST["section"], "name_ru"=>$_POST["name_ru"], "name_en"=>$url, "title"=>$_POST['title'], "desc"=>$_POST['desc'], "keywords"=>$_POST['keywords'] ); if ($_POST["go"] == "save") { $save += array("nn"=>DB::selectAI($table)); DB::insert(DB::insertSql($table,$save),$save); header("Location: ".$_SERVER['REQUEST_URI']); } else { DB::update(DB::updateSql($table,$save),$save,$_POST['go']); header("Location: ".$_SERVER['REQUEST_URI']); } } if (isset($_GET["delete"])) { DB::del($_GET["title"],$_GET["delete"]); if (isset($_GET["act"]) and $_GET["act"]) { header("Location: production.php?id=".$_GET["act"]."&table=catalog"); } else { header("Location: production.php");