$maxWidthThumb = $maxWidthTeamCreativeThumb; $maxHeightThumb = $maxHeightTeamCreativeThumb; $db = db::getInstance(); $editorClass = new editorClass(); if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['name'])) { if (!($name = validClass::sanitiseString($_POST['name']))) { unset($name); } } if (isset($_POST['position'])) { if (!($position = validClass::sanitiseString($_POST['position']))) { unset($position); } } if (isset($_POST['weight'])) { if (!($weight = validClass::validNumber($_POST['weight']))) { unset($weight); } } if (isset($_POST['description'])) { if (!($description = $editorClass->replaceToInsert($_POST['description']))) { unset($description); } } if ($id > 0) { $imageClass = new imageClass();
$root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; // Подключение отправки формы echo '<script type="text/javascript" src="js/jquery.form.js"></script>'; if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['action'])) { if (!($action = validClass::sanitiseString($_POST['action']))) { unset($action); } } if (isset($_POST['type'])) { if (!($type = validClass::sanitiseString($_POST['type']))) { unset($type); } } // Инициализируем подключение $db = db::getInstance(); // Если пришла команда удалить файл $item = null; if ($action == 'edit' && $id > 0) { // Достаем $qwery = "SELECT * \n FROM backstage \n WHERE id='" . $id . "'"; $db->query($qwery); $item = $db->getRow(); } echo "<div id='edit'>"; echo "<fieldset>";
$root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; $name_dir = "team_partner"; $maxWidthBig = $maxWidthTeamPartnerBig; $maxHeightBig = $maxHeightTeamPartnerBig; $maxWidthThumb = $maxWidthTeamPartnerThumb; $maxHeightThumb = $maxHeightTeamPartnerThumb; $db = db::getInstance(); $editorClass = new editorClass(); if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['url'])) { if (!($url = validClass::sanitiseString($_POST['url']))) { unset($url); } } if (isset($_POST['weight'])) { if (!($weight = validClass::validNumber($_POST['weight']))) { unset($weight); } } if ($id > 0) { $imageClass = new imageClass(); // Обновляем $qwery = "UPDATE " . $name_dir . "\n SET url = '" . $url . "',\n weight = '" . $weight . "'\n WHERE id='" . $id . "'"; $db->query($qwery); echo "<p style='color:green;'>Данные успешно обновлены</p>"; if (($tempFile = $_FILES['url_image']['tmp_name']) != "") {
<?php $root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; $db = db::getInstance(); $editorClass = new editorClass(); if (isset($_POST['portfolio_cat'])) { if (!($portfolio_cat = validClass::validNumber($_POST['portfolio_cat']))) { unset($portfolio_cat); } } if (isset($_POST['client'])) { if (!($client = validClass::sanitiseString($_POST['client']))) { unset($client); } } if (isset($_POST['description'])) { if (!($description = $editorClass->replaceToInsert($_POST['description']))) { unset($description); } } $imageClass = new imageClass(); $qwery = "INSERT INTO portfolio \n (id_portfolio_cat, client, description,create_time) \n VALUES \n ('" . $portfolio_cat . "', '" . $client . "', '" . $description . "', '" . date('YmdHis') . "')"; $db->query($qwery); $id = $db->last(); echo "<p style='color:green;'>Данные успешно сохранены</p>"; if (($tempFile = $_FILES['url_image']['tmp_name']) != "") { $targetPath = $root . '/img/portfolio/'; if (!($image_info = $imageClass->getImageInfo($tempFile))) { echo "<p style='color:red;'>Обработка файла изображения невозможна</p>"; exit;
<?php // Подключаем конфигурацию и класс базы данных require_once "../lib/config.php"; require_once "../lib/class.invis.db.php"; require_once "classes/class.symbianm.valid.php"; if (isset($_POST['pass'])) { if (!($pass = validClass::sanitiseString($_POST['pass']))) { unset($pass); } } if (isset($_POST['login'])) { if (!($login = validClass::sanitiseString($_POST['login']))) { unset($login); } } //------------------------------------------------------- if (($redir = $_SERVER['HTTP_REFERER']) == "") { die("Error cod.:1 - Строка запроса пуста!"); exit; } //------------------------------------------------------- if (isset($login) && isset($pass)) { //$pass=md5(md5(md5($pass))); // Инициализируем подключение $db = db::getInstance(); $db->query("SELECT login, pass \n FROM admin \n WHERE login='******'"); if ($db->getCount() > 0) { $myrow = $db->getRow(); // Проверка пароля if ($pass != $myrow['pass']) {
if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['action'])) { if (!($action = validClass::sanitiseString($_POST['action']))) { unset($action); } } if (isset($_POST['type'])) { if (!($type = validClass::sanitiseString($_POST['type']))) { unset($type); } } if (isset($_POST['ids'])) { if (!($ids = validClass::sanitiseString($_POST['ids']))) { unset($ids); } } // Инициализируем подключение $db = db::getInstance(); // Если пришла команда удалить файл if ($action == 'del' && $id > 0) { $targetPath = $root . '/img/news/'; switch ($type) { case "img": $qwery = "SELECT photo \n FROM news\n WHERE id='" . $id . "'"; // Удаляем фото $db->query($qwery); $photo = $db->getValue(); $src_old = $targetPath . $photo;
<?php $root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; $db = db::getInstance(); $editorClass = new editorClass(); if (isset($_POST['date_create'])) { if (!($date_create = validClass::sanitiseString($_POST['date_create']))) { unset($date_create); } } $date_create = date("Y-m-d", strtotime($date_create)); if (isset($_POST['description_rus'])) { if (!($description_rus = $editorClass->replaceToInsert($_POST['description_rus']))) { unset($description_rus); } } $imageClass = new imageClass(); //проверка if (!empty($description_rus)) { $qwery = "INSERT INTO news \n (date_create, text_rus) \n VALUES \n ('" . $date_create . "', '" . $description_rus . "')"; $db->query($qwery); $id = $db->last(); // Достаем id картинок новости /*$qwery = "SELECT photo, dir FROM temp_images"; $db -> query($qwery);*/ echo "<p style='color:green;'>Данные успешно сохранены</p>"; if ($_FILES['images']['tmp_name'][0] != "") { // достаем в массив полученные данные
<?php $root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['action'])) { if (!($action = validClass::sanitiseString($_POST['action']))) { unset($action); } } $db = db::getInstance(); // Удаляем запись if ($action == "del" && $id > 0) { // Достаем id картинок новости $qwery = "SELECT photo \n FROM news \n WHERE id='" . $id . "'"; $db->query($qwery); $value = $db->getValue(); $uploaddir = $root . '/img/news/'; @unlink($uploaddir . $value); @unlink($uploaddir . "thumb_" . $value); $qwery = "DELETE FROM news \n WHERE id='" . $id . "'"; $db->query($qwery); // Удаляем фото из галлереи $qwery = "SELECT photo \n FROM news_galery\n WHERE id_news='" . $id . "'"; $db->query($qwery); if ($db->getCount() > 0) { // достаем в массив полученные данные
$root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; $name_dir = "team_model"; $maxWidthBig = $maxWidthTeamModelBig; $maxHeightBig = $maxHeightTeamModelBig; $maxWidthThumb = $maxWidthTeamModelThumb; $maxHeightThumb = $maxHeightTeamModelThumb; $db = db::getInstance(); $editorClass = new editorClass(); if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['name'])) { if (!($name = validClass::sanitiseString($_POST['name']))) { unset($name); } } if (isset($_POST['weight'])) { if (!($weight = validClass::validNumber($_POST['weight']))) { unset($weight); } } if (isset($_POST['description'])) { if (!($description = $editorClass->replaceToInsert($_POST['description']))) { unset($description); } } if ($id > 0) { $imageClass = new imageClass();
$root = $_SERVER['DOCUMENT_ROOT']; require_once $root . "/admin/blocks/include.php"; $db = db::getInstance(); if (isset($_POST['id'])) { if (!($id = validClass::validNumber($_POST['id']))) { unset($id); } } if (isset($_POST['date_create'])) { if (!($date_create = validClass::sanitiseString($_POST['date_create']))) { unset($date_create); } } $date_create = date("Y-m-d", strtotime($date_create)); if (isset($_POST['description_rus'])) { if (!($description_rus = validClass::sanitiseString($_POST['description_rus']))) { unset($description_rus); } } if ($id > 0) { if (!empty($description_rus)) { $imageClass = new imageClass(); // Обновляем $qwery = "UPDATE news\n SET date_create = '" . $date_create . "',\n text_rus = '" . $description_rus . "'\n WHERE id='" . $id . "'"; $db->query($qwery); // Достаем id картинок новости echo "<p style='color:green;'>Данные успешно сохранены</p>"; if ($_FILES['images']['tmp_name'][0] != "") { // достаем в массив полученные данные //$arrItems = $db -> getArray(); $arrItems = $_FILES['images']['tmp_name'];