File manager - Edit - /home/custbahd/irungikitchen.com/admin/counter/get-bd/index.php
Back
<!DOCTYPE html> <html> <head> <style type="text/css"> .wand-card { color: #fff; padding: 10px; border-radius: 5px; background: #000; } </style> </head> <body> <?php session_start(); include_once "../db/config.php"; include_once('../db/count_db.php'); // Generating a random number date_default_timezone_set('Africa/Kampala'); $today = date("His-dmY",time()); $today_day = date("D",time()); $today_date = date("d",time()); $tomorrow_date = date("d",time())+1; $this_week = date("W",time()); $next_week = date("W",time())+1; $last_week = date("W",time())-1; $today_month = date("M",time()); $next_month = date("M", strtotime($today_month . "+1 months")); $next_month_date = date("m",time())+1; $this_month = date("m",time()); $last_month = date("m",time())-1; $last_month_one = date("M", strtotime($today_month . "-1 month")); $today_year = date("Y",time()); $next_year = date("Y",time())+1; $last_year = date("Y",time())-1; $sql = "SELECT * FROM clients WHERE dob!='0000-00-00' AND MONTH(dob)>='$this_month' ORDER BY MONTH(dob), DAY(dob) ASC"; $result = $conn->query($sql); while($row = mysqli_fetch_array($result)) { date_default_timezone_set('Africa/Kampala'); $today = date("Y-m-d H:i:s",time()); $dob_one = date("".$next_year."-m-d 00:00:00",strtotime($row['dob'] . "+1 days")); $start_diff = new DateTimeImmutable($dob_one); $endd_diff = new DateTimeImmutable($today); $duration = $start_diff->diff($endd_diff); $today_diff = new DateTimeImmutable($today); $days_diff = $today_diff->diff($start_diff); if ($days_diff->format("%m")==11) { echo ''; } else { echo '<div class="row mb-4 wand-card">'; echo '<div class="col-md-12 col-12 fs-12 mb-2 wand-title">'.$row["fname"].' '.$row["lname"].' - <span>'.date("jS M", strtotime($row['dob'])).'</span></div>'; echo '<div class="col-md-3 col-3 fs-12 wand-counter">'.$days_diff->format("%m").'</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-counter">'.$days_diff->format("%d").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%h").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%i").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%s").'</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-initials">'; if ($days_diff->format("%m")==1) { echo 'month'; } else { echo 'months'; } echo '</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-initials">'; if ($days_diff->format("%d")==1) { echo 'day'; } else { echo 'days'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%h")==1) { echo 'hour'; } else { echo 'hours'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%i")==1) { echo 'min'; } else { echo 'mins'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%s")==1) { echo 'sec'; } else { echo 'secs'; } echo '</div>'; echo '</div>'; } } $sql = "SELECT * FROM clients WHERE dob!='0000-00-00' AND MONTH(dob)<'$this_month' ORDER BY MONTH(dob), DAY(dob) ASC"; $result = $conn->query($sql); while($row = mysqli_fetch_array($result)) { date_default_timezone_set('Africa/Kampala'); $today = date("Y-m-d H:i:s",time()); $dob_one = date("".$next_year."-m-d 00:00:00",strtotime($row['dob'] . "+1 days")); $start_diff = new DateTimeImmutable($dob_one); $endd_diff = new DateTimeImmutable($today); $duration = $start_diff->diff($endd_diff); $today_diff = new DateTimeImmutable($today); $days_diff = $today_diff->diff($start_diff); echo '<div class="row mb-4 wand-card">'; echo '<div class="col-md-12 col-12 fs-12 mb-2 wand-title">'.$row["fname"].' '.$row["lname"].' - <span>'.date("jS M", strtotime($row['dob'])).'</span></div>'; echo '<div class="col-md-3 col-3 fs-12 wand-counter">'.$days_diff->format("%m").'</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-counter">'.$days_diff->format("%d").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%h").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%i").'</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-counter">'.$days_diff->format("%s").'</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-initials">'; if ($days_diff->format("%m")==1) { echo 'month'; } else { echo 'months'; } echo '</div>'; echo '<div class="col-md-3 col-3 fs-12 wand-initials">'; if ($days_diff->format("%d")==1) { echo 'day'; } else { echo 'days'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%h")==1) { echo 'hour'; } else { echo 'hours'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%i")==1) { echo 'min'; } else { echo 'mins'; } echo '</div>'; echo '<div class="col-md-2 col-2 fs-12 wand-initials">'; if ($days_diff->format("%s")==1) { echo 'sec'; } else { echo 'secs'; } echo '</div>'; echo '</div>'; } ?> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.48 |
proxy
|
phpinfo
|
Settings