📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv3.demodesign.com.tr
/
yonetim
📝
urunler.php
← Geri Dön
<?php if (isset($_GET['sill'])) { $urunid = intval($_GET['sill']); $bakresim = $DB->query("select * from urunler where urunid='$urunid'")->fetch(PDO::FETCH_ASSOC); $verisil = $DB->prepare("delete from urunler where urunid='$urunid'"); $verisil->execute(array($urunid)); if ($verisil) { $not = ' <div class="alert alert-warning"> <button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button> <strong>Veri Silindi !</strong> </div>' ; $silresim="../images/urunler/".$bakresim['resim'].""; $sil =@unlink("$silresim"); }} $sonuc = ""; // sonucumuzu varsayılan olarak error olarak ayarlıyoruz if (is_array($_POST['item'])) { // gelen değerler (eleman-1) dizi olup olmadığını kontrol ediyoruz foreach ($_POST['item'] as $key => $value) // döngüde elemanların id ve sıra bilgisini alıyoruz if ($DB->query("UPDATE urunler SET sira = $key WHERE urunid = $value")) // her satırın id bilgisi ile sıra bilgisini veritabanında düzenliyoruz $sonuc = "success"; // sonuc değişkenine success değerini atıyoruz } echo $sonuc; // sonuç değerini geri döndürüyoruz json formatında da döndürebilirdik if (isset($_POST['toplusil'])) { $tsil = implode(",",$_POST["tsil"]); $senresim = $DB->query("select resim from urunler where urunid in($tsil)")->fetchAll(PDO::FETCH_ASSOC); foreach($senresim as $bakresimz){ $delete = $DB->query("delete from urunler where urunid in($tsil)"); if($delete){ $not = ' <div class="alert alert-warning"> <button class="close" data-dismiss="alert"><i class="pci-cross pci-circle"></i></button> <strong>Seçilen Veriler Silindi !</strong> </div>' ; $silresimx="../images/urunler/".$bakresimz['resim'].""; $silx =@unlink("$silresimx"); }else { echo "<h3 class='admin_dikkat'>Bir Hata Oluştu.</h3>"; } } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Ürünler </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="index.html"><i class="fa fa-home"></i> Anasayfa</a></li> <li class="breadcrumb-item active">Ürünler</li> </ol> <?=$not?> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="box box-solid bg-dark"> <!-- /.box-header --> <div class="box-body"> <div class="table-responsive"> <a href="urunlerekle.html" class="btn btn-block btn-warning btn-lg">Ürün Ekle</a> <form action="" method="post"> <table id="example" class="table table-bordered table-hover display nowrap margin-top-10 w-p100"> <thead> <tr> <th></th> <th>İD</th> <th>ÜRÜN SIRASI</th> <th>ÜRÜN KODU</th> <th>ÜRÜN ADI</th> <th>KATEGORİLER</th> <th>RESİM</th> <th>HİT</th> <th>DURUM</th> <th>TARİH</th> <th>İNSTAGRAM PAYLAŞ</th> <th>DÜZENLE</th> </tr> </thead> <tbody> <?php $sayfa = intval(@$_GET['sayfa']); if (!$sayfa) { $sayfa = 1; } $bak = $DB->prepare("select * from urunler "); $bak->execute(array()); $toplam= $bak->rowCount(); $limit = 100000; $goster = $sayfa*$limit-$limit; $sayfasayisi = ceil($toplam/$limit); $forlimit = 2; $pr = $DB->query("select * from urunler ORDER BY urunid DESC limit $goster,$limit")->fetchAll(PDO::FETCH_ASSOC); foreach ($pr as $tr) { ?> <tr> <td> <input type="checkbox" name="tsil[]" value="<?php echo $tr['urunid']?>"> </td> <td><?php echo $tr['urunid']?></td> <td><font color="red"><?php echo $tr['sira']?></font></td> <td><font color="#3a444e" size="2"/><?php echo $tr['urunkodu']?></font></td> <td><font color="#3a444e" size="2"/><a target="_blank" href="../urunler/<?php echo $tr['seo']?>-<?php echo $tr['urunid']?>"><?php echo $tr['urunAdi']?></a></font></td> <td><font color="#3a444e" size="2"/> <div style="overflow: scroll;max-height: 90px;"> <?php $etiketler = $tr['kategori']; $etiketler = explode(',', $etiketler); foreach( $etiketler as $anahtar => $deger ){?> <?php $kat = $DB->query("select * from urunk where id='$deger'")->fetchAll(PDO::FETCH_ASSOC); foreach ($kat as $de) {?> <?php echo $de['baslik']; ?><?php } ?></br> <?php } ?> <?php $etiketlerx = $tr['altkategori']; $etiketlerx = explode(',', $etiketlerx); foreach( $etiketlerx as $anahtarx => $degerx ){?> <?php $katx = $DB->query("select * from aurunk where id='$degerx'")->fetchAll(PDO::FETCH_ASSOC); foreach ($katx as $dex) {?> --><?php echo $dex['baslik']; ?><?php } ?></br> <?php } ?> <?php $etiketlerxz = $tr['baltkategori']; $etiketlerxz = explode(',', $etiketlerxz); foreach( $etiketlerxz as $anahtarxz => $degerxx ){?> <?php $katxz = $DB->query("select * from baurunk where id='$degerxx'")->fetchAll(PDO::FETCH_ASSOC); foreach ($katxz as $dexz) {?> ---><?php echo $dexz['baslik']; ?><?php } ?></br> <?php } ?> </font></div></td> <td><a class="image-popup-no-margins" href="../images/urunler/<?php echo $tr['resim']?>" ><img height="50px" width="50px" src="../images/urunler/<?php echo $tr['resim']?>"></a></td> <td><?php echo $tr['hit']?></td> <td> <?php if($tr['durum']=='1'){?> <div class="label label-success">Aktif</div> <?php } else { ?> <div class="label label-danger">Pasif</div> <?php } ?> </td> <td><?php echo $tr['tarih']?></td> <td> <a onclick="return confirm('İnstagramda bu ürünü paylaşmak istiyor musunuz?')" target="_blank" href="<?php echo $modul['url']; ?>/uruninstagram.php?urunid=<?php echo $tr['urunid']; ?>"> <div class="label label-success" style="background: #004cff;border: 1px solid #004cff;">İnstagramda Paylaş</div></a> </td> <td> <a onclick="return confirm('Silmek istediğinize emin misiniz ?')" href="?sill=<?php echo $tr['urunid']; ?>" class="btn btn-sm btn-danger" data-toggle="tooltip" data-original-title="Sil"><i class="ti-trash" aria-hidden="true"></i></a> <a href="urunlerekle.html?ok=gn&urunid=<?php echo $tr['urunid']?>" 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 } ?> </tbody> </table> </br> <button style="width: 98%;font-size: 16px;font-weight: 500;height: 50px;" class="btn btn-app bg-red" name="toplusil" type="submit">SEÇİLEN ÜRÜNLERİ SİL</button> </form> </div> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <!-- /.content --> </div> <!-- /.content-wrapper -->
💾 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