📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
b2be-ticaretscripti.demodesign.com.tr
/
boss
/
pages
📝
kampanyaekle.php
← Geri Dön
<?php if ($_GET['duzenle']) { $id = temizle($_GET['duzenle']); $ekresimid = temizle($_GET['duzenle']); $sayfam = $ozy->query("select * from kampanyalar where id=$id")->fetch(PDO::FETCH_ASSOC); ///Sayfa güncelleme kodları başlangıç if (isset($_POST['guncelle'])) { $adi = temizle($_POST['adi']); $aciklama = $_POST['aciklama']; if ($_POST['seo'] == '') { $seo = "" . seo($adi) . "-" . $id . ""; } else { $seo = seo($_POST['seo']); } $hit = "0"; $durum = temizle($_POST['durum']); $sira = temizle($_POST['sira']); $seodurum = temizle($_POST['seodurum']); $stitle = temizle($_POST['stitle']); $skey = temizle($_POST['skey']); $sdesc = temizle($_POST['sdesc']); $tarih = date('d.m.Y H:i:s'); $link = $_POST['link'] != "" ? $_POST['link'] : "0"; $reskonum = $_FILES['resim']['tmp_name']; $resad = $_FILES['resim']['name']; $restip = $_FILES['resim']['type']; $uzanti = substr($resad, -5, 5); $resimadi = md5(uniqid(rand(time($resad)))) . $uzanti; $yol = "../resimler/kampanyalar"; if (!empty($_FILES['resim']['name'])) { if ($restip != 'image/jpeg' && $restip != 'image/png' && $uzanti != '.jpg' && $uzanti != '.png' && $uzanti != '.jpeg') { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Lütfen ! Jpg ve Png uzantılı resim yükleyiniz ....", "Başarısız");});</script>'; } else { $ekle = move_uploaded_file($reskonum, $yol . '/' . $resimadi); $id = $_GET['duzenle']; $stmt = $ozy->prepare("UPDATE kampanyalar SET adi = ?, aciklama = ?, seo = ?, durum = ?, sira = ?, seodurum = ?, stitle = ?, skey = ?, sdesc = ?, resim = ?, link = ? WHERE id = ?"); $result2 = $stmt->execute([$adi, $aciklama, $seo, $durum, $sira, $seodurum, $stitle, $skey, $sdesc, $resimadi, $link, $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/kampanya/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>'; } } } else { $id = $_GET['duzenle']; $stmt = $ozy->prepare("UPDATE kampanyalar SET adi = ?, aciklama = ?, seo = ?, durum = ?, sira = ?, seodurum = ?, stitle = ?, skey = ?, sdesc = ?, link = ? WHERE id = ?"); $result2 = $stmt->execute([$adi, $aciklama, $seo, $durum, $sira, $seodurum, $stitle, $skey, $sdesc, $link, $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/kampanya/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 { $q = $ozy->query("SHOW TABLE STATUS LIKE 'kampanyalar'"); $next = $q->fetch(PDO::FETCH_ASSOC); $ekresimid = $next['Auto_increment']; ////Sayfa oluşturma kodları başlangıç if (isset($_POST['kaydet'])) { $adi = temizle($_POST['adi']); $aciklama = $_POST['aciklama']; if ($_POST['seo'] == '') { $seo = "" . seo($adi) . "-" . $ekresimid . ""; } else { $seo = seo($_POST['seo']); } $hit = "0"; $durum = temizle($_POST['durum']); $sira = temizle($_POST['sira']); $seodurum = temizle($_POST['seodurum']); $stitle = temizle($_POST['stitle']); $skey = temizle($_POST['skey']); $sdesc = temizle($_POST['sdesc']); $tarih = date('d.m.Y H:i:s'); $link = $_POST['link'] != "" ? $_POST['link'] : "0"; $reskonum = $_FILES['resim']['tmp_name']; $resad = $_FILES['resim']['name']; $restip = $_FILES['resim']['type']; $uzanti = substr($resad, -5, 5); $resimadi = md5(uniqid(rand(time($resad)))) . $uzanti; $yol = "../resimler/kampanyalar"; if (empty($_FILES['resim']['name'])) { $resimadi = "resimyok.jpg"; $stmt = $ozy->prepare("INSERT INTO kampanyalar (adi, aciklama, seo, hit, durum, sira, seodurum, stitle, skey, sdesc, tarih, resim, link) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); $result2 = $stmt->execute([$adi, $aciklama, $seo, $hit, $durum, $sira, $seodurum, $stitle, $skey, $sdesc, $tarih, $resimadi, $link]); $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-kampanyalar">'; } else { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Üzgünüm bir hata oluştu :(", "Başarısız");});</script>'; } } else { if ($restip != 'image/jpeg' && $restip != 'image/png' && $uzanti != '.jpg' && $uzanti != '.png' && $uzanti != '.jpeg') { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Lütfen ! Jpg ve Png uzantılı resim yükleyiniz ....", "Başarısız");});</script>'; } else { $ekle = move_uploaded_file($reskonum, $yol . '/' . $resimadi); $stmt = $ozy->prepare("INSERT INTO kampanyalar (adi, aciklama, seo, hit, durum, sira, seodurum, stitle, skey, sdesc, tarih, resim, link) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); $result2 = $stmt->execute([$adi, $aciklama, $seo, $hit, $durum, $sira, $seodurum, $stitle, $skey, $sdesc, $tarih, $resimadi, $link]); $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-kampanyalar">'; } 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>Kampanya <?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">Kampanya <?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"> <ul class="nav nav-pills nav-primary d-flex" id="pills-tab" role="tablist"> <li class="nav-item flex-grow-1 text-center" role="presentation"> <a class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" href="#pills-home" role="tab" aria-controls="pills-home" aria-selected="true">Genel Ayarlar</a> </li> <li class="nav-item flex-grow-1 text-center" role="presentation"> <a class="nav-link" id="pills-message-tab" data-bs-toggle="pill" href="#pills-message" role="tab" aria-controls="pills-message" aria-selected="false" tabindex="-1">Resimler</a> </li> <li class="nav-item flex-grow-1 text-center" role="presentation"> <a class="nav-link" id="pills-profile-tab" data-bs-toggle="pill" href="#pills-profile" role="tab" aria-controls="pills-profile" aria-selected="false" tabindex="-1">Seo Ayarları</a> </li> </ul> <div class="tab-content" id="pills-tabContent" style="margin-block-start: 50px;"> <div class="tab-pane fade active show" id="pills-home" role="tabpanel" aria-labelledby="pills-home-tab"> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kampanya Linki </br>(Boş bırakırsanız otomatik kampanya sayfasına gider)</label> <div class="col-sm-10"> <input class="form-control" type="text" name="link" value="<?php echo $sayfam["link"]; ?>"> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kampanya Seo Linki </br>(Boş bırakırsanız otomatik seo link oluşacaktır)</label> <div class="col-sm-10"> <input class="form-control" type="text" name="seo" value="<?php echo $sayfam["seo"]; ?>"> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kampanya Sırası </br>(En başa almak için en yüksek sayıyı veriniz)</label> <div class="col-sm-10"> <input class="form-control" type="text" name="sira" value="<?php echo $sayfam["sira"]; ?>"> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Kampanya Adı</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">Manşet Resmi</label> <div class="col-sm-10"> <div class="controls"> <div class="fileupload fileupload-new" data-provides="fileupload"> <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div> <div class="fileupload-new thumbnail fileupload-preview thumbnail" style="width: 200px; height: 150px;"> <?php if ($_GET["duzenle"]) { ?> <img src="../resimler/kampanyalar/<?php echo $sayfam["resim"]; ?>" style="width: 200px; height: 200px;" alt="" /> <?php } else { ?> <img src="assets/images/resimyok.jpg" alt="" /> <?php } ?> </div> <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div> <div> <span class="btn btn-default btn-file" style="border: 1px solid #ebeef0;"> <span class="fileupload-new"><i class="fa fa-paper-clip"></i> Resim Seç</span> <span class="fileupload-exists"><i class="fa fa-undo"></i> Değiştir</span> <input name="resim" type="file" class="default" /> </span> <a href="#" class="btn btn-outline-primary waves-effect waves-light" data-dismiss="fileupload"><i class="fa fa-trash"></i> Sil</a> </div> </div> </div> </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 } ?> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Açıklama</label> <div class="col-sm-10"> <textarea id="summernote" rows="6" name="aciklama"><?php echo $sayfam["aciklama"]; ?></textarea> </div> </div> </div> <div class="tab-pane fade" id="pills-profile" role="tabpanel" aria-labelledby="pills-profile-tab"> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Sayfa Özel Titlesi</label> <div class="col-sm-10"> <input class="form-control" type="text" name="stitle" value="<?php echo $sayfam["stitle"]; ?>"> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Sayfa Özel Keyword</label> <div class="col-sm-10"> <input class="form-control" type="text" data-role="tagsinput" name="skey" value="<?php echo $sayfam["skey"]; ?>"> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Sayfa Özel Açıklaması</label> <div class="col-sm-10"> <textarea id="textarea" class="form-control" rows="6" name="sdesc"><?php echo $sayfam["sdesc"]; ?></textarea> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Seo Durumu</label> <div class="col-sm-10"> <input type="checkbox" <?php if ($sayfam["seodurum"] == "1") { ?> checked="" <?php } ?> value="1" data-toggle="toggle" data-onstyle="primary" data-offstyle="secondary" name="seodurum"> </div> </div> </div> <div class="tab-pane fade" id="pills-message" role="tabpanel" aria-labelledby="pills-message-tab"> <div class="form-group row mb-3 mb-3"> <iframe scrolling="no" src="resimyukle.php?id=<?php echo $ekresimid;?>&alan=kampanyalar" style="width:100%;height:1500px;" frameborder="0"></iframe> </div> </div> </div> <?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