<?php $grupx = DB::get("SELECT * FROM kullanicilar # WHERE sart='2' "); foreach($grupx as $kullanicilar_liste) { ?> <tr> <td><?php echo $kullanicilar_liste->kullanici_ad;?></td> <td><?php echo $kullanicilar_liste->kullanici_soyad;?></td> <td><?php $kullanici_gruppc_goruntule = DB::getRow("SELECT * FROM grupx WHERE gruppc_id = '$kullanicilar_liste->gruppc' ");?> <?php if ($kullanici_gruppc_goruntule->gruppc_adi == "") { ?> Grup Seçilmedi <?php } else { ?> <?php echo $kullanici_gruppc_goruntule->gruppc_adi; ?> <?php } ?> </td> <td> <?php if ($kullanicilar_liste->grupv == "1") { ?> Genel grupv () <?php } ?> <?php if ($kullanicilar_liste->grupv == "2") { ?> Grup İçin grupv () <?php } ?> <?php if ($kullanicilar_liste->grupv == "3") { ?> Genel <?php } ?>
</td> <td><?php echo $kullanicilar_liste->kullanici_email;?></td> <td><?php echo $kullanicilar_liste->telefon;?></td>
<td>
<div class="modal fade" id="kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id;?>" tabindex="-1" role="dialog" aria-labelledby="kullanici_duzenle__<?php echo $kullanicilar_liste->kullanici_id;?>" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header text-center"> <h4 class="modal-title w-100 font-weight"><?php echo $kullanicilar_liste->kullanici_ad;?> <b><?php echo $kullanicilar_liste->kullanici_soyad;?></b> kullanıcısını düzenle</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> </button> </div> <form id="kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id; ?>"> <div class="modal-body mx-3"> <div class="md-form mb-5"> <i class="fas fa-user prefix grey-text"></i> <input type="text" id="kullanici_ad" class="form-control validate" name="kullanici_ad" value="<?php echo $kullanicilar_liste->kullanici_ad;?>"> <label data-error="-" data-success="+" for="kullanici_ad">Ad</label> </div> <div class="md-form mb-5"> <i class="fas fa-user prefix grey-text"></i> <input type="text" id="kullanici_soyad" class="form-control validate" name="kullanici_soyad" value="<?php echo $kullanicilar_liste->kullanici_soyad;?>"> <label data-error="-" data-success="+" for="kullanici_soyad">Soyad</label> </div> <div class="md-form mb-5"> <i class="fas fa-mobile prefix grey-text"></i> <input type="number" id="telefon" placeholder="ÖR: 5554443322" class="form-control validate" name="telefon" value="<?php echo $kullanicilar_liste->telefon;?>"> <label data-error="-" data-success="+" for="telefon">Telefon</label> </div>
<select class="browser-default custom-select" name="cinsiyet" id="cinsiyet"> <option selected>Cinsiyet</option> <option value="e" <?php if ($kullanicilar_liste->cinsiyet == "e") { ?> selected="selected" <?php } ?>> Erkek </option> <option value="k" <?php if ($kullanicilar_liste->cinsiyet == "k") { ?> selected="selected" <?php } ?>> Bayan </option> </select> <div class="md-form mb-5"> <i class="fas fa-envelope prefix grey-text"></i> <input type="email" id="kullanici_email" class="form-control validate" name="kullanici_email" value="<?php echo $kullanicilar_liste->kullanici_email;?>"> <label data-error="Hatalı " data-success="Doğru" for="kullanici_email">E-mail</label> </div> <select class="browser-default custom-select" name="grupv" > <option disabled="">grupv seçiniz</option> <option value="1" <?php if ($kullanicilar_liste->grupv == "1") { ?> selected="selected" <?php } ?>> Genel grupv (Yönetici) </option> <option value="2" <?php if ($kullanicilar_liste->grupv == "2") { ?> selected="selected" <?php } ?>> Grup İçin grupv () </option> <option value="3" <?php if ($kullanicilar_liste->grupv == "3") { ?> selected="selected" <?php } ?>> Genel İzleyici </option> </select> <br> <select class="browser-default custom-select" name="gruppc" > <option selected>Grup</option> <?php $kullanici_ekle_sorgula = DB::get("SELECT * FROM grupx"); foreach($kullanici_ekle_sorgula as $kullanici_ekle_veriler) { ?> <option value="<?php echo $kullanici_ekle_veriler->gruppc_id; ?>"><?php echo $kullanici_ekle_veriler->gruppc_adi; ?></option> <?php } ?> </select> </div> <div class="modal-footer d-flex justify-content-center"> <button id="kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id; ?>" class="btn aqua-gradient btn-rounded waves-effect waves-light"><i class="fas fa-save mr-2"></i> Güncelle</button>
</form> </div> </div> </div> </div>
<div id="kullanici_duzenle_ok"></div> <div id="kullanici_duzenle_no"></div> <script> $(document).on("submit", "#kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id; ?>", function(event){ event.preventDefault(); $.ajax({ url: "ajax/kullanici_duzenle.php", type: "POST", data: { kullanici_id: "<?php echo $kullanicilar_liste->kullanici_id; ?>", kullanici_ad: document.getElementById('kullanici_ad'), kullanici_soyad : document.getElementById('kullanici_soyad'), cinsiyet: document.getElementById('cinsiyet'), telefon: document.getElementById('telefon'), kullanici_email: document.getElementById('kullanici_email'), grupv: document.getElementById('grupv'), gruppc: document.getElementById('gruppc') },
contentType: false, cache: false, processData:false, error: function(xhr, status, error) { $("#kullanici_duzenle_no").empty().append(status); $("#kullanici_duzenle_no").append(xhr.responseText); }, success: function(results) { $("#kullanici_duzenle_no").empty(); $("#kullanici_duzenle_ok").empty().append(results); } }); }); </script> <a class="btn blue-gradient btn-sm waves-effect waves-light" data-toggle="modal" data-target="#kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id;?>"><i class="fas fa-edit"></i></a>
</td>
<td> <a onclick="kullaniciSil<?php echo $kullanicilar_liste->kullanici_id;?>()" class="btn peach-gradient btn-sm waves-effect waves-light"><i class="fas fa-trash"></i></a> </td> </tr>
<?php } ?>php dosyam
js kodlarım
<script> $(document).on("submit", "#kullanici_duzenle_<?php echo $kullanicilar_liste->kullanici_id; ?>", function(event){ event.preventDefault(); $.ajax({ url: "ajax/kullanici_duzenle.php", type: "POST", data: { kullanici_id: "<?php echo $kullanicilar_liste->kullanici_id; ?>", kullanici_ad: document.getElementById('kullanici_ad'), kullanici_soyad : document.getElementById('kullanici_soyad'), cinsiyet: document.getElementById('cinsiyet'), telefon: document.getElementById('telefon'), kullanici_email: document.getElementById('kullanici_email'), grupv: document.getElementById('grupv'), gruppc: document.getElementById('gruppc') },
contentType: false, cache: false, processData:false, error: function(xhr, status, error) { $("#kullanici_duzenle_no").empty().append(status); $("#kullanici_duzenle_no").append(xhr.responseText); }, success: function(results) { $("#kullanici_duzenle_no").empty(); $("#kullanici_duzenle_ok").empty().append(results); } }); }); </script>kullanici_id yi ajax.php dosyama gönderemedim bir türlü normal form gidiyor ama id gönderemiyorum yardımcı olabilirseniz data: kısmını nasıl yapacğım konusunda çok sevinirim. şimdiden ilgilenenlere çok teşekkür ediyorum