📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv10.demodesign.com.tr
/
secured
/
inc
/
modules
/
contents
📝
merchants_post.php
← Geri Dön
<?php echo !defined("GUVENLIK") ? die("Vaoww! Bu ne cesaret?") : null;?> <?php use Verot\Upload\Upload; if($yetki['demo'] != '1' ) { if (isset($_GET['status'])) { if ($_GET['status'] == 'add' || $_GET['status'] == 'edit' || $_GET['status'] == 'gallery_multidelete' || $_GET['status'] == 'gallery' || $_GET['status'] == 'multidelete' || $_GET['status'] == 'tema' ) { function colorFormat($degisken){ $isim = $degisken; $eski = '#'; $yeni = ''; $isim = str_replace($eski, $yeni, $isim); return $isim; } /* Add */ if($_GET['status'] == 'add' ) { if ($_POST && isset($_POST['insert'])) { if ($_POST['baslik'] && $_POST['sira'] && $_POST['sehir']) { /* Seo Ayarları */ if($_POST['seo_url'] == !null ) { $seo_url = seo($_POST['seo_url']); }else{ $seo_url = seo($_POST['baslik']); } if($_POST['seo_baslik']==!null ) { $seo_title = $_POST['seo_baslik']; }else{ $seo_title = $_POST['baslik']; } /* <========SON=========>>> Seo Ayarları SON */ /* Fotoğraf Ayarları */ if ($_FILES['gorsel']["size"] > 0) { $file_format = $_FILES["gorsel"]; if ($file_format['type'] == 'image/jpeg' || $file_format['type'] == 'image/jpg' || $file_format['type'] == 'image/png' || $file_format['type'] == 'image/webp' || $file_format['type'] == 'image/jxr' || $file_format['type'] == 'image/jp2' || $file_format['type'] == 'image/bmp' ) { include_once('inc/class.upload.php'); $upload = new Upload($_FILES['gorsel']); if ($upload->uploaded) { $random = rand(0, (int)999999999); $random2 = rand(0, (int)999); $upload->file_name_body_pre = 'merchant_'; $upload->file_name_body_add = ''.$random.''.$random2.''; $upload->image_resize = true; $upload->image_ratio_crop = true; $upload->png_quality = 90; $upload->webp_quality = 92; $upload->jpeg_quality = 92; $upload->png_compression = 9; $upload->image_ratio_y = true; $upload->image_x = 550; $upload->process("../i/merchants"); } if ($upload->processed){ $gorsel = $upload->file_dst_name; }else{ header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); $_SESSION['main_alert'] = 'filetype'; exit(); } }else{ header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); $_SESSION['main_alert'] = 'filetype'; exit(); } }else{ $gorsel = null; } /* <========SON=========>>> Fotoğraf Ayarları SON */ $kaydet = $db->prepare("INSERT INTO magazalar SET baslik=:baslik, sira=:sira, sehir=:sehir, dil=:dil, durum=:durum, seo_baslik=:seo_baslik, seo_url=:seo_url, gorsel=:gorsel, meta_desc=:meta_desc, tags=:tags, adres=:adres, tel=:tel, eposta=:eposta, work=:work, harita=:harita "); $sonuc = $kaydet->execute(array( 'baslik' => $_POST['baslik'], 'sira' => $_POST['sira'], 'sehir' => $_POST['sehir'], 'dil' => $_SESSION['dil'], 'durum' => $_POST['durum'], 'seo_baslik' => $seo_title, 'seo_url' => $seo_url, 'gorsel' => $gorsel, 'meta_desc' => $_POST['meta_desc'], 'tags' => $_POST['tags'], 'adres' => $_POST['adres'], 'tel' => $_POST['tel'], 'eposta' => $_POST['eposta'], 'work' => $_POST['work'], 'harita' => $_POST['harita'] )); if($sonuc){ $_SESSION['main_alert'] = 'success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); }else{ echo 'Veritabanı Hatası'; } }else{ $_SESSION['main_alert'] = 'zorunlu'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); } }else{ header('Location:'.$ayar['site_url'].'404'); } } /* <========SON=========>>> Intro Add SON */ /* Edit */ if($_GET['status'] == 'edit' ) { if ($_POST && isset($_POST['update'])) { if ($_POST['baslik'] && $_POST['sira'] && $_POST['m_id'] && $_POST['sehir'] ) { /* Seo Ayarları */ if($_POST['seo_url'] == !null ) { $seo_url = seo($_POST['seo_url']); }else{ $seo_url = seo($_POST['baslik']); } if($_POST['seo_baslik']==!null ) { $seo_title = $_POST['seo_baslik']; }else{ $seo_title = $_POST['baslik']; } /* <========SON=========>>> Seo Ayarları SON */ /* Fotoğraf Ayarları */ if ($_FILES['gorsel']["size"] > 0) { $file_format = $_FILES["gorsel"]; if ($file_format['type'] == 'image/jpeg' || $file_format['type'] == 'image/jpg' || $file_format['type'] == 'image/png' || $file_format['type'] == 'image/webp' || $file_format['type'] == 'image/jxr' || $file_format['type'] == 'image/jp2' || $file_format['type'] == 'image/bmp' ) { include_once('inc/class.upload.php'); $upload = new Upload($_FILES['gorsel']); if ($upload->uploaded) { $random = rand(0, (int)999999999); $random2 = rand(0, (int)999); $upload->file_name_body_pre = 'merchant_'; $upload->file_name_body_add = ''.$random.''.$random2.''; $upload->image_resize = true; $upload->image_ratio_crop = true; $upload->png_quality = 90; $upload->webp_quality = 92; $upload->jpeg_quality = 92; $upload->png_compression = 9; $upload->image_ratio_y = true; $upload->image_x = 550; $upload->process("../i/merchants"); } if ($upload->processed){ $gorsel = $upload->file_dst_name; unlink('../i/merchants/'.$_POST['eski_gorsel'].''); }else{ header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); $_SESSION['main_alert'] = 'filetype'; exit(); } }else{ header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); $_SESSION['main_alert'] = 'filetype'; exit(); } }else{ $gorsel = $_POST['eski_gorsel']; } /* <========SON=========>>> Fotoğraf Ayarları SON */ $guncelle = $db->prepare("UPDATE magazalar SET baslik=:baslik, sira=:sira, sehir=:sehir, durum=:durum, seo_baslik=:seo_baslik, seo_url=:seo_url, gorsel=:gorsel, meta_desc=:meta_desc, tags=:tags, adres=:adres, tel=:tel, eposta=:eposta, work=:work, harita=:harita WHERE id={$_POST['m_id']} "); $sonuc = $guncelle->execute(array( 'baslik' => $_POST['baslik'], 'sira' => $_POST['sira'], 'sehir' => $_POST['sehir'], 'durum' => $_POST['durum'], 'seo_baslik' => $seo_title, 'seo_url' => $seo_url, 'gorsel' => $gorsel, 'meta_desc' => $_POST['meta_desc'], 'tags' => $_POST['tags'], 'adres' => $_POST['adres'], 'tel' => $_POST['tel'], 'eposta' => $_POST['eposta'], 'work' => $_POST['work'], 'harita' => $_POST['harita'] )); if($sonuc){ $_SESSION['main_alert'] = 'success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); }else{ echo 'Veritabanı Hatası'; } }else{ $_SESSION['main_alert'] = 'zorunlu'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); } }else{ header('Location:'.$ayar['site_url'].'404'); } } if($_GET['status'] == 'multidelete' ) { if($_POST) { $liste = $_POST['sil']; foreach ($liste as $idler){ $sorgu = $db->prepare("select * from magazalar where id='$idler' "); $sorgu->execute(); if($sorgu->rowCount()>'0' ) { $row = $sorgu->fetch(PDO::FETCH_ASSOC); unlink('../i/merchants/'.$row['gorsel'].''); $silmeislem = $db->prepare("DELETE from magazalar WHERE id=:id"); $silmeislem->execute(array( 'id' => $idler )); } } $_SESSION['main_alert'] ='success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); }else{ $_SESSION['main_alert'] ='nocheck'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); } } if($_GET['status'] == 'gallery' ) { foreach($_FILES["gorsel"]["tmp_name"] as $key=>$tmp_name) { $gorselName=$_FILES["gorsel"]["name"][$key]; $gorselType=$_FILES["gorsel"]["type"][$key]; $gorselSize=$_FILES["gorsel"]["size"][$key]; $gorseltmp=$_FILES["gorsel"]["tmp_name"][$key]; $file_format = $gorselType; if($gorselSize <= 0 ) { $_SESSION['main_alert'] ='filesize'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); exit(); } if ($file_format == 'image/jpeg' || $file_format == 'image/jpg' || $file_format == 'image/png' || $file_format == 'image/webp' || $file_format == 'image/jxr' || $file_format == 'image/jp2' || $file_format == 'image/bmp' ) { include_once('inc/class.upload.php'); $upload = new Upload($gorseltmp); if ($upload->uploaded) { $random = rand(0, (int)999999999); $random2 = rand(0, (int)999); $random3 = rand(0, (int)9999); $upload->file_name_body_pre = 'merchant_'; $upload->file_name_body_add = '_'.$random3.''; $upload->image_resize = true; $upload->image_ratio_crop = true; $upload->file_new_name_body = ''.$random.''.$random2.''; $upload->png_quality = 90; $upload->webp_quality = 92; $upload->jpeg_quality = 92; $upload->png_compression = 9; $upload->image_convert = 'png'; $upload->image_ratio_y = true; $upload->image_x = 550; $upload->process("../i/merchants"); } if ($upload->processed){ $gorsel = $upload->file_dst_name; $kaydet = $db->prepare("INSERT INTO magazalar_galeri SET m_id=:m_id, gorsel=:gorsel "); $sonuc = $kaydet->execute(array( 'm_id' => $_GET['mID'], 'gorsel' => $gorsel )); } } } $_SESSION['main_alert'] ='success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); } if($_GET['status'] == 'gallery_multidelete' ) { if($_POST) { $liste = $_POST['sil']; foreach ($liste as $idler){ $sorgu = $db->prepare("select * from magazalar_galeri where id='$idler' "); $sorgu->execute(); if($sorgu->rowCount()>'0' ) { $row = $sorgu->fetch(PDO::FETCH_ASSOC); unlink('../i/merchants/'.$row['gorsel'].''); $silmeislem = $db->prepare("DELETE from magazalar_galeri WHERE id=:id"); $silmeislem->execute(array( 'id' => $idler )); } } $_SESSION['main_alert'] ='success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); }else{ $_SESSION['main_alert'] ='nocheck'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); } } if($_GET['status'] == 'tema' ) { if ($_POST && isset($_POST['update'])) { $guncelle = $db->prepare("UPDATE magazalar_ayar SET meta_desc=:meta_desc, tags=:tags, sayfa_font=:sayfa_font, sayfa_bg=:sayfa_bg, sehir_sec=:sehir_sec, detay=:detay WHERE id='1' "); $sonuc = $guncelle->execute(array( 'meta_desc' => $_POST['meta_desc'], 'tags' => $_POST['tags'], 'sayfa_font' => $_POST['sayfa_font'], 'sayfa_bg' => colorFormat($_POST['sayfa_bg']), 'sehir_sec' => $_POST['sehir_sec'], 'detay' => $_POST['detay'] )); if($sonuc){ $_SESSION['main_alert'] ='success'; header('Location:'.$ayar['panel_url'].'pages.php?page=merchants'); }else{ echo 'Veritabanı Hatası'; } } } }else{ header('Location:'.$ayar['site_url'].'404'); } }else{ header('Location:'.$ayar['site_url'].'404'); } }else{ header('Location:'.$_SESSION['current_url'] .''); $_SESSION['main_alert'] = 'demo'; }
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula