Donate Share

PHP Timeclock

Tracker: Feature Requests

5 sanity check on punches - ID: 1535289
Last Update: Comment added ( zulugrid )

A user can punch "in" when they have already punched
"in" for day once.


Quintin Michael Riis ( qmrq ) - 2006-08-06 06:10

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 3 )

Date: 2007-11-15 19:20
Sender: zulugridAccepting Donations


Moved to Feature Requests.

Some people like the fact that you can punch in when you haven't punched
out. The next version of PHP Timeclock will include an option to let you
choose if you want them to punch out before punching in again.


Date: 2006-08-24 06:14
Sender: schleyfox

Logged In: YES
user_id=1211693

yeah, that is malformed, but you get the idea


Date: 2006-08-24 06:07
Sender: schleyfox

Logged In: YES
user_id=1211693

--- timeclock-1.03/leftmain.php 2006-04-13
11:52:33.000000000 -0400
+++ timeclock-1.03/leftmain.php 2006-08-24
02:03:57.000000000 -0400
@@ -422,20 +422,22 @@
}

if ($employee_passwd == $tmp_password) {
+ $foo = mysql_fetch_array(mysql_query("SELECT
in_or_out FROM ".$db_prefix."punchlist WHERE punchitems =
'$inout' LIMIT 1"));
+ $bar = mysql_fetch_array(mysql_query("SELECT
in_or_out FROM ".$db_prefix."punchlist WHERE punchitems =
(SELECT `inout` FROM ".$db_prefix."info WHERE fullname =
'$fullname' ORDER BY timestamp DESC LIMIT 1)"));
+ if($foo['in_or_out'] != $bar['in_or_out']) {
+ if (strtolower($ip_logging) == "yes") {
+ $query = "insert into ".
$db_prefix."info (fullname, `inout`, timestamp, notes,
ipaddress) values ('".$fullname."', '".$inout."',
+ '".$tz_stamp."', '".
$notes."', '".$connecting_ip."')";
+ } else {
+ $query = "insert into ".
$db_prefix."info (fullname, `inout`, timestamp, notes)
values ('".$fullname."', '".$inout."', '".$tz_stamp."',
+ '".$notes."')";
+ }

- if (strtolower($ip_logging) == "yes") {
- $query = "insert into ".$db_prefix."info
(fullname, `inout`, timestamp, notes, ipaddress) values
('".$fullname."', '".$inout."',
- '".$tz_stamp."', '".$notes."', '".
$connecting_ip."')";
- } else {
- $query = "insert into ".$db_prefix."info
(fullname, `inout`, timestamp, notes) values ('".
$fullname."', '".$inout."', '".$tz_stamp."',
- '".$notes."')";
- }
-
- $result = mysql_query($query);
+ $result = mysql_query($query);

- $update_query = "update ".$db_prefix."employees
set tstamp = '".$tz_stamp."' where empfullname = '".
$fullname."'";
- $other_result = mysql_query($update_query);
-
+ $update_query = "update ".
$db_prefix."employees set tstamp = '".$tz_stamp."' where
empfullname = '".$fullname."'";
+ $other_result = mysql_query($update_query);
+ }
echo "<head>\n";
echo "<meta http-equiv='refresh'
content=0;url=index.php>\n";
echo "</head>\n";



Attached File

No Files Currently Attached

Change ( 1 )

Field Old Value Date By
data_type 690699 2007-11-15 19:20 zulugrid