📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
butikv1.demodesign.com.tr
/
xpanel
📝
indir.php
← Geri Dön
<?php $blok="genel-yonetim"; $sayfa="admin-islemleri"; ?> <?php include 'inc/header.php';?> <?php include 'inc/sidebar.php';?> <?php include 'inc/navbar.php';?> <?php if(empty($_GET["sip"])){ header("location:index.php"); } $update = $dbh->prepare("UPDATE product_order SET status=1 where id=?"); $update-> execute(array($_GET['id'])); $dosya = $dbh -> prepare("SELECT * FROM dosyalar WHERE sip = ?"); $dosya-> execute(array($_GET["sip"])); $dosya = $dosya->fetch(PDO::FETCH_OBJ); if(empty($dosya)){ $insert = $dbh->prepare("INSERT INTO dosyalar SET sip=?, ziplendi=1"); $insert-> execute(array($_GET['sip'])); } ?> <?php function Zip($source, $destination) { if (extension_loaded('zip') === true) { if (file_exists($source) === true) { $zip = new ZipArchive(); if ($zip->open($destination, ZIPARCHIVE::CREATE) === true) { $source = realpath($source); if (is_dir($source) === true) { $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST); foreach ($files as $file) { $file = realpath($file); if (is_dir($file) === true) { $zip->addEmptyDir(str_replace($source . '/', '', $file . '/')); } else if (is_file($file) === true) { $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file)); } } } else if (is_file($source) === true) { $zip->addFromString(basename($source), file_get_contents($source)); } } return $zip->close(); } } return false; } ; // Kullanımı Zip({{Dizin Adı}}, {{Oluşturulacak Arşiv Dosyası}}); Zip('../dosyalar/'.$_GET["sip"], './indir/'.$_GET["sip"].'.zip'); function dosyaDownload($dosya) { if ((isset($dosya))&&(file_exists($dosya))) { header("Content-length: ".filesize($dosya)); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $dosya . '"'); readfile("$dosya"); } else { echo "Dosya Seçilmedi"; } } //dosyaDownload('indir/'.$_GET["sip"].'.zip'); //Kullanımı ?> <?php if($_GET['indir']=="ok"){ ?> <?php $update = $dbh->prepare("UPDATE dosyalar SET indirildi=1 where sip=?"); $update-> execute(array($_GET['sip'])); //header("location:indir.php?sip=44324"); } ?> <?php if($_GET['sil']=="ok" && !empty($_GET["sip"])){ function klasorsil($klasor){ if (substr($klasor, -1) != '/') $klasor .= '/'; if ($handle = opendir($klasor)) { while ($obj = readdir($handle)) { if ($obj!= '.' && $obj!= '..') { if (is_dir($klasor.$obj)) { if (!klasorsil($klasor.$obj)) return false; }elseif (is_file($klasor.$obj)) { if (!unlink($klasor.$obj)) return false; } } } closedir($handle); if (!@rmdir($klasor)) return false; return true; } return false; } klasorsil('../dosyalar/'.$_GET["sip"]); unlink('indir/'.$_GET["sip"].'.zip'); $update = $dbh->prepare("UPDATE dosyalar SET silindi=1 where sip=?"); $update-> execute(array($_GET['sip'])); echo "Dosya Silindi"; } ?> <!-- Page Inner Start --> <!--================================--> <div class="page-inner"> <!-- Main Wrapper --> <div id="main-wrapper"> <!--================================--> <!-- Breadcrumb Start --> <!--================================--> <div class="pageheader pd-t-25 pd-b-35" style="min-height:100px;"> <div class="col-sm-6 col-md-6 float-left"> <div class="pd-t-5 pd-b-5"> <h1 class="pd-0 mg-0 tx-20">Sipariş Resim Hazırla </h1> </div> <div class="breadcrumb pd-0 mg-0"> <a class="breadcrumb-item" href="index.php"><?php echo $dil["anasayfa"];?></a> <span class="breadcrumb-item active"> Sipariş Resim İndir</span> </div> </div> </div> <!--/ Breadcrumb End --> <!--================================--> <!--/ Orta Alanın Başlangıç Noktası --> <div class="row row-xs clearfix"> <!-- Striped Table Start --> <!--================================--> <div class="col-md-12 col-lg-12"> <div class="card mg-b-20"> <div class="card-header"> <h4 class="card-header-title"> Dosya İndir </h4> <div class="card-header-btn"> <a href="#" data-toggle="collapse" class="btn card-collapse" data-target="#collapse2" aria-expanded="true"><i class="ion-ios-arrow-down"></i></a> <a href="#" data-toggle="refresh" class="btn card-refresh"><i class="ion-android-refresh"></i></a> <a href="#" data-toggle="expand" class="btn card-expand"><i class="ion-android-expand"></i></a> <a href="#" data-toggle="remove" class="btn card-remove"><i class="ion-android-close"></i></a> </div> </div> <div class="card-body collapse show" id="collapse1"> <div class="form-layout form-layout-1"> <?php if($dosya->silindi!=1){ ?> <a href="indir.php?sip=<?=$_GET["sip"]?>&indir=ok" class="btn btn-primary mg-t-10" >İndir</a> <?php }else{ echo "Dosyayı sildiniz Dosyaya ulaşılamıyor"; } ?> <?php if($dosya->silindi==0){ ?> <a href="indir.php?sip=<?=$_GET["sip"]?>&sil=ok" class="btn btn-primary mg-t-10" >Dosyayı Sil</a> <?php }else{?> <?php } ?> </div> <!-- kaydet --> </div> </div> </div> </div> <!--/ Striped Table End --> <!--================================--> </div> <!--/ Main Wrapper End --> </div> <!--/ Page Inner End --> <script type="text/javascript"> function indir(){ window.location.href ='indir/<?=$_GET["sip"]?>.zip'; } </script> <?php include 'inc/footer.php';?> <?php if($_GET['indir']=="ok"){ ?> <script>window.location.href ='indir/<?=$_GET['sip']?>.zip';</script> <?php } ?>
💾 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