Menu

#26 sanity check on punches

open
nobody
None
5
2006-08-06
2006-08-06
No

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

Discussion

  • SchleyFox

    SchleyFox - 2006-08-24

    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";

     
  • SchleyFox

    SchleyFox - 2006-08-24

    Logged In: YES
    user_id=1211693

    yeah, that is malformed, but you get the idea

     
  • Jacob Allred

    Jacob Allred - 2007-11-15

    Logged In: YES
    user_id=561709
    Originator: NO

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.