Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
action.php
Содержимое
<?php define("MODULE_ID", 4); $base_url = '../'; require_once( $base_url . '../func.php' ); $conn = db_connect(); /*require($base_url."inc/authorize.inc.php"); if ( $_SESSION['admid'] == 0 ) { header("Location: {$base_url}login.php"); exit; } $r_groups = sql("select id_group from ug_link where id_user='{$_SESSION['admid']}'"); $acl = array('r' => 0, 'e' => 0, 'a' => 0, 'd' => 0 ); while ( $rs_groups = sqlget( $r_groups )) { $r_rights = sql("select rights from rights where id_module='" . MODULE_ID . "' and id_group='{$rs_groups['id_group']}'"); while ( $rs_rights = sqlget($r_rights)) { $rights = split("\|",$rs_rights['rights'] ); if ( $rights[0] == 'r' ) $acl['r'] = 1; if ( $rights[1] == 'e' ) $acl['e'] = 1; if ( $rights[2] == 'a' ) $acl['a'] = 1; if ( $rights[3] == 'd' ) $acl['d'] = 1; } }*/ 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 fotogal2 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 fotogal2 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 foto from fotogal2 where id='{$item}'"); if (!$rs_image) { error(); } if ( $rs_image['foto'] != '' ) { if ( file_exists( $base_url."../".$rs_image['foto'] ) ) { unlink($base_url."../".$rs_image['foto']); } if ( file_exists( $base_url."../".str_replace('.', '_sm.', $rs_image['foto'] ) ) ) { unlink($base_url."../".str_replace('.', '_sm.', $rs_image['foto'] )); } if ( file_exists( $base_url."../".str_replace('.', '_min.', $rs_image['foto'] ) ) ) { unlink($base_url."../".str_replace('.', '_min.', $rs_image['foto'] )); } if ( file_exists( $base_url."../".str_replace('.', '_orig.', $rs_image['foto'] ) ) ) { unlink($base_url."../".str_replace('.', '_orig.', $rs_image['foto'] )); } } $result = sql("delete from fotogal2 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 foto from fotogal2 where id='{$_REQUEST['item']}'"); if (!$rs_image) { error(); } if ( $rs_image['foto'] != '' ) { if ( file_exists( $base_url."../".$rs_image['foto'] ) ) { unlink($base_url."../".$rs_image['foto']); } if ( file_exists( $base_url."../".str_replace('.', '_sm.', $rs_image['foto'] ) ) ) { unlink($base_url."../".str_replace('.', '_sm.', $rs_image['foto'] )); } } $result = sql("delete from fotogal where id='{$_REQUEST['item']}'"); if (!$result) { error(); } break; case 'ChPosition': if ( $acl['e'] != 1 ) { $GLOBALS['_RESULT'] = array( "result" => 'error', "type" => 'edit' ); exit(0); } $_REQUEST['id'] = intval( $_REQUEST['id'] ); $_REQUEST['id2'] = intval( $_REQUEST['id2'] ); $position = sqlval("select position from fotogal where id='{$_REQUEST['id']}'"); $position2 = sqlval("select position from fotogal where id='{$_REQUEST['id2']}'"); $r_up = sql ( "UPDATE `fotogal` p1, `fotogal` p2 SET p1.position = '{$position['position']}', p2.position = '{$position2['position']}' WHERE p1.position = '{$position2['position']}' and p2.position = '{$position['position']}'" ); break; case 'ChPositionOnMouse': foreach ( $_REQUEST['data'] as $data ) { $data['id'] = intval( $data['id'] ); $data['position'] = intval( $data['position'] ); sql("update fotogal set position='{$data['position']}' where id='{$data['id']}'"); } break; case 'add': if (ini_get('magic_quotes_gpc') == 1) { $_POST['name'] = stripslashes($_POST['name']); } $_POST['name'] = mysql_real_escape_string($_POST['name']); $_POST['id_razdel'] = intval( $_POST['id_razdel'] ); $_POST['status'] = intval( $_POST['status'] ); //upload image $path = $base_url."../user_foto/fotogal/"; if ($_FILES['img_foto']['tmp_name'] != '' ) { if (is_uploaded_file($_FILES['img_foto']['tmp_name'])) { list($width, $height, $type, $attr) = getimagesize($_FILES['img_foto']['tmp_name']); $size = filesize($_FILES['img_foto']['tmp_name']); list ($year, $month, $day) = split("-",$_POST['data']); if (!file_exists($path . $year)) { mkdir( $path . $year ); } if (!file_exists($path . $year . "/" . $month)) { mkdir( $path . $year . "/" . $month ); } if (!file_exists($path . $year . "/" . $month . "/" . $day)) { mkdir( $path . $year . "/" . $month . "/" . $day ); } $img_index=upload_foto($_FILES['img_foto']['tmp_name'],130,500,1,1,$base_url."../user_foto/fotogal/" . $year . "/" . $month . "/" . $day,1); $img_index="user_foto/fotogal/" . $year . "/" . $month . "/" . $day . "/" . $img_index; $im_in = ImageCreateFromJpeg($base_url . '../' . str_replace(".", "_orig.", $img_index)); $wnew = 80; $prop=$width/$wnew; $h_new=round($height/$prop); if ($h_new > $wnew) { $h_new=$wnew; $prop=$height/$h_new; $wnew=round($width/$prop); } $im_out = @imagecreatetruecolor($wnew,$h_new); imageCopyResampled($im_out, $im_in, 0, 0, 0, 0, $wnew, $h_new, $width, $height); imageJpeg($im_out, $path . $year . "/" . $month . "/" . $day . "/" . str_replace(".", "_min.", basename($img_index)), 80); ImageDestroy($im_out); } } $result = sql("insert into fotogal2 set data='{$_POST['data']}', name='{$_POST['name']}', status='{$_POST['status']}', id_razdel='{$_POST['id_razdel']}', size='{$size}', dim_x='{$width}', dim_y='{$height}', foto='{$img_index}' "); if (!$result) { error(); } $last_id = mysql_insert_id(); $result = sql("update fotogal2 set position=id where id='{$last_id}'"); if (!$result) { error(); } header('location: foto.php?id_razdel=' . $_POST['id_razdel']); break; case 'edit': //if ( $acl['a'] != 1 ) { // exit(0); //} if (ini_get('magic_quotes_gpc') == 1) { $_POST['name'] = stripslashes($_POST['name']); } $_POST['name'] = mysql_real_escape_string($_POST['name']); $_POST['id_razdel'] = intval( $_POST['id_razdel'] ); $_POST['status'] = intval( $_POST['status'] ); //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 foto from fotogal where id='{$_POST['id']}'"); if ( $rs_image['foto'] != '' ) { if ( file_exists( $base_url."../".$rs_image['foto'] ) ) { unlink($base_url."../".$rs_image['foto']); } if ( file_exists( $base_url."../".str_replace('.', '_sm.', $rs_image['foto'] ) ) ) { unlink($base_url."../".str_replace('.', '_sm.', $rs_image['foto'] )); } } $img_index=upload_foto($_FILES['img_foto']['tmp_name'],150,800,1,1,$base_url."../image/fotogal"); $img_index="image/fotogal/".$img_index; $sql_img = ",foto='{$img_index}'"; } } else { $sql_img = ''; } $result=sql("update fotogal2 set data='{$_POST['data']}', name='{$_POST['name']}', status='{$_POST['status']}', id_razdel='{$_POST['id_razdel']}' {$sql_img} where id='{$_POST['id']}'"); if (!$result) { error(); } header('location: foto.php?id_razdel=' . $_POST['id_razdel']); break; case 'mass_upload': if (ini_get('magic_quotes_gpc') == 1) { $_POST['name'] = stripslashes($_POST['name']); } $_POST['name'] = mysql_real_escape_string($_POST['name']); $_GET['id_razdel'] = intval( $_GET['id_razdel'] ); //upload image $path = $base_url."../user_foto/fotogal/"; if ($_FILES['img_foto']['tmp_name'] != '' ) { if (is_uploaded_file($_FILES['img_foto']['tmp_name'])) { list($width, $height, $type, $attr) = getimagesize($_FILES['img_foto']['tmp_name']); $size = filesize($_FILES['img_foto']['tmp_name']); list ($year, $month, $day) = split("-",$_POST['data']); if (!file_exists($path . $year)) { mkdir( $path . $year ); } if (!file_exists($path . $year . "/" . $month)) { mkdir( $path . $year . "/" . $month ); } if (!file_exists($path . $year . "/" . $month . "/" . $day)) { mkdir( $path . $year . "/" . $month . "/" . $day ); } $img_index=upload_foto($_FILES['img_foto']['tmp_name'],130,500,1,1,$base_url."../user_foto/fotogal/" . $year . "/" . $month . "/" . $day,1); $img_index="user_foto/fotogal/" . $year . "/" . $month . "/" . $day . "/" . $img_index; $im_in = ImageCreateFromJpeg($base_url . '../' . str_replace(".", "_orig.", $img_index)); $wnew = 80; $prop=$width/$wnew; $h_new=round($height/$prop); if ($h_new > $wnew) { $h_new=$wnew; $prop=$height/$h_new; $wnew=round($width/$prop); } $im_out = @imagecreatetruecolor($wnew,$h_new); imageCopyResampled($im_out, $im_in, 0, 0, 0, 0, $wnew, $h_new, $width, $height); imageJpeg($im_out, $path . $year . "/" . $month . "/" . $day . "/" . str_replace(".", "_min.", basename($img_index)), 80); ImageDestroy($im_out); } } $result = sql("insert into fotogal2 set data=curdate(), name='{$_POST['name']}', status='3', id_razdel='{$_GET['id_razdel']}', size='{$size}', dim_x='{$width}', dim_y='{$height}', foto='{$img_index}' "); if (!$result) { error(); } $last_id = mysql_insert_id(); $result = sql("update fotogal2 set position=id where id='{$last_id}'"); if (!$result) { error(); } break; }
/admin/fotogal2/
Имя
Дата
Размер
..
2026-10-02
action.php
2014-07-11
11 кб.
foto.php
2014-07-11
14 кб.
razdel.php
2009-12-25
11 кб.
/admin/fotogal2
Загрузить файлы
Файл 1
Файл 2
Файл 3