📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
turscripti.demodesign.com.tr
/
~yonetim
/
~sayfalar
📝
urunler.php
← Geri Dön
<?php if (isset($_GET['temizle'])) { $id = hepmax_guard($_GET['temizle']); $bakresim = $hepmaxdb->query("select * from urunler where id='$id'")->fetch(PDO::FETCH_ASSOC); $bakozellik2 = $hepmaxdb->query("select * from anaozellik where urunid='$id'")->fetchAll(PDO::FETCH_ASSOC); foreach($bakozellik2 as $bakozellik){ $anaozellikid = $bakozellik['id']; $altozelliksil = $hepmaxdb->prepare("delete from anaozellikalt where anaid='$anaozellikid'"); $altozelliksil->execute(array($bakozellik['id'])); } $anaozelliksil = $hepmaxdb->prepare("delete from anaozellik where urunid='$id'"); $anaozelliksil->execute(array($id)); if($bakresim['resim']=='resimyok.jpg'){ $silresim="../resimler/urun/".$bakresim['resim'].""; $silresim2="../resimler/urun/".$bakresim['resim2'].""; $silresim3="../resimler/urun/".$bakresim['resim3'].""; $silresim4="../resimler/urun/".$bakresim['resim4'].""; $sil =@unlink("$silresim"); $sil2 =@unlink("$silresim2"); $sil3 =@unlink("$silresim3"); $sil4 =@unlink("$silresim4"); } $sayfasil = $hepmaxdb->prepare("delete from urunler where id='$id'"); $sayfasil->execute(array($id)); if ($sayfasil) { echo sky_alert('success',"Silme İşlemi Başarılı."); }else { echo sky_alert('danger',"Hata Oluştu."); } } ?> <div class="wrapper"> <div class="container-fluid"> <!-- Page-Title --> <div class="page-title-box"> <div class="row align-items-center"> <div class="col-sm-6"> <h4 class="page-title">Tüm Villalar</h4> </div> <div class="col-sm-6"> <ol class="breadcrumb float-right"> <li class="breadcrumb-item"><a href="index.php">Anasayfa</a></li> <li class="breadcrumb-item active">Villalar</li> </ol> </div> </div> <!-- end row --> </div> <div class="row"> <div class="col-12"> <div class="card m-b-30"> <div class="card-body"> <p class="sub-title" style="text-align:right;margin-bottom: 10px;"> <a href="urunekle" style="width: 100%;" class="btn btn-success waves-effect waves-lightt"> + Villa Ekle </a> </p> <div class="col-lg-12" style="background: #f9f9f9;padding: 10px !important;margin-bottom: 20px !important"> <form action="" method="GET"> <label style="width: 95%;">Villa Sıralama:</label> <input type="hidden" name="pages" value="<?php echo hepmax_guard($_GET['pages']);?>"/> <select name="siralama" style="width: 50%;" class="form-control" onchange='this.form.submit()'> <option <?php echo $_GET['siralama'] == 'onerilen' ? 'selected="selected"' : null; ?> value="onerilen">Önerilen Sıralama</option> <option <?php echo $_GET['siralama'] == 'fiyatartan' ? 'selected="selected"' : null; ?> value="fiyatartan">Önce en yüksek Fiyat</option> <option <?php echo $_GET['siralama'] == 'fiyatazalan' ? 'selected="selected"' : null; ?> value="fiyatazalan">Önce en düşük Fiyat</option> <option <?php echo $_GET['siralama'] == 'eskitarih' ? 'selected="selected"' : null; ?> value="eskitarih">En Eski Tarihe Göre</option> <option <?php echo $_GET['siralama'] == 'yenitarih' ? 'selected="selected"' : null; ?> value="yenitarih">En Yeni Tariha Göre</option> </select> <div style="margin-left: 53% !important;margin-top: -53px !important;"> <label style="width: 100%;">Kategori: <select name="urunara" class="form-control"> <option selected value="0">Tümü</option> <?php $category_list = $hepmaxdb->query("SELECT * from kategoriler order by id DESC", PDO::FETCH_OBJ)->fetchAll(); foreach ($category_list as $category) { ?> <option value="<?php echo $category->id; ?>" <?php if($category->id == $_GET['urunara']) { ?> selected="selected" <?php } ?>><?php echo $category->adi; ?></option> <?php } ?> </select> </label> </div> <button type="submit" style="width: 100%;" class="btn btn-warning waves-effect waves-lightt"> Arama Yap </button> </div> </form> <div class="table-responsive"> <table class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <thead> <tr> <th>Fiyati</th> <th>Villa Adı</th> <th>Villa Kategori</th> <th>Villa Resmi</th> <th>Durumu</th> <th>Hit</th> <th>İşlem</th> </tr> </thead> <tbody> <?php $pages = intval(@$_GET['pages']); if (!$pages) { $pages = 1; } $urunarama = " "; if (isset($_GET["urunara"]) && $_GET["urunara"] != "") { $urunarax = hepmax_guard($_GET["urunara"]); $urunarama .= " where kategori='$urunarax'"; } $bak = $hepmaxdb->prepare("select * from urunler ".$urunarama.""); $bak->execute(array()); $toplam= $bak->rowCount(); $limit = 30; $goster = $pages*$limit-$limit; $sayfasayisi = ceil($toplam/$limit); $forlimit = 15; if (isset($_GET["siralama"]) && $_GET["siralama"] != "") { if(hepmax_guard($_GET["siralama"]=='fiyatartan')){ $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by fiyat DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='fiyatazalan')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by fiyat ASC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='elit')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by elit DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='enbegenilen')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by hit DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='eskitarih')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by tarih ASC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='yenitarih')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by tarih DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='azstok')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by stok ASC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } elseif (hepmax_guard($_GET["siralama"]=='onerilen')) { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by vip DESC, plus DESC, elit DESC, id DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } } else { $pageoku = $hepmaxdb->query("select * from urunler ".$urunarama." order by vip DESC, plus DESC, elit DESC, id DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); } $__URUN__ = false; foreach ($pageoku as $tr) { $__URUN__ = true; ?> <tr> <td><b><?php echo $tr['fiyat']?></b> TL</td> <td><a target="_blank" href="../villa-detay-<?php echo $tr['id']?>"><?php echo mb_substr($tr['adi'],0,50);?> ...</a></td> <td> <?php $kategoricek = $hepmaxdb->query("select * from kategoriler where id='".$tr['kategori']."'")->fetch(PDO::FETCH_ASSOC); ?> <a target="_blank" href="kategoriler?duzenle=<?php echo $kategoricek['id']?>"><?php echo mb_substr($kategoricek['adi'],0,100);?> ...</a> </td> <td style="width: 20% !important;"> <a class="pop" href="javascript:void(0);" > <img width="32" data-src="../resimler/urun/<?php echo $tr['resim']?>" src="../resimler/loading.gif" class="lazy"> </a> <a class="pop" href="javascript:void(0);" > <img width="32" data-src="../resimler/urun/<?php echo $tr['resim2']?>" src="../resimler/loading.gif" class="lazy"> </a> <a class="pop" href="javascript:void(0);" > <img width="32" data-src="../resimler/urun/<?php echo $tr['resim3']?>" src="../resimler/loading.gif" class="lazy"> </a> <a class="pop" href="javascript:void(0);"> <img width="32" data-src="../resimler/urun/<?php echo $tr['resim4']?>" src="../resimler/loading.gif" class="lazy"> </a> </td> <td> <?php if($tr['durum']=='1'){ ?> <span style="font-size: 13px;" class="badge badge-success">Aktif</span> <?php } else { ?> <span style="font-size: 13px;" class="badge badge-pill badge-danger">Pasif</span> <?php } ?> </td> <td><?php echo $tr['hit']?></td> <td> <a href="urunler?temizle=<?php echo $tr['id']; ?>" onclick="return confirm('Silmek istediğinize emin misiniz ?')" class="btn btn-sm btn-danger" data-toggle="tooltip" data-original-title="Sil"><i class="fa fa-ban" aria-hidden="true"></i></a> <a href="urunekle?duzenle=<?php echo $tr['id']?>" class="btn btn-sm btn-success" data-toggle="tooltip" data-original-title="Düzenle"><i class="fa fa-edit" aria-hidden="true"></i></a> </td> </tr> <?php } if (!$__URUN__){ echo " Henüz eklenmiş bir villa bulunamadı."; } ?> </tbody> </table> </div> <div> <b>Toplam : <?php echo $toplam;?> adet villa bulundu.</b> <ul class="pagination pagination-circled mb-0"> <?php for ($i= $pages - $forlimit ; $i < $pages + $forlimit + 1 ; $i++) { if ($i>0 and $i<=$sayfasayisi) { if ($i == $pages) { echo ' <li class=" page-item active"> <a href="" aria-controls="datatable" data-dt-idx="1" tabindex="0" class="page-link">'.$i.'</a> </li>'; }else{ echo ' <li class=" page-item "> <a href="urunler?pages='.$i.'&siralama='.$_GET['siralama'].'&urunara='.$_GET['urunara'].'" aria-controls="datatable" data-dt-idx="'.$i.'" tabindex="0" class="page-link">'.$i.'</a> </li> '; } } } ?> <li class=" page-item "> <?php $ileri = $i;?> <a href="urunler?pages=<?php echo $i;?>&siralama=<?php echo $_GET['siralama'];?>&urunara=<?php echo $_GET['urunara'];?>" aria-controls="datatable" data-dt-idx="<?php echo $ileri;?>" tabindex="0" class="page-link">>></a> </li> </ul> </div> </div> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- end container-fluid --> </div> <!-- end wrapper --> <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Kapat</span></button> <img src="" class="imagepreview" style="width: 100%;" > </div> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.8.2/dist/lazyload.min.js"></script> <script> var lazyLoadInstance = new LazyLoad({ effect : "fadeIn" }); lazyLoadInstance.update(); </script> <script> $('.pop').on('click', function() { $('.imagepreview').attr('src', $(this).find('img').attr('src')); $('#imagemodal').modal('show'); }); </script>
💾 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