Hello I have created an attendance system but client requested to include a new fucntion iin it. Like there if employe comes and time in after the set time its should count late for that day means on a table if it is late so it will show 1 and if on time so it will be zero here i created but it only worked for one day i beleive the next day it's not working.
<?php
$timeout_query = "SELECT * FROM presence where user_id = '".$user_id."' AND p_date = '".$date."'";
$recordset = mysqli_query($connection, $timeout_query);
while($record = mysqli_fetch_array($recordset)) {
$lasttimein = $record['timein'];
$lasttimeout = $record['timeout'];
$clock_in_eve = $record_row['clock_in_eve'];
$clock_in_nite = $record_row['clock_in_nite'];
}
?>
And for the html the time in button it is like this
<form name="mail_sent" action="includes/timein.php" method="POST">
<input type="submit" value="TIME IN" name="time_in" class="time" />
<div class="clear"></div>
<input type="hidden" name="timein" value="<?php echo $time; ?>" />
<p>
<?php echo $lasttimein; ?></p>
</form>
To count lates per day i used this script
<?php
$tardy = 0;
if ($lasttimein >= $clock_in_eve || $lasttimein >= $clock_in_nite) {
$tardy++;
echo $tardy;
} else {
echo $tardy;
}
?>
Please let me know where i am mistaken and what is the mistake I am doing
Thank You