📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
esnafbul.demodesign.com.tr
📝
uyefirma.php
← Geri Dön
<?php include "includes/header.php"; $blog_id = $_GET['ser_id']; $blog_cek = $db->prepare("select * from uyefirma where id=:id and uye_id=:uye_id"); $blog_cek->execute(array( 'id' => $blog_id, 'uye_id' => $uyecek['id'] )); $row = $blog_cek->fetch(PDO::FETCH_ASSOC); ?> <?php if($blog_cek->rowCount() == 0) { header("Location:$ayar[site_url]"); exit; } ?> <?php if(empty($_SESSION['oturum'])) { header("Location:giris"); } ?> <title><?=$row['firmaismi']?> | <?php echo $ayar['site_baslik']?></title> <div class="section-space--sm bg-primary-5p"> <div class="container"> <div class="row justify-content-center"> <div class="col-xl-10 col-xxl-8"> <div class="p-4 p-sm-6 p-md-10 bg-neutral-0 rounded-4"> <div class="accordion property-accordion"> <div class="accordion-item"> <h3 class="accordion-header"> <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#addProperty" aria-expanded="true"> Firma Düzenle </button> </h3> <div id="addProperty" class="accordion-collapse collapse show"> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="uye_id" value="<?=$uyecek['id']?>"> <div class="accordion-body"> <div class="pt-6"> <p class="mt-6 mb-4 fs-20 fw-medium"> Firma Adı: </p> <input type="text" class="form-control form-control-lg fs-16" placeholder="Firmanın İsmi" name="firmaismi" value="<?=$row['firmaismi']?>"> <p class="mt-6 mb-4 fs-20 fw-medium"> Sektör </p> <select class="form-select form-select-lg fs-16" name="sektor"> <option selected value="0">Seçim Yapınız</option> <?php $refsor=$db->prepare("select * from proje_kat where durum='1' and dil='$_SESSION[dil]' order by sira ASC"); $refsor->execute(); while ($ser=$refsor->fetch(PDO::FETCH_ASSOC)) { ?> <option value="<?php echo $ser['id'] ?>" <?php if ($ser['id'] == $row['sektor']) {?> selected <?php }?>><?php echo $ser['baslik'] ?></option> <?php } ?> </select> <p class="mt-6 mb-4 fs-20 fw-medium"> İl: </p> <select class="form-select form-select-lg fs-16" name="il" id="il"> <option selected value="0">Seçim Yapınız</option> <?php $sehir = $db->prepare("select * from iller order by id asc"); $sehir->execute(); foreach ($sehir as $ilsen) {?> <option value="<?=$ilsen['id']?>" <?php if ($ilsen['id'] == $row['il']) {?> selected <?php }?>><?=$ilsen['name']?></option> <?php }?> </select> <p class="mt-6 mb-4 fs-20 fw-medium"> İlçe: </p> <select name="ilce" id="ilce" class="form-select form-select-lg fs-16" required> <?php $sehir = $db->prepare("select * from ilceler order by id asc"); $sehir->execute(); foreach ($sehir as $ilsen) {?> <option value="<?=$ilsen['id']?>" <?php if ($ilsen['id'] == $row['ilce']) {?> selected <?php }?>><?=$ilsen['ilce_adi']?></option> <?php }?> </select> <p class="mt-6 mb-4 fs-20 fw-medium"> Yetkili Adı Soyadı: </p> <input type="text" class="form-control form-control-lg fs-16" placeholder="Yetkili Adı Soyadı" name="isim" value="<?=$row['isim']?>"> <p class="mt-6 mb-4 fs-20 fw-medium"> Yetkili Cep Telefonu: </p> <input type="text" class="form-control form-control-lg fs-16" placeholder="Yetkili Cep Telefonu" name="tel" value="<?=$row['tel']?>"> <p class="mt-6 mb-4 fs-20 fw-medium"> Firma Email Adresi: </p> <input type="text" class="form-control form-control-lg fs-16" placeholder="Firma Email Adresi" name="mail" value="<?=$row['mail']?>"> <p class="mt-6 mb-4 fs-20 fw-medium"> Firma Logosu: </p> <?php if ($row['gorsel'] == NULL || $row['gorsel'] == ""){?> <img style="width: 250px" src="images/resimyok.png"> <?php } else {?> <img style="width: 250px" src="images/firmalogo/<?php echo $row['gorsel'] ?>"> <?php }?> <div class="d-flex align-items-center justify-content-center border-dashed rounded-4 w-100"> <label for="dropzone-file" class="d-flex flex-column align-items-center justify-content-center w-100 cursor-pointer bg-primary-3p rounded-4"> <span class="d-flex flex-column align-items-center justify-content-center py-12"> <span class="material-symbols-outlined mat-icon fs-60 fw-200 clr-neutral-500"> cloud_upload </span> <span class="d-inline-block py-3 px-6 rounded-pill bg-neutral-600 clr-neutral-0 mb-10"> Logo Yükle </span> <span class="d-flex align-items-center justify-content-center flex-wrap gap-5"> </span> </span> <input name="gorsel" type="file" id="dropzone-file" class="d-none"> </label> </div> <p class="mt-6 mb-4 fs-20 fw-medium"> Adres : </p> <textarea rows="5" class="form-control" placeholder="Firma Adresi.." name="adres"><?=$row['adres']?></textarea> <p class="mt-6 mb-4 fs-20 fw-medium"> Google Map Kodu : </p> <textarea rows="5" class="form-control" placeholder="Google Map Kodu.." name="harita"><?=$row['harita']?></textarea> <p class="mt-6 mb-4 fs-20 fw-medium"> Firmanız Hakkında Yazı : </p> <textarea rows="5" class="form-control" placeholder="Firmanız Hakkında Yazı.." name="hakkinda"><?=$row['hakkinda']?></textarea> <p class="mt-6 mb-4 fs-20 fw-medium"> Anahtar Kelimeler : </p> <input type="text" class="form-control form-control-lg fs-16" data-role="tagsinput" placeholder="Anahtar Kelimeler" name="anahtar" value="<?=$row['anahtar']?>"> <button style="margin-top: 30px" name="firmaguncelle" class="link d-inline-flex align-items-center gap-2 py-3 px-6 rounded-pill bg-primary-300 clr-neutral-0 :bg-primary-400 :clr-neutral-0 fw-semibold" type="submit">Güncelle</button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> </div> <script src="uyari/jquerymin.js"></script> <link rel="stylesheet" href="uyari/sweetalert2.min.css"> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.18/dist/sweetalert2.all.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#il").change( function(){ var ilid = $(this).val(); $.ajax({ type:"POST", url:"ajax.php", data:{"il":ilid}, success:function(e) { $("#ilce").show(); $("#ilce").html(e); } }); }) }); </script> <?php if (isset($_POST['firmaguncelle'])) { if ($_FILES['gorsel']["size"] > 0) { $dosyas = $_FILES["gorsel"]; $kaynak = $_FILES["gorsel"]["tmp_name"]; $dosya = $_FILES["gorsel"]["name"]; $uzanti = explode(".", $_FILES['gorsel']['name']); $random = rand(0, 9999999999999); $random2 = rand(0, 999); $yeni_isim = $random . "-" . $random2 . "-" . $dosya; $hedef = "images/firmalogo/" . $yeni_isim; if ($dosyas['type'] == 'image/jpg' || $dosyas['type'] == 'image/jpeg' || $dosyas['type'] == 'image/png') { $gitti = move_uploaded_file($kaynak, $hedef); $kaydet = $db->prepare("UPDATE uyefirma SET firmaismi=:firmaismi, sektor=:sektor, il=:il, ilce=:ilce, isim=:isim, tel=:tel, mail=:mail, adres=:adres, harita=:harita, hakkinda=:hakkinda, anahtar=:anahtar, gorsel=:gorsel WHERE id={$blog_id} "); $ekle = $kaydet->execute(array( 'firmaismi' => trim(strip_tags($_POST['firmaismi'])), 'sektor' => trim(strip_tags($_POST['sektor'])), 'il' => trim(strip_tags($_POST['il'])), 'ilce' => trim(strip_tags($_POST['ilce'])), 'isim' => trim(strip_tags($_POST['isim'])), 'tel' => trim(strip_tags($_POST['tel'])), 'mail' => trim(strip_tags($_POST['mail'])), 'adres' => trim(strip_tags($_POST['adres'])), 'harita' => trim(strip_tags($_POST['harita'])), 'hakkinda' => trim(strip_tags($_POST['hakkinda'])), 'anahtar' => trim(strip_tags($_POST['anahtar'])), 'gorsel' => $yeni_isim )); if ($ekle) { echo "<script type='text/javascript'>$(document).ready(function(){Swal.fire({ position: 'middle-center', icon: 'success', title: 'Firma Başarıyla Güncellenmiştir.', showConfirmButton: false, timer: 2000 })});</script>"; header("Refresh: 2; url=$ayar[site_url]uyefirmalar"); } else { echo "<script type='text/javascript'>$(document).ready(function(){Swal.fire({ position: 'middle-center', icon: 'warning', title: 'Birşeyler Ters Gitti', showConfirmButton: false, timer: 2000 })});</script>"; header("Refresh: 2; url=$ayar[site_url]uyefirmalar"); } } else { echo "<script type='text/javascript'>$(document).ready(function(){Swal.fire({ position: 'middle-center', icon: 'warning', title: 'Resim Türünü jpg,png türünde yükleyiniz.', showConfirmButton: false, timer: 2000 })});</script>"; header("Refresh: 2; url=$ayar[site_url]uyefirmalar"); } } else { $kaydet = $db->prepare("UPDATE uyefirma SET firmaismi=:firmaismi, sektor=:sektor, il=:il, ilce=:ilce, isim=:isim, tel=:tel, mail=:mail, adres=:adres, harita=:harita, hakkinda=:hakkinda, anahtar=:anahtar WHERE id={$blog_id} "); $ekle = $kaydet->execute(array( 'firmaismi' => trim(strip_tags($_POST['firmaismi'])), 'sektor' => trim(strip_tags($_POST['sektor'])), 'il' => trim(strip_tags($_POST['il'])), 'ilce' => trim(strip_tags($_POST['ilce'])), 'isim' => trim(strip_tags($_POST['isim'])), 'tel' => trim(strip_tags($_POST['tel'])), 'mail' => trim(strip_tags($_POST['mail'])), 'adres' => trim(strip_tags($_POST['adres'])), 'harita' => trim(strip_tags($_POST['harita'])), 'hakkinda' => trim(strip_tags($_POST['hakkinda'])), 'anahtar' => trim(strip_tags($_POST['anahtar'])) )); if ($ekle) { echo "<script type='text/javascript'>$(document).ready(function(){Swal.fire({ position: 'middle-center', icon: 'success', title: 'Firma Başarıyla Güncellenmiştir.', showConfirmButton: false, timer: 2000 })});</script>"; header("Refresh: 2; url=$ayar[site_url]uyefirmalar"); } else { echo "<script type='text/javascript'>$(document).ready(function(){Swal.fire({ position: 'middle-center', icon: 'warning', title: 'Birşeyler Ters Gitti', showConfirmButton: false, timer: 2000 })});</script>"; header("Refresh: 2; url=$ayar[site_url]uyefirmalar"); } } } ?> <?php include "includes/footer.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