<?php
include 'db-ayar.php';
include 'header.php';
if(isset($_POST['arama']))
{
$aranan=$_POST['aranan'];
$menusor=$db->prepare("select * from menuler where menu_ad like '$aranan'");
$menusor->execute();
}
else{
$menusor=$db->prepare("select * from menuler where menu_ust=:menu_ust order by menu_sira asc");
$menusor->execute(array("menu_ust"=>'0'));
//$iceriksor=$db->query("select * from icerik")->fetchAll();
}
?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
</div>
<div class="title_right">
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
<form action="" method="post">
<div class="input-group">
<input type="text" class="form-control" name="aranan" placeholder="Arama...">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" name="arama">Ara</button>
</span>
</div>
</form>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_content table-responsive">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Menu Ust</th>
<th>Menu Ad</th>
<th>Menu Detay</th>
<th>Menu Url</th>
<th>Menu Sira</th>
<th>Menu Durum</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($menusor as $menuCek)
{
$menu_id = $menuCek['menu_id']; ?>
<tr>
<td scope="row"><?php echo $menuCek['menu_id']; ?></td>
<td scope="row"><?php echo $menuCek['menu_ust']; ?></td>
<td scope="row"><?php echo $menuCek['menu_ad']; ?></td>
<td scope="row"><?php echo $menuCek['menu_detay']; ?></td>
<td scope="row"><?php echo $menuCek['menu_url']; ?></td>
<td scope="row"><?php echo $menuCek['menu_sira']; ?></td>
<td scope="row"><?php
if($menuCek['menu_durum']=='1')
{
echo "AKTİF";
}
else{
echo "PASİF";
}
?></td>
<td>
<a href="menu_duzenle.php?menu_id=<?php echo $menuCek['menu_id'];?>"><button type="submit" class="btn btn-success">Güncelle</button></a>
</td>
<td><button class="btn btn-danger" data-toggle="modal" data-target="#modalmenu<?=$menuCek['menu_id']?>"><i class="glyphicon glyphicon-trash"></i> Sil</button></td>
<div class="modal fade" tabindex="-1" role="dialog" id="modalmenu<?=$menuCek['menu_id']?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Silmek İstediğinize Emin Misiniz?</h4>
</div>
<div class="modal-body">
<p>Yapılan silme işlemi geri alınamaz!!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
<a href="menu_sil.php?menu_id=<?php echo $menuCek['menu_id'];?>"><button class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> Sil</button></a>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</tr>
<?php
$altmenuSor=$db->prepare("select * from menuler where menu_ust=:menu_id order by menu_sira asc");
$altmenuSor->execute(array("menu_id"=>$menu_id));
while($altmenucek=$altmenuSor->fetch(PDO::FETCH_ASSOC))
{?>
<tr>
<td scope="row"><?php echo $altmenucek['menu_id']; ?></td>
<td scope="row"><?php echo $altmenucek['menu_ust']; ?></td>
<td scope="row"><b>******</b> <?php echo $altmenucek['menu_ad']; ?></td>
<td scope="row"><?php echo substr($altmenucek['menu_detay'],0,100); ?></td>
<td scope="row"><?php echo $menuCek['menu_url']; ?></td>
<td scope="row"><?php echo $altmenucek['menu_sira']; ?></td>
<td scope="row"><?php
if($altmenucek['menu_durum']=='1')
{
echo "AKTİF";
}
else{
echo "PASİF";
}
?></td>
<td>
<a href="menu_duzenle.php?menu_id=<?php echo $altmenucek['menu_id'];?>"><button type="submit" class="btn btn-success">Güncelle</button></a>
</td>
<td><button class="btn btn-danger" data-toggle="modal" data-target="#altmenu<?=$menuCek['menu_id']?>"><i class="glyphicon glyphicon-trash"></i> Sil</button></td>
<div class="modal fade" tabindex="-1" role="dialog" id="altmenu<?=$menuCek['menu_id']?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Silmek İstediğinize Emin Misiniz?</h4>
</div>
<div class="modal-body">
<p>Yapılan silme işlemi geri alınamaz!!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
<a href="menu_sil.php?menu_id=<?php echo $altmenucek['menu_id'];?>"><button class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> Sil</button></a>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</tr>
<?php }
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<?php
include "footer.php";
?>
php kodlarını iletirmisin
modalı döngü içine almalısın
<?php
$query = $db->prepare("SELECT * FROM menuler");
$query->execute();
$menu=$query->fetchAll();
if($query->rowCount()){
foreach($menu as $row){ ?>
<div class="modal fade" tabindex="-1" role="dialog" id="<?php echo $row['menu_id']; ?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Silmek İstediğinize Emin Misiniz?</h4>
</div>
<div class="modal-body">
<p>Yapılan silme işlemi geri alınamaz!!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
<a href="menu_sil.php?menu_id=<?php echo $row['menu_id'] ?>"><button class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> Sil</button></a>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php }} ?>
ajax ile veri çekmek için bir post veya get verisi göndermek gerekmiyor mu hocam
ben direkt veri listeletiyorum formdaki verinin anlık gelmesi önemli değil
atıyorum admin_onay diye bir tablo var bu tabloda ki verileri anlık yansıtmam gerekiyor
forma bir action atadım farklı biyer de islem yaptırıp tekrar aynı sayfaya yönlendiriyorum böyle bir çözüm buldum
Hocam selamlar aslın da var now = new Date().getTime(); kısmına veriyi ekledim ama veriyi vermedi bu yüzden yanlış mı yaptım acaba diye düşündüm
sonra dan fark ettim ki istediğim aralık çoktan geçmiş :D
Şimdi ki zaman dan girdiğim saate sayım yapıyor bu aralığı biz belirleyemiyor muyuz
var countDownDate = new Date("2022/04/28 21:00:00").getTime(); //geri sayılacak ileri zamanki bir tarih
var dayText = "Gün";
var hourText = "Saat";
var minuteText = "Dakika";
var secondText = "Saniye";
if (countDownDate){
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
if (distance < 0) {
countDownDate = countDownDate + 1*24*60*60*1000;//Birgün sonra yenile
}else {
var days = Math.floor(distance / (1000 * 60 * 60 * 24)),
hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),
minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)),
seconds = Math.floor((distance % (1000 * 60)) / 1000),
days = (days?'<div><div>'+days+'</div><div>'+dayText+'</div></div>':''),
hours = (hours?'<div><div>'+hours+'</div><div>'+hourText+'</div></div>':''),
minutes = (minutes?'<div><div>'+minutes+'</div><div>'+minuteText+'</div></div>':''),
seconds = (seconds?'<div><div>'+seconds+'</div><div>'+secondText+'</div></div>':'');
document.getElementById("time").innerHTML = days + hours + minutes + seconds;
}
}, 1000);
}
<div id="countdown_container">
<div id="time"></div>
</div>
<?php
$cogalt = $_SESSION['yetiskin'];
for($say=1 ; $say<=$cogalt ; $say++){
?>
@caredpill aldığın hatalar nedir ?
Mantığı kavradım tablolarıma dil diye bir sütun açtım session verisi ile eşletirip veriyi değiştirdim