This is my scheduler
And I want to this in this way
The X button means Delete and it is existing in the database and the CHECK button is to add data in the database
This is my code in the first picture
<table class="table table-bordered table-hoverable table-striped" id="tblClassScheduler">
<thead>
<tr>
<?php
$days=array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
for ($i=0;$i<COUNT($days);$i++) {
echo "<th>".$days[$i]."</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
$timer_schedule=create_time_range("08:00","22:00","30 mins","12");
foreach ($timer_schedule as $value) {
echo "<tr>";
for ($a=0;$a<COUNT($days);$a++) {
$get_class_schedule=getData("SELECT * FROM acadsoc_class_schedule WHERE username=?",array($_SESSION['username']));
?>
<td>
<form method="POST">
<input type="text" name="class_time" value="<?php echo $value; ?>" hidden><br>
<label><?php echo $value; ?></label>
<input type="text" name="class_day" value="<?php echo $days[$a] ?>" hidden>
<button class="btn btn-sm btn-primary" style='padding: 1px 6px;' name="save_multiple_schedule" data-toggle="tooltip" data-placement="top" data-original-title="Add Schedule" title="Add Schedule"><span class="fas fa-check"></span></button>
<button class="btn btn-sm btn-danger" style='padding: 1px 6px;' name="delete_schedule" ata-toggle="tooltip" data-placement="top" data-original-title="Delete Schedule" title="Delete Schedule"><span class="fas fa-close"></span></button>
</form>
</td>
<?php
}
echo "</tr>";
}
?>
</tbody>
</table>