Add consultation module assets and libraries
This commit is contained in:
30
konsultasi/conf/periodeGenerator.php
Normal file
30
konsultasi/conf/periodeGenerator.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$interval = 5 * 60; //10 menit
|
||||
$timeStart = strtotime(date('d-m-Y 00:00:00'));
|
||||
$timeEnd = strtotime(date('d-m-Y 23:00:00'));
|
||||
|
||||
$inTime = true;
|
||||
$i = 1;
|
||||
$periode = '';
|
||||
$periodeBefore = '';
|
||||
while ($inTime) {
|
||||
$time = $timeStart + ($i * $interval);
|
||||
$timeNext = $time + $interval;
|
||||
$periode = date('H:i:s', $time).' - '.date('H:i:s', $timeNext);
|
||||
echo $periode.'<br>';
|
||||
|
||||
//stop looing kalau belum jam start
|
||||
if ($time < $timeStart) {
|
||||
$inTime = false;
|
||||
}
|
||||
|
||||
//stop looping kalau udh lewat
|
||||
if ($time > $timeEnd) {
|
||||
$inTime = false;
|
||||
}
|
||||
//echo $time.'<br>';
|
||||
//array_push($arrTime,$time);
|
||||
++$i;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user