ajax ile while |
10 Mesajlar | 2.293 Okunma |
$(document).on('click', '#id-maydi-falan', function(){
// code mod falan
});
script type="text/javascript">
$(document).ready(function(){
$(".ekle").on("click", function(){ // buton idli elemana tıklandığında
var sepetal = $("#sepetal").serialize(); // idsi gonderilenform olan formun içindeki tüm elemanları serileştirdi ve gonderilenform adlı değişken oluşturarak içine attı
$.ajax({
url:'admin/baglan/islem.php', // serileştirilen değerleri ajax.php dosyasına
type:'POST', // post metodu ile
data:sepetal, // yukarıda serileştirdiğimiz gonderilenform değişkeni
success:function(e){
alert(e);
}
});
});
});
$urunsor=$db->prepare("SELECT * FROM urun where urun_durum=:urun_durum and urun_stok=:urun_stok and menu_id=:menu_id");
$urunsor->execute(array(
'urun_durum' => 1,
'urun_stok' =>1,
'menu_id' =>$menucek['menu_id']
));
while ($uruncek=$urunsor->fetch(PDO::FETCH_ASSOC)) {?>
$urun_id=$uruncek['urun_id'];
$urunfotosor=$db->prepare("SELECT * FROM urunfoto where urun_id=:urun_id order by urunfoto_id ASC limit 1 ");
$urunfotosor->execute(array(
'urun_id' => $urun_id
));
$urunfotocek=$urunfotosor->fetch(PDO::FETCH_ASSOC);
?>
$kullanicisor=$db->prepare("SELECT * FROM kullanici where kullanici_mail=:kullanici_mail ");
$kullanicisor->execute(array(
'kullanici_mail' => $_SESSION['kullanici_mail']
));
$say=$kullanicisor->rowCount();
$kullanicicek=$kullanicisor->fetch(PDO::FETCH_ASSOC);
if ($say==0) { ?>
burasını çekıyorum -------------------------------
$(document).on('click', '#id-maydi-falan', function(){
// code mod falan
});
else { ?