Hello guys I really need your help. I Had created attendance system but I stucked up with time in button.
I have created a time out and time in button and both are working fine and great but the main problem is that I am unsuccessful for making the time in that when user sign's in and click's on time in button will not work anymore until the next day starts.It means for example shift starts at 6:00 the user sign in and clicks on time in so user cannot click again until he comes next day at 6 the time in button would be click able at that time
Can you guys please help me out with this concern??. I would be really really thankful for this kind help.
Here are some codes that I would like to share with you
My home page code for time in and time out :
code :
<script language="javascript">
function timeout()
{
document.form1.action = "settime.php?uid=<?php echo $uid?>";
document.form1.submit();
}
function timein()
{
document.form1.action = "timein.php?uid=<?php echo $uid?>";
document.form1.submit();
}
</script>
<html>
<head>
and this is the code where the timin and time out function shows :
<form name="form1" method="post" action= "" >
<div id="time-status">
<h4>Time Status</h4>
<?php
date_default_timezone_set("Etc/GMT+7");
$query = "select * from presence where uid=".$uid." and date='".$date."'";
$recordset = mysql_query($query);
while($record = mysql_fetch_array($recordset)){
$count = 1;
$lasttimein = $record["timein"];
echo "<table><tr><td>Your Time In :</td><td> ",$lasttimein,"</td></tr></table>";
$lasttimeout = $record["timeout"];
}
echo "<table><tr><td>Your Time Out :</td><td> ",$lasttimeout,"</td></tr></table>";
?>
<input type="button" name="button3" value="Time Out" onClick="timein()" class="button">
<input type="button" name="button2" value="Time Out" onClick="timeout()" class="button">
</div>
and please do let me know if you also be requiring to see the code for timein.php page which I had created for timein function.
Thank you in advance GOD bless you all :)
Kind Regards Usman Khan