📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
b2be-ticaretscripti.demodesign.com.tr
/
boss
/
pages
📝
bayiekle.php
← Geri Dön
<?php if ($_GET['duzenle']) { $id = temizle($_GET['duzenle']); $ekresimid = temizle($_GET['duzenle']); $sayfam = $ozy->query("select * from users where id=$id")->fetch(PDO::FETCH_ASSOC); ///Sayfa güncelleme kodları başlangıç if (isset($_POST['guncelle'])) { $isim = temizle($_POST['isim']); $email = temizle($_POST['email']); $telefon = temizle($_POST['telefon']); $sifre = md5($_POST['sifre']); $onay = temizle($_POST['onay']); $tarih = date('d.m.Y H:i:s'); $uyetip = temizle($_POST['uyetip']); $tc = temizle($_POST['tc']); $vergi1 = temizle($_POST['vergi1']); $vergi2 = temizle($_POST['vergi2']); $vergi3 = temizle($_POST['vergi3']); $sifretip = temizle($_POST['sifretip']); $bayi = "1"; $bayigrup = temizle($_POST['bayigrup']); if ($sifretip == '1') { $id = $_GET['duzenle']; $stmt = $ozy->prepare("UPDATE users SET isim = ?, email = ?, telefon = ?, onay = ?, tarih = ?, uyetip = ?, tc = ?, vergi1 = ?, vergi2 = ?, vergi3 = ?, sifre = ?, bayi = ?, bayigrup = ? WHERE id = ?"); $result2 = $stmt->execute([$isim, $email, $telefon, $onay, $tarih, $uyetip, $tc, $vergi1, $vergi2, $vergi3, $sifre, $bayi, $bayigrup, $id]); if ($result2) { echo '<script type="text/javascript">$(document).ready(function(){toastr["success"]("Başarıyla veriyi ve şifreyi güncellediniz.", "Başarılı");});</script>'; echo '<meta http-equiv="refresh" content="1; url=' . $url . '/boss/bayi/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 users SET isim = ?, email = ?, telefon = ?, onay = ?, tarih = ?, uyetip = ?, tc = ?, vergi1 = ?, vergi2 = ?, vergi3 = ?, bayi = ?, bayigrup = ? WHERE id = ?"); $result2 = $stmt->execute([$isim, $email, $telefon, $onay, $tarih, $uyetip, $tc, $vergi1, $vergi2, $vergi3, $bayi, $bayigrup, $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/bayi/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'])) { $isim = temizle($_POST['isim']); $email = temizle($_POST['email']); $telefon = temizle($_POST['telefon']); $sifre = md5($_POST['sifre']); $onay = temizle($_POST['onay']); $tarih = date('d.m.Y H:i:s'); $uyetip = temizle($_POST['uyetip']); $tc = temizle($_POST['tc']); $vergi1 = temizle($_POST['vergi1']); $vergi2 = temizle($_POST['vergi2']); $vergi3 = temizle($_POST['vergi3']); $bayi = "1"; $bayigrup = temizle($_POST['bayigrup']); $emailkontrol = $ozy->prepare("SELECT * FROM users WHERE email=?"); $emailkontrol->execute([$email]); if ($emailkontrol->rowCount()) { echo '<script type="text/javascript">$(document).ready(function(){toastr["error"]("Üzgünüm bu eposta hesabı ile daha önce kayıt oluşturulmuş.", "Başarısız");});</script>'; } else { $stmt = $ozy->prepare("INSERT INTO users (isim, email, telefon, sifre, onay, tarih, sozlesme, uyetip, tc, vergi1, vergi2, vergi3, bayi, bayigrup) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $result2 = $stmt->execute([$isim, $email, $telefon, $sifre, $onay, $tarih, 1, $uyetip, $tc, $vergi1, $vergi2, $vergi3, $bayi, $bayigrup]); $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-bayiler">'; } 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>Bayi <?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">Bayi <?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">Bayi Adı Soyadı</label> <div class="col-sm-10"> <input class="form-control" type="text" name="isim" value="<?php echo $sayfam["isim"]; ?>" required> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Bayilik Grubu</label> <div class="col-sm-10"> <select class="form-control" name="bayigrup" required> <option value="0">Seçiniz</option> <?php $marka = $ozy->query("select * from bayigrup")->fetchAll(PDO::FETCH_ASSOC); foreach ($marka as $markam) { ?> <option value="<?php echo $markam["id"]; ?>" <?php if ($markam["id"] == $sayfam["marka"]) { ?> selected="selected" <?php } ?>><?php echo $markam["adi"]; ?>(İndirim Oranı : %<?php echo $markam["oran"]; ?>)</option> <?php } ?> </select> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Eposta Adresi</label> <div class="col-sm-10"> <input class="form-control" type="text" name="email" value="<?php echo $sayfam["email"]; ?>" required> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Telefon Numarası</label> <div class="col-sm-10"> <input class="form-control" type="text" name="telefon" value="<?php echo $sayfam["telefon"]; ?>" required> </div> </div> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Üyelik Tipi</label> <div class="col-sm-10"> <input <?php echo $sayfam["uyetip"] == "0" ? "checked" : null; ?> value="0" name="uyetip" type="radio" class="login-check" id="register-check-20" required> Bireysel <input <?php echo $sayfam["uyetip"] == "1" ? "checked" : null; ?> value="1" name="uyetip" type="radio" class="login-check" id="register-check-20" required>Kurumsal </div> </div> <div class="form-group row mb-3" id="bireysel"> <label for="example-text-input" class="col-sm-2 form-label">TC. Numarası</label> <div class="col-sm-10"> <input class="form-control" type="text" name="tc" size="11" maxlength="11" value="<?php echo $sayfam["tc"]; ?>"> </div> </div> <div class="form-group row mb-3" id="kurumsal" style="<?php echo $sayfam["uyetip"] == "1" ? "display:block !important;" : null; ?>display:none;"> <label for="example-text-input" class="col-sm-2 form-label">Firma Adı</label> <div class="col-sm-10"> <input class="form-control" type="text" name="vergi1" value="<?php echo $sayfam["vergi1"]; ?>"> </div> </div> <div class="form-group row mb-3" id="kurumsal2" style="<?php echo $sayfam["uyetip"] == "1" ? "display:block !important;" : null; ?>display:none;"> <label for="example-text-input" class="col-sm-2 form-label">Vergi Dairesi Adı</label> <div class="col-sm-10"> <input class="form-control" type="text" name="vergi2" value="<?php echo $sayfam["vergi2"]; ?>"> </div> </div> <div class="form-group row mb-3" id="kurumsal3" style="<?php echo $sayfam["uyetip"] == "1" ? "display:block !important;" : null; ?>display:none;"> <label for="example-text-input" class="col-sm-2 form-label">Vergi No</label> <div class="col-sm-10"> <input class="form-control" type="text" name="vergi3" value="<?php echo $sayfam["vergi3"]; ?>"> </div> </div> <?php if ($_GET["duzenle"]) { ?> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Şifre Yenileme</label> <div class="col-sm-10"> <input <?php echo $sayfam["sifretip"] == "0" ? "checked" : null; ?> value="1" name="sifretip" type="radio" class="login-check" id="register-check-20"> Şifreyi Güncellemek istiyorum </div> </div> <div class="form-group row mb-3" id="sifre1" style="display:none;"> <label for="example-text-input" class="col-sm-2 form-label">Yeni Şifreniz</label> <div class="col-sm-10"> <input class="form-control" type="password" name="sifre" value="<?php echo $sayfam["sifre"]; ?>"> </div> </div> <?php } else { ?> <div class="form-group row mb-3"> <label for="example-text-input" class="col-sm-2 form-label">Şifresi</label> <div class="col-sm-10"> <input class="form-control" type="password" name="sifre" value="<?php echo $sayfam["sifre"]; ?>"> </div> </div> <?php } ?> <?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["onay"] == "1") { ?> checked="" <?php } ?> value="1" data-toggle="toggle" data-onstyle="primary" data-offstyle="secondary" name="onay"> </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="onay"> </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