15/09/2017, 12:43
serkandiker
PHP Kod:
<?php
$personel = $_SESSION['ekp'];
$count=1;
$randevuTarih=date("Y-m-d");
echo $personel."<br>";
echo $randevuTarih."<br>";
$sel_query="Select * from randevuzaman WHERE ekip = $personel and tarih like '%$randevuTarih%'";
$result = mysqli_query($con,$sel_query);
$bul = mysqli_num_rows($result);
echo $bul; echo "<br>";
if ($bul == 0){
$baslangic = "07:00:00";
$baslangic = strtotime($baslangic);
$bitis = "22:30:00";
$bitis = strtotime($bitis);
while (intval($baslangic)<intval($bitis)){
echo date("H:i:s",$baslangic); $baslangic = strtotime("+30 minute", $baslangic); echo "<br>";
}
}
else
{
$row = mysqli_fetch_assoc($result);
$baslangic = "06:30:00";
$baslangic = strtotime($baslangic);
$bitis = "22:00:00";
$bitis = strtotime($bitis);
while (intval($baslangic)<intval($bitis)){
$baslangic = strtotime("+30 minute", $baslangic);
$rsaat = date_create($row["saat"]); $rsaat1 = date_format($rsaat,"H:i:s");$aranan = strtotime($rsaat1);
echo date("H:i:s",$baslangic); if($baslangic == $aranan){echo " " . $row["kayitID"]." Randevu Var";}echo "<br>";
}
}
?>
Kayıt bölümünde bulunan aramayı döngüsel olarak tekrarlayacak ne yapabilirim.