vendredi 27 mai 2022

how can I make each

i have the following code in php using laravel blade which allows me to get all the days of the current month as a table , I want to make each "" clickable with php , im not sure if thats possible.

    <table class="table-bordered">
  <tbody>
@php
$date = date('F Y');//Current Month Year
$row_count=0;
$col_count=0;

while (strtotime($date) <= strtotime(date('Y-m') . '-' . date('t', strtotime($date)))) {
if($row_count%4==0){
        echo "<tr>";
        $col_count=1;
     }
    $day_num = date('j', strtotime($date));
    $month_num = date('m', strtotime($date));
    $day_name = date('l', strtotime($date));
    $day_abrev = date('S', strtotime($date));
    $day = "$day_name $day_num";
    $date = date("Y-m-d", strtotime("+1 day", strtotime($date)));
    echo '<td>' . $day . '</td>';
    if($col_count==4){
           echo "</tr>";
        }
        $row_count++; 
        $col_count++; 
}
@endphp
  </tbody>
</table>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire