📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
b2be-ticaretscripti.demodesign.com.tr
/
boss
/
pages
📝
kuponekle.php
← Geri Dön
<?php if ($_GET['duzenle']) { $id = temizle($_GET['duzenle']); $ekresimid = temizle($_GET['duzenle']); $sayfam = $ozy->query("select * from kuponlar where sekil='0' and id=$id")->fetch(PDO::FETCH_ASSOC); ///Sayfa güncelleme kodları başlangıç if (isset($_POST['guncelle'])) { $adi = temizle($_POST['adi']); $tip = $_POST['tip'] != "" ? $_POST['tip'] : "0"; $oran = temizle($_POST['oran']); $stok = temizle($_POST['stok']); $durum = temizle($_POST['durum']); $slimit = temizle($_POST['slimit']); $tarih = date('d.m.Y'); $id = $_GET['duzenle']; $stmt = $ozy->prepare("UPDATE kuponlar SET adi = ?, tip = ?, oran = ?, stok = ?, durum = ?, slimit = ?, tarih = ? WHERE id = ?"); $result2 = $stmt->execute([$adi, $tip, $oran, $stok, $durum, $slimit, $tarih, $id]); if ($result2) { echo '<script type="text/javascript">$(document).ready(function(){toastr["success"]("Başarıyla veriyi güncellediniz.", "Başarılı");});</script>'; echo '<meta http-equiv="refresh" content="1; url=' . $url . '/boss/kupon/duzenle/' . $id . '">'; } else { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Üzgünüm bir hata oluştu :(", "Başarısız");});</script>'; } } ////Sayfa güncelleme kodları bitiş } else { if (isset($_POST['kaydet'])) { $adi = temizle($_POST['adi']); $tip = $_POST['tip'] != "" ? $_POST['tip'] : "0"; $oran = temizle($_POST['oran']); $stok = temizle($_POST['stok']); $sekil = "0"; $durum = temizle($_POST['durum']); $tarih = date('d.m.Y'); $slimit = temizle($_POST['slimit']); $stmt = $ozy->prepare("INSERT INTO kuponlar (adi, tip, oran, stok, sekil, durum, tarih, slimit) VALUES (?,?,?,?,?,?,?,?)"); $result2 = $stmt->execute([$adi, $tip, $oran, $stok, $sekil, $durum, $tarih, $slimit]); $id = $ozy->lastInsertId(); if ($result2) { echo '<script type="text/javascript">$(document).ready(function(){toastr["success"]("Başarıyla veriyi eklediniz.", "Başarılı");});</script>'; echo '<meta http-equiv="refresh" content="1; url=tum-kuponlar">'; } else { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Üzgünüm bir hata oluştu :(", "Başarısız");});</script>'; } } ////Sayfa oluşturma kodları bitiş } ?> <div class="container-fluid"> <div class="row page-title"> <div class="col-sm-6"> <h3>Kupon <?php if($_GET['duzenle']){?>Düzenle<?php } else { ?>Ekle<?php } ?></h3> </div> <div class="col-sm-6"> <nav> <ol class="breadcrumb justify-content-sm-end align-items-center"> <li class="breadcrumb-item"> <a href="/boss/anasayfa.php"> <svg class="svg-color"> <use href="datas/svg/iconly-sprite.svg#Home"></use> </svg> </a> </li> <li class="breadcrumb-item active">Kupon <?php if($_GET['duzenle']){?>Düzenle<?php } else { ?>Ekle<?php } ?></li> </ol> </nav> </div> </div> </div> <div class="container-fluid ecommerce-dashboard"> <div class="row"> <div class="col-12"> <div class="card m-b-30"> <div class="card-body"> <form class="form-horizontal theme-form" action="" method="POST" enctype="multipart/form-data"> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kupon Kodu</label> <div class="col-sm-10"> <input class="form-control" type="text" name="adi" value="<?php echo $sayfam["adi"]; ?>" required> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kupon Tipi</label> <div class="col-sm-10"> <input id="demo-inline-form-radio-3" class="magic-radio" name="tip" value="0" <?php echo $sayfam["tip"] == "0" ? 'checked=""' : null; ?> type="radio"> <label for="demo-inline-form-radio-3">Normal İndirim - TL</label> <input id="demo-inline-form-radio-4" class="magic-radio" name="tip" value="1" <?php echo $sayfam["tip"] == "1" ? 'checked=""' : null; ?> type="radio"> <label for="demo-inline-form-radio-4">Yüzde İndirim %</label> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">İndirim Bedeli</label> <div class="col-sm-10"> <div class="input-group"> <input class="form-control" type="text" name="oran" value="<?php echo $sayfam["oran"]; ?>" required> <span class="input-group-text">Sadece Rakam</span> </div> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Minumun Sepet Limiti</label> <div class="col-sm-10"> <div class="input-group"> <input type="text" class="form-control" value="<?php echo $sayfam["slimit"]; ?>" name="slimit"> <span class="input-group-text"> TL</span> </div> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Stok</label> <div class="col-sm-10"> <input type="text" class="form-control" value="<?php echo $sayfam["stok"]; ?>" name="stok"> </div> </div> <?php if ($_GET["duzenle"]) { ?> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Durumu</label> <div class="col-sm-10"> <input type="checkbox" <?php if ($sayfam["durum"] == "1") { ?> checked="" <?php } ?> value="1" data-toggle="toggle" data-onstyle="primary" data-offstyle="secondary" name="durum"> </div> </div> <?php } else { ?> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Durumu</label> <div class="col-sm-10"> <input type="checkbox" checked="" value="1" data-toggle="toggle" data-onstyle="primary" data-offstyle="secondary" name="durum"> </div> </div> <?php } ?> <?php if($_GET['duzenle']){?> <button type="submit" name="guncelle" class="btn btn-warning btn-lg btn-block waves-effect waves-light" style="width: 100%; margin-block-start: 15px;">Güncelle</button> <?php } else { ?> <button type="submit" name="kaydet" class="btn btn-primary btn-lg btn-block waves-effect waves-light" style="width: 100%; margin-block-start: 15px;">Kaydet</button> <?php } ?> </form> </div> </div> </div> </div> </div>
💾 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