📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
b2be-ticaretscripti.demodesign.com.tr
/
boss_old
📝
sepeti_goster.php
← Geri Dön
<?php define("guvenlik",true);?> <?php require('../func/db.php'); require('../func/fonksiyon.php'); giriskontrol($ozy,1); if(!isset($_SESSION["giris"])){ header("Location:index.php"); } else { }?> <table class="table table-cart table-mobile"> <thead> </thead> <tbody> <?php $sepetimdekikimm = $_GET['bayino']; $sepetebak = $ozy->prepare("SELECT * FROM sepet WHERE gelenkim=?"); $sepetebak->execute(array($sepetimdekikimm)); if ($sepetebak->rowCount()) { $uyesepeti = $ozy->prepare("SELECT * FROM urunler INNER JOIN sepet ON urunler.id = sepet.urunid WHERE sepet.gelenkim=? ORDER BY sepet.id DESC"); $uyesepeti->execute(array($sepetimdekikimm)); foreach ($uyesepeti as $sepet) {?> <form method="POST" action=""> <input type="hidden" name="sepetidm" value="<?php echo $sepet['id'];?>"> <div class="urun" style="background: #e9ecef; border-radius: 6px; margin-bottom: 20px; padding: 10px;"> <a target="_blank" href="../urun/<?php echo $sepet['seo'];?>"> <div style="width: 75%;"><?php echo $sepet['adi'];?> <b style="font-weight:bold;"> </br><?php echo $sepet['adet'];?> Adet - <?php echo fiyatgoster($sepet['fiyat']*$sepet['adet']);?></b></div> </a> <?php if($sepet['kargo']=='1'){?> <span class="badge1" style="background: #767373; color: white; border-radius: 5px; padding: 5px; margin-top: 4px; display: block; width: 30%;"> <i class="fa fa-truck"></i> ÜCRETSİZ KARGO </span> <?php } ?> <?php if($sepet['alodedurum']=='1'){?> <span class="badge2" style="background: #a39900; color: white; border-radius: 5px; padding: 5px; margin-top: 4px; display: block; width: 30%;"> <i class="fa fa-gift"></i> <?php echo $sepet['alodemetin'];?></span> <?php } ?> <div> <div class="cart-product-quantity-changer" style="display: flex; float: right; margin-top: -6%; margin-right: 12%;"> <a id="AdetArttir<?php echo $sepet['id'];?>"> <div class="cart-product-quantity-changer-increaser" style="text-align: center; background: #6c6c6c; color: white; border-radius: 2px;"> <i class="fa fa-plus" style="width: 50px; height: 40px; line-height: 40px;" ></i></div></a> <div class="cart-product-quantity-changer-quantity"> <?php if($sepet['alodedurum']=='1'){?> <?php $newstok = $sepet['adet']+$sepet['alodeadet'];?> <?php } else { ?> <?php $newstok = $sepet['adet'];?> <?php } ?> <?php if($system['sinirsizstok']!='1'){ ?> <input style="text-align: center;height: 41px; width: 80px;" class="submit_on_enter" type="text" data-type="number" pattern="[0-9]*" id="NormalAdeti<?php echo $sepet['id'];?>" onchange="this.form.submit()" name="adet" value="<?php echo $newstok;?>" min="1" max="<?php echo $sepet['stok'];?>" size="2"> <?php } else { ?> <input style="text-align: center;height: 41px; width: 80px;" class="submit_on_enter" type="text" data-type="number" pattern="[0-9]*" id="NormalAdeti<?php echo $sepet['id'];?>" onchange="this.form.submit()" name="adet" value="<?php echo $newstok;?>" min="1" max="9999999999999999999"> <?php } ?> </div> <a id="AdetAzalt<?php echo $sepet['id'];?>"> <div class="cart-product-quantity-changer-decreaser" style="text-align: center; background: #6c6c6c; color: white; border-radius: 2px;"> <i class="fa fa-minus" style="width: 50px; height: 40px; line-height: 40px;"> </i></div> </a> </div> </div> <button style="border: none; float: right; margin-right: -44%; margin-top: -6%; background: #fffbfb; width: 66px; border-radius: 5px; height: 40px;" data-id="<?php echo $sepet['id']; ?>" name="sepetsil" type="submit"> <i class="fa fa-trash"></i></button> </div> </form> <?php }} ?> </tbody> </table><!-- End .table table-wishlist --> <script src="../user/jquery.min.js"></script> <script src="../user/bootstrap-input-spinner.js"></script> <?php $sepetimdekikimm = $_GET['bayino']; $sepetebak = $ozy->prepare("SELECT * FROM sepet WHERE kim=? and gelenkim=?"); $sepetebak->execute(array($ip, $sepetimdekikimm)); if ($sepetebak->rowCount()) { $uyesepeti = $ozy->prepare("SELECT * FROM urunler INNER JOIN sepet ON urunler.id = sepet.urunid WHERE sepet.kim=? and sepet.gelenkim=? ORDER BY sepet.id DESC"); $uyesepeti->execute(array($ip, $sepetimdekikimm)); foreach ($uyesepeti as $sepet) { ?> <script type="text/javascript"> $(document).ready(function() { var urunId<?php echo $sepet['id'];?> = <?php echo $sepet['id'];?>; $("#AdetArttir<?php echo $sepet['id'];?>").on("click", function () { var adet = parseInt($("#NormalAdeti<?php echo $sepet['id'];?>").val()); if (adet < 8) { adet++; $("#NormalAdeti<?php echo $sepet['id'];?>").val(adet); updateAdet(urunId<?php echo $sepet['id'];?>, adet); // Veritabanında adet güncelleme fonksiyonunu çağırın } }); $("#AdetAzalt<?php echo $sepet['id'];?>").on("click", function () { var adet = parseInt($("#NormalAdeti<?php echo $sepet['id'];?>").val()); if (adet > 0) { adet--; $("#NormalAdeti<?php echo $sepet['id'];?>").val(adet); updateAdet(urunId<?php echo $sepet['id'];?>, adet); // Veritabanında adet güncelleme fonksiyonunu çağırın } }); $("#NormalAdeti<?php echo $sepet['id'];?>").keypress(function (e) { var regex = new RegExp("^[0-9]"); var str = String.fromCharCode(!e.charCode ? e.which : e.charCode); if (regex.test(str)) { return true; } e.preventDefault(); return false; }); function updateAdet(urunId, adet) { $.ajax({ type: "POST", url: "sepeti_guncelle.php", // Veritabanı sorgusunun çalıştırılacağı PHP dosyasının yolunu belirtin data: { urunId: urunId, adet: adet }, success: function (response) { location.reload(); }, error: function () { // Hata durumunda yapılacak işlemler console.log("Adet güncellenirken hata oluştu"); } }); } $('[name="sepetsil"]').click(function() { var sepetId = $(this).data('id'); $.ajax({ type: 'POST', url: 'sepet_sil.php', data: { sepetId: sepetId }, success: function(response) { // Başarılı işlem durumunda yapılabilecek işlemler toastr.success('Başarıyla veri silindi.', 'Başarılı'); }, error: function(xhr, status, error) { // Hata durumunda yapılacak işlemler console.error(error); } }); }); }); </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