📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
qrmenuv2.demodesign.com.tr
/
admin
/
controller
📝
galeri.php
← Geri Dön
<?php $querygallery=$db->prepare("SELECT * FROM gallery where id=:id and type=:type"); $querygallery->execute(array( 'id' => $_GET['id'], 'type' => "product" )); $theme = $settings["theme"]; if (isset($_POST['newgallery'])) { $images = array(); foreach ($_FILES['image'] as $k => $l) { foreach ($l as $i => $v) { if (!array_key_exists($i, $images)) $images[$i] = array(); $images[$i][$k] = $v; } } foreach ($images as $image){ $handle = new Upload($image); $s1=rand(1000,3200); $s2=rand(1000,3200); $s3=rand(1000,3200); $s4=rand(1000,3200); $names=$s1.$s2.$s3.$s4; $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_x = 1000; $handle->image_y = 667; $name=$handle->file_new_name_body = $names; $uzantiss=$handle->file_src_name; $uzantis=ext($uzantiss); $uzanti=$handle->image_convert = $uzantis; $handle->allowed = array('image/*'); $handle->Process(realpath(PATH)."/public/{$theme}/images/gallery/"); $image= "images/gallery/".$name.".".$uzanti; $handle-> Clean(); $kaydet=$db->prepare("INSERT INTO gallery SET image=:image, type=:type, id=:id"); $insert=$kaydet->execute(array( 'image' => $image, 'type' => "product", 'id' => $_POST['id'] )); if ($insert) { $success = 'İşlem başarıyla gerçekleşti.'; } else { $error = 'Bir hata oluştu.'; } } } if (isset($_POST['deletegallery'])) { $image=$_POST['image']; $sil=$db->prepare("DELETE from gallery where gallery_id=:gallery_id"); $kontrol=$sil->execute(array( 'gallery_id' => $_POST['gallery_id'] )); if ($kontrol) { $sil= PATH . "/public/{$theme}/{$image}"; @unlink("$sil"); $success = 'İşlem başarıyla gerçekleşti.'; } else { $error = 'Bir hata oluştu.'; } } require admin_view('galeri');
💾 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