Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
action.php
Содержимое
<?php define("MODULE_ID", 3); $base_url = '../'; require_once( $base_url . '../func.php' ); $conn = db_connect(); require_once( $base_url . 'lib/php/JsHttpRequest.php' ); $JsHttpRequest =& new JsHttpRequest("windows-1251"); switch ( $_REQUEST['action']) { case 'ChSection': if ( $acl['e'] != 1 ) { $GLOBALS['_RESULT'] = array( "result" => 'error', "type" => 'edit' ); exit(0); } foreach ( $_REQUEST['items'] as $item ) { $item = intval( $item ); $result = sql("update public set id_razdel='{$_REQUEST['section']}' WHERE id='{$item}'"); } break; case 'ChStatus': if ( $acl['e'] != 1 ) { $GLOBALS['_RESULT'] = array( "result" => 'error', "type" => 'edit' ); exit(0); } foreach ( $_REQUEST['items'] as $item ) { $item = intval( $item ); $result = sql("update public set status='{$_REQUEST['status']}' WHERE id='{$item}'"); } break; case 'Delete': if ( $acl['d'] != 1 ) { $GLOBALS['_RESULT'] = array( "result" => 'error', "type" => 'delete' ); exit(0); } foreach ( $_REQUEST['items'] as $item ) { $item = intval( $item ); $rs_image = sqlval("select img_index from public where id='{$item}'"); if (!$rs_image) { error(); } if ( $rs_image['img_index'] != '' && file_exists( $base_url . '../' . $rs_image['img_index'] ) ) { unlink( $base_url . '../' . $rs_image['img_index'] ); } $result = sql("delete from public where id='{$item}'"); if (!$result) { error(); } } break; case 'DeleteOne': if ( $acl['d'] != 1 ) { $GLOBALS['_RESULT'] = array( "result" => 'error', "type" => 'delete' ); exit(0); } $_REQUEST['item'] = intval( $_REQUEST['item'] ); $rs_image = sqlval("select img_index from public where id='{$_REQUEST['item']}'"); if (!$rs_image) { error(); } if ( $rs_image['img_index'] != '' && file_exists( $base_url . '../' . $rs_image['img_index'] ) ) { unlink( $base_url . '../' . $rs_image['img_index'] ); } $result = sql("delete from public where id='{$_REQUEST['item']}'"); if (!$result) { error(); } break; case 'add': if ( $acl['a'] != 1 && $_REQUEST['action'] == 'add' ) { exit(0); } if (ini_get('magic_quotes_gpc') == 1) { $_POST['news_header'] = stripslashes($_POST['news_header']); $_POST['news_short'] = stripslashes($_POST['news_short']); $_POST['news_full'] = stripslashes($_POST['news_full']); } $_POST['news_header'] = mysql_real_escape_string($_POST['news_header']); $_POST['news_short'] = mysql_real_escape_string($_POST['news_short']); $_POST['news_full'] = mysql_real_escape_string($_POST['news_full']); isset( $_POST['archiv'] ) ? $_POST['archiv'] = 1 : $_POST['archiv'] = 0; $_POST['id_razdel'] = intval( $_POST['id_razdel'] ); //upload image if ($_FILES['img_foto']['tmp_name'] != '' ) { if (is_uploaded_file($_FILES['img_foto']['tmp_name'])) { $img_index=upload_foto($_FILES['img_foto']['tmp_name'],220,220,0,1,$base_url."../image/public"); $img_index="image/public/".$img_index; } } $result = sql("insert into public set data='{$_POST['data']}', news_header='{$_POST['news_header']}', news_short='{$_POST['news_short']}', news_full='{$_POST['news_full']}', archiv='{$_POST['archiv']}', status='{$_POST['status']}', id_razdel='{$_POST['id_razdel']}', img_index='{$img_index}' "); if (!$result) { error(); } $id_news=mysql_insert_id( ); public_indexator($ipublicws, $conn ); header('location: public.php?id_razdel=' . $_POST['id_razdel']); break; case 'edit': if ( $acl['e'] != 1 && $_REQUEST['action'] == 'edit' ) { exit(0); } if (ini_get('magic_quotes_gpc') == 1) { $_POST['news_header'] = stripslashes($_POST['news_header']); $_POST['news_short'] = stripslashes($_POST['news_short']); $_POST['news_full'] = stripslashes($_POST['news_full']); } $_POST['id'] = intval( $_POST['id'] ); $_POST['news_header'] = mysql_real_escape_string($_POST['news_header']); $_POST['news_short'] = mysql_real_escape_string($_POST['news_short']); $_POST['news_full'] = mysql_real_escape_string($_POST['news_full']); isset( $_POST['archiv'] ) ? $_POST['archiv'] = 1 : $_POST['archiv'] = 0; $_POST['id_razdel'] = intval( $_POST['id_razdel'] ); //upload image if ($_FILES['img_foto']['tmp_name'] != '' ) { if (is_uploaded_file($_FILES['img_foto']['tmp_name'])) { //delete old image if exists $r_img_old=sqlval("select img_index from public where id='".$_POST['id']."'"); if ($r_img_old['img_index'] != '' && file_exists($base_url."../".$r_img_old['img_index'])) { unlink($base_url . "../" . $r_img_old['img_index']); } $img_index=upload_foto($_FILES['img_foto']['tmp_name'],220,220,0,1,$base_url."../image/public"); $img_index="image/public/".$img_index; $sql_img = ",img_index='{$img_index}'"; } } else { $sql_img = ''; } $result=sql("update public set data='{$_POST['data']}', news_header='{$_POST['news_header']}', news_short='{$_POST['news_short']}', news_full='{$_POST['news_full']}', archiv='{$_POST['archiv']}', status='{$_POST['status']}', id_razdel='{$_POST['id_razdel']}' {$sql_img} where id='{$_POST['id']}'"); if (!$result) { error(); } public_indexator($_POST['id'], $conn); header('location: public.php?id_razdel=' . $_POST['id_razdel']); break; case 'GetPhoto' : $_REQUEST ['id_photo'] = intval ( $_REQUEST ['id_photo'] ); $row = sqlval ( "select * from public_foto where id='{$_REQUEST['id_photo']}'" ); $GLOBALS ['_RESULT'] = array ("id_photo" => $row ['id'], "id_object" => $row ['id_news'], "photo" => $row ['img_index'], "photo" => str_replace ( ".", "_sm.", $row ['img_index'] ), "photo_name" => $row ['name'] ); break; case 'AddPhoto' : if ($_FILES ['photo'] ['tmp_name'] != '') { if (is_uploaded_file ( $_FILES ['photo'] ['tmp_name'] )) { $img_index = upload_foto_css ( $_FILES ['photo'] ['tmp_name'], 135, 800, 1, 1, $base_url . "../user_foto/public/", 90 ); $img_index = "user_foto/public/" . $name_foto_sm; } } $_REQUEST ['id_object'] = intval ( $_REQUEST ['id_object'] ); $_REQUEST ['name_photo'] = mysql_real_escape_string ( $_REQUEST ['name_photo'] ); $result = sql ( "insert into public_foto set name='{$_REQUEST['name_photo']}', id_public='{$_REQUEST['id_object']}', img_index='{$img_index}' " ); if (! $result) { error (); } else { $id_new=mysql_insert_id($l); $r_posit=sql("update public_foto set position = '{$id_new}' where id = '{$id_new}'"); } $last_id = mysql_insert_id (); $GLOBALS ['_RESULT'] = array ("last_id" => $last_id, "id_object" => $_REQUEST ['id_object'], "photo" => $img_index, "photo_name" => $_REQUEST ['name_photo'] ); break; case 'DeletePhoto' : $_REQUEST ['id_object'] = intval ( $_REQUEST ['id_object'] ); $_REQUEST ['id_photo'] = intval ( $_REQUEST ['id_photo'] ); $rs_image = sqlval ( "select img_index from public_foto where id='{$_REQUEST['id_photo']}' and id_public='{$_REQUEST['id_object']}'" ); if (! $rs_image) { error (); } if ($rs_image ['img_index'] != '' && file_exists ( $base_url . '../' . $rs_image ['img_index'] )) { unlink ( $base_url . '../' . $rs_image ['img_index'] ); $image_small = str_replace ( '.', '_sm.', $rs_image ['img_index'] ); if ($image_small != '' && file_exists ( $base_url . "../" . $image_small )) { unlink ( $base_url . "../" . $image_small ); } } $result = sql ( "delete from public_foto where id='{$_REQUEST['id_photo']}' and id_public='{$_REQUEST['id_object']}' limit 1" ); if (! $result) { error (); } break; case 'ChangePhoto' : $_REQUEST ['id_object'] = intval ( $_REQUEST ['id_object'] ); $_REQUEST ['id_photo'] = intval ( $_REQUEST ['id_photo'] ); $_REQUEST ['name_photo'] = mysql_real_escape_string ( $_REQUEST ['name_photo'] ); $result = sql ( "update public_foto set name='{$_REQUEST['name_photo']}' where id='{$_REQUEST['id_photo']}' " ); if (! $result) { error (); } $last_id = mysql_insert_id (); $GLOBALS ['_RESULT'] = array ("id_photo" => $_REQUEST ['id_photo'], "id_object" => $_REQUEST ['id_object'], "photo_name" => $_REQUEST ['name_photo'] ); break; case 'ChPosition': $_REQUEST['id'] = intval( $_REQUEST['id'] ); $_REQUEST['id2'] = intval( $_REQUEST['id2'] ); if ($_REQUEST['id'] != '' && $_REQUEST['id2'] != '') { $position = sqlval("select position from public_foto where id='{$_REQUEST['id']}'"); $position2 = sqlval("select position from public_foto where id='{$_REQUEST['id2']}'"); if ($position['position'] != '' && $position2['position']!='') { sql("update public_foto set position='{$position2['position']}' where id='{$_REQUEST['id']}'"); sql("update public_foto set position='{$position['position']}' where id='{$_REQUEST['id2']}'"); } } break; }
/admin/public/
Имя
Дата
Размер
..
2026-10-02
action.php
2013-03-22
9 кб.
public.php
2015-09-29
5 кб.
public_modif.php
2024-01-29
22 кб.
public_modif.php~
2024-01-25
21 кб.
public_sql.php
2024-01-29
5 кб.
public_sql.php~
2024-01-25
5 кб.
razdel.php
2008-01-27
7 кб.
/admin/public
Загрузить файлы
Файл 1
Файл 2
Файл 3