使用代码指示器在考勤系统中签入/签出 [英] Check in/out in attendance system using codeigniter

查看:210
本文介绍了使用代码指示器在考勤系统中签入/签出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个在线考勤系统,员工每天登录和登记,除了周末和休假。



所以,我的想法是在数据库中创建一个每日考勤记录作为表格。

  Attendance_date_daily date 
Employee_ID number(auto generated)
Check_in_time time
Check_out_time time
Attendence_status varchar
pre>

我使用codeigniter v 3.0.0



很容易创建一个模型来获取当前时间并在用户签入/签出时将其保存在数据库中。
但问题是,如果用户缺席一天或更长时间,那么系统将不会为那些天创建记录。



此外,我无法预先创建记录。因为我不知道用户何时有他/她的假期和工作日可能不同。



什么是最好的方式来创建和管理这些日常记录? / p>

解决方案

一个可能的解决方案可能是允许员工每天正常地执行他们的检入, 。



为了给没有签入的人添加缺席记录,可以使用CRON或类似的方法在每天午夜的时间安排一个任务。使用此任务可以定位将在控制器中运行方法的URL,该控制器将根据日记录检查员工。显然,对于那些谁已签入没有行动将执行,虽然对于那些谁没有,没有标记为休假或不工作你更新数据库以添加缺勤记录。



对于这样的系统,你通常调用url来执行更新使用任何系统你使用 wget 或类似于'load'的url和力它运行。安全考虑也将是,你想要添加一个秘密密钥作为GET参数或类似的东西,以便该方法可以检查它是通过任务调用,而不是例如。通过将GET参数与您设置的存储密钥进行比较来访问网址的用户。


I am trying to build an online attendance system where employees sign in and check in daily except for weekends and vacations.

so , my idea was to create a daily attendance record as a table in the database.

Attendance_date_daily         date
Employee_ID                   number(auto generated)
Check_in_time                 time
Check_out_time                time
Attendence_status             varchar

I am using codeigniter v 3.0.0

it's easy to create a model to get the current time and save it in the database when the user check in/out. but the problem is that, if the user was absent for a day or more , then the system will not create a record for those days.

moreover, i can't create the records beforehand. since i don't know when the user will have his/her vacation and working days may differ.

what is the best way to create and manage those daily records?

解决方案

One possible solution may be to allow the employees to do their check-in each day normally which would populate the database for those days.

In order to add the absence records for those who have not checked in you could use CRON or something similar to schedule a task at perhaps midnight each day. Use this task to target a url that would run a method in a controller that will check employees against the daily records. Obviously for those whom have checked in no action will be performed, although for those who have not and are not marked as on vacation or not working you update the database to add the absence records.

With a system like this you would typically invoke the url to perform the update using whatever system you use with wget or something similar to 'load' the url and force it to run. A security consideration also would be that you'll want to add in a secret key as a GET parameter or something similar so that the method can check that it's being invoked via the task and not e.g. someone visiting the url by comparing the GET parameter with a stored key that you've set.

这篇关于使用代码指示器在考勤系统中签入/签出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆