Click here to Skip to main content
15,883,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
if an employee checks in for first time, how to make that he cannot check in again for the same day?


XML
<div class="container">
<form class="well">
<h2>Employee Attendance</h2></form></div>

<div class="container">
<form class="well">
<div>
<br><br>
<b>EMPID:</b> <input ng-model="login.empid" name="emp"/>
<br/><br>
<b>Current Date: </b><span id="demo"></span><br>

<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.toDateString();
</script>-

<br>
<b>Current time is:</b>   <span my-current-time="format"></span>
<br>
<br>
<br>
<button class="btn btn-warning" ng-click="checkIn()" required>CheckIn</button>
<button class="btn btn-success" ng-click="checkOut()">CheckOut</button>
<button class="btn btn-primary" ng-click="clear()">Clear</button>
</div>

</form>
</div>
Posted
Updated 20-Apr-15 3:41am
v2
Comments
Andy Lanng 20-Apr-15 10:01am    
Are you using any code-behind? C#, VB...?
There are server-side caches you can use that you can set to expire after some time, or you can invalidate (expire) them all at midnight or other.
The only client side way would be to use cookies but someone with some know-how could just delete them themselves.
Member 11619095 20-Apr-15 10:53am    
Well, I am using angularJS and JSON for data
Richard C Bishop 20-Apr-15 16:42pm    
You just need to check the date/time of when they first clicked the button, if it is still the same day, then disable/hide the "check-in" button using ng-show or the ng-class directives.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900