📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
turscripti.demodesign.com.tr
/
~yonetim
/
~sayfalar
📝
sliderekle.php
← Geri Dön
<?php if($_GET['duzenle']){ $id = hepmax_guard($_GET['duzenle']); $ekresimid = hepmax_guard($_GET['duzenle']); $sayfam = $hepmaxdb->query("select * from slider where id=$id")->fetch(PDO::FETCH_ASSOC); ///Sayfa güncelleme kodları başlangıç if (isset($_POST['guncelle'])) { $adi = hepmax_guard($_POST['adi']); $butonadi = hepmax_guard($_POST['butonadi']); $aciklama = $_POST['aciklama']; $link = $_POST['link']; $hit = "0"; $durum = hepmax_guard($_POST['durum']); $sira = hepmax_guard($_POST['sira']); $tarih = date('d.m.Y H:i:s'); $restip = $_FILES['resim']['type']; $uzanti = substr($resad, -5,5); if(!empty($_FILES['resim']['name'])){ $temp = $_FILES['resim']['tmp_name']; $genelad = $_FILES['resim']['name']; $tip = $_FILES['resim']['type']; $uzanti = substr($genelad, -5, 5); $resim = md5(uniqid(rand(time($genelad)))) . $uzanti; $resimyol = "../resimler/slider"; $yuklendi = move_uploaded_file($temp, $resimyol . '/' . $resim); }else { $resim = $sayfam['resim']; } $id = $_GET['duzenle']; $stmt = $hepmaxdb->prepare("UPDATE slider SET adi = ?, butonadi = ?, aciklama = ?, link = ?, durum = ?, sira = ?, resim = ? WHERE id = ?"); $result2 = $stmt->execute(array($adi, $butonadi, $aciklama, $link, $durum, $sira, $resim, $id)); if($result2){ echo sky_alert('success',"Slider Güncellendi"); echo '<meta http-equiv="refresh" content="1">'; }else{ echo sky_alert('danger',"Bilinmeyen bir hata oluştu!"); } } } ////Sayfa güncelleme kodları bitiş else{ if (isset($_POST['kaydet'])) { $adi = hepmax_guard($_POST['adi']); $butonadi = hepmax_guard($_POST['butonadi']); $aciklama = $_POST['aciklama']; $link = $_POST['link']; $hit = "0"; $durum = hepmax_guard($_POST['durum']); $sira = hepmax_guard($_POST['sira']); $tarih = date('d.m.Y H:i:s'); $restip = $_FILES['resim']['type']; $uzanti = substr($resad, -5,5); if(!empty($_FILES['resim']['name'])){ $temp = $_FILES['resim']['tmp_name']; $genelad = $_FILES['resim']['name']; $tip = $_FILES['resim']['type']; $uzanti = substr($genelad, -5, 5); $resim = md5(uniqid(rand(time($genelad)))) . $uzanti; $resimyol = "../resimler/slider"; $yuklendi = move_uploaded_file($temp, $resimyol . '/' . $resim); }else { $resim = ""; } $stmt = $hepmaxdb->prepare("INSERT INTO slider (adi, butonadi, aciklama, link, durum, sira, tarih, resim) VALUES (?,?,?,?,?,?,?,?)"); $result2 = $stmt->execute(array($adi,$butonadi, $aciklama, $link, $durum, $sira, $tarih, $resim)); $id = $hepmaxdb->lastInsertId(); if($result2){ echo sky_alert('success',"Slider Eklendi"); echo '<meta http-equiv="refresh" content="1; url=index.php?sayfa=sliderekle&duzenle='.$id.'">'; }else{ echo sky_alert('danger',"Bilinmeyen bir hata oluştu!"); } } } ?> <style> .resimonizleme{ height : auto; width: 100%; float:right; } </style> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <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">Slider <?php if($_GET['duzenle']){?> Düzenle <?php } else { ?> Ekle <?php } ?> </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">Slider <?php if($_GET['duzenle']){?> Düzenle <?php } else { ?> Ekle <?php } ?> </li> </ol> </div> </div> <!-- end row --> </div> <div class="row"> <div class="col-12"> <form class="form-horizontal" action="" method="POST" enctype="multipart/form-data"> <div class="card m-b-30"> <div class="card-body"> <div class="tab-content"> <div class="tab-pane active p-3" id="home-1" role="tabpanel"> <div class="form-group row"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider Linki</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"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider 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"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider 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"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider Buton Adı ( Slider üzerindeki buton ismi )</label> <div class="col-sm-10"> <input class="form-control" type="text" name="butonadi" value="<?php echo $sayfam['butonadi']; ?>" required> </div> </div> <div class="form-group row"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider Açıklama</label> <div class="col-sm-10"> <input class="form-control" type="text" name="aciklama" value="<?php echo $sayfam['aciklama']; ?>" required> </div> </div> <div class="form-group row"> <label for="example-text-input" class="col-sm-2 col-form-label">Slider Resmi</label> <div class="col-sm-10"> <?php if($_GET['duzenle']){?> <div class="form-group"> <img class="resimonizleme" id="resim1" src="../resimler/slider/<?php echo $sayfam['resim']; ?>" alt="" /> <div class="controls"> <input class="resimgoster" type="file" set-to="resim1" name="resim"> </div> </div> <?php } else { ?> <div class="form-group"> <img class="resimonizleme" id="resim1" src="" alt="" /> <div class="controls"> <input class="resimgoster" type="file" set-to="resim1" name="resim"> </div> </div> <?php }?> </div> </div> <?php if($_GET['duzenle']){?> <div class="form-group row"> <label for="example-text-input" class="col-sm-2 col-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"> <label for="example-text-input" class="col-sm-2 col-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> </div> <?php if($_GET['duzenle']){?> <button type="submit" name="guncelle" class="btn btn-warning btn-lg btn-block waves-effect waves-light">Güncelle</button> <?php } else { ?> <button type="submit" name="kaydet" class="btn btn-primary btn-lg btn-block waves-effect waves-light">Kaydet</button> <?php } ?> </div> </div> </form> </div> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- end container-fluid --> </div> <script src="plugins/jquery/jquery.min.js"></script> <script type="text/javascript"> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); var div_id = $(input).attr('set-to'); reader.onload = function (e) { $('#'+div_id).attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $(".resimgoster").change(function(){ readURL(this); }); </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