andrew867 / timeclock

An updated version of PHP Timeclock
40 stars 68 forks source link

A valid From Date is required. #11

Closed southwesttech closed 8 years ago

southwesttech commented 9 years ago

I downloaded and installed the latest. Ran the create_tables.sql. When I try to run a report... I get the following: A valid From Date is required.

I also noticed that the user summary page is blank.

Am I missing something?

tomtom22 commented 9 years ago

I have exactly the same issues. I hope someone knows how to fix, it looks like such a great program.

Once reporting/user page is working, I will implement straight away.

Thanks.

tomtom22 commented 9 years ago

Hello,

Just an update - I have fixed the usersearch.php and useradmin.php file.

The original line of code is like this;

//echo " <td class=table_rows nowrap width=23 %> ".$row["email"]."\n";

Please uncomment the line, which will make the pages work;

echo " <td class=table_rows nowrap width=23 %> ".$row["email"]."\n";

I am working on the valid form date is required. I hope this helps you. Tom.

lqstota commented 9 years ago

The "valid form date is required" problem was created when the deprecated eregi php function was replaced with preg_match in total_hours.php. Preg_match requires a delimiter and in this case the delimiter used was the '/' character. However since that character is one that is contained in the regular expression, you need to escape it. In two locations in this file, you will change this:

} elseif (!preg_match('/' . "^([0-9]?[0-9])+[-|/|.]+([0-9]?[0-9])+[-|/|.]+(([0-9]{2})|([0-9]{4}))$" . '/i', $to_date, $date_regs)) {

to this:

} elseif (!preg_match('/' . "^([0-9]?[0-9])+[-|\/|.]+([0-9]?[0-9])+[-|\/|.]+(([0-9]{2})|([0-9]{4}))$" . '/i', $to_date, $date_regs)) {

That seems to get the report working again. Best Larry

jconit commented 9 years ago

THANK YOU!!! lqstota..

ns-lookup commented 9 years ago

Correction, I am an idiot and forgot to edit it in both places. Please remove this comment. Sorry for the inconvenience.

TravisCook commented 9 years ago

Yes, thank you lqstota!

I had to make that change in a bunch of other files to get things working correctly. timeedit.php, timeadd.php, timedelete.php, etc.

andrew867 commented 8 years ago

@TravisCook Could you provide a diff of the fixes you made and I'll merge them into the project.

benscanfiles commented 8 years ago

@andrew867 In my pull request, I already fixed this issue. You can close this report :-)

andrew867 commented 8 years ago

@benscanfiles Thanks!