Timecard
Sorry, but you don't have access to any projects.
Please select a project to enter time:
0) { ?>Invalid project ID
Sorry, but there are no companies assigned to the '' project.
Please select a company to enter time:
0) { ?>Invalid project ID 0) { ?>Invalid company ID' . $projrow['name'] . ''; $page = $comprow['name']; breadcrumb(); ?>
Time Entry for :
Please select a date to add time for:
' . $projrow['name'] . ''; $page = 'Enter time for ' . $comprow['name']; breadcrumb(); ?>
Timecard for
Change Date:
0) $error = 1; if (preg_match("/[^0-9]/", $_REQUEST['start_min']) > 0) $error = 1; if (preg_match("/[^0-9]/", $_REQUEST['finish_hr']) > 0) $error = 1; if (preg_match("/[^0-9]/", $_REQUEST['finish_min']) > 0) $error = 1; if ($_REQUEST['start_hr'] < 1 || $_REQUEST['start_hr'] > 12) $error = 1; if ($_REQUEST['finish_hr'] < 1 || $_REQUEST['finish_hr'] > 12) $error = 1; if ($_REQUEST['start_min'] < 0 || $_REQUEST['start_min'] > 59) $error = 1; if ($_REQUEST['finish_min'] < 0 || $_REQUEST['finish_min'] > 59) $error = 1; // this needs a check to make sure that the employee in question doesn't already have // a time record that conflicts if ($error == 0) { // now convert 12 hour to 24 hour if ($_REQUEST['start_hr'] == 12 && $_REQUEST['start_ampm'] == 'am') $_REQUEST['start_hr'] = 0; if ($_REQUEST['start_hr'] < 12 && $_REQUEST['start_ampm'] == 'pm') $_REQUEST['start_hr'] = $_REQUEST['start_hr'] + 12; if ($_REQUEST['finish_hr'] == 12 && $_REQUEST['finish_ampm'] == 'am') $_REQUEST['finish_hr'] = 0; if ($_REQUEST['finish_hr'] < 12 && $_REQUEST['finish_ampm'] == 'pm') $_REQUEST['finish_hr'] = $_REQUEST['finish_hr'] + 12; // we can insert our data $update = mysql_query('INSERT INTO timecard(employee, company, start, finish, code, enteredby, notes) VALUES(' . $_REQUEST['employee'] . ', ' . $_REQUEST['company'] . ', "' . $_REQUEST['date'] . ' ' . $_REQUEST['start_hr'] . ':' . $_REQUEST['start_min'] . ':00"' . ', "' . $_REQUEST['date'] . ' ' . $_REQUEST['finish_hr'] . ':' . $_REQUEST['finish_min'] . ':00", ' . $_REQUEST['code'] . ', ' . $userid . ', "' . addslashes($_REQUEST['notes']) . '");'); if ($update == 0) $error = 1; } if ($error == 1) { echo ""; } } ?> = "' . $_REQUEST['date'] . ' 00:00:00" AND t.finish <= "' . $_REQUEST['date'] . ' 23:59:59" AND c.id=' . $_REQUEST['company'] . ' AND e.company=c.id AND e.id=t.employee AND t.code=cd.code ORDER BY e.lastname, e.firstname, t.start ASC'); if (mysql_num_rows($tcresults) == 0) { ?>'; } else { echo ''; } } ?>
There was an error entering your request. Please try again.
Employee Start End Code Notes Options
There is no time entered for this day.
  20) { echo substr($row['notes'], 0, 20) . "..."; } else { echo $row['notes']; } ?> 
Enter new record:
: : Notes:
Active Projects
Sorry, but you don't have access to any projects.
Please select a project to view payroll reports for:

Inactive Projects
Sorry, but you don't have access to any projects.
Please select a project to view payroll reports for:
0) { ?>Invalid project IDProjects'; $page = 'Timecard Reports for' . $projrow['name']; breadcrumb(); ?>
Timecard Reports for
Sorry, but there are no companies assigned to the '' project.
Please select a company to view a report for:
Please select a reporting period: = "' . $startday['startdate'] . ' 00:00:00" AND enddate <= DATE_ADD(NOW(), INTERVAL 1 WEEK) ORDER BY enddate DESC'); if (mysql_num_rows($result) > 0) { ?>

Print All Timecard Reports for
Sorry, but there are no companies assigned to the '' project.
Please select a company to view a report for:
0) { ?>Invalid company ID 0) { ?>Invalid project ID 0) { ?>Invalid pay period= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" ORDER BY e.lastname ASC, e.firstname ASC'); if (mysql_num_rows($result) > 0) { // dump out our users into an array of their own // so we can cycle through later while ($row = mysql_fetch_assoc($result)) { $employees[] = $row['employee']; } $CompanyInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM company WHERE id="' . $_REQUEST['company'] . '"')); $ProjectInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM project WHERE id="' . $_REQUEST['project'] . '"')); $secondarypage = 'Projects > ' . $ProjectInfo['name'] . ''; $page = 'Timecard Report for ' . $CompanyInfo['name']; breadcrumb(); // start our table ?>
Timecard Report for
'; } else { $salimg = ''; } if ($EmployeeData['class'] == 0) { $class = 'S'; } else if ($EmployeeData['class'] == 1) { $class = 'Sk'; } else if ($EmployeeData['class'] == 2) { $class = 'U'; } ?> '; $daytotal = 0; if ($k == 0) { // start date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $startdate . ' 00:00:00" AND finish <= "' . $startdate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; $day = $row['start']; $date = date('Y-m-d', $day); } } else if ($k == 6) { // end date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $enddate . ' 00:00:00" AND finish <= "' . $enddate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; $day = $row['start']; $date = date('Y-m-d', $day); } } else { // in between $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= DATE_ADD("' . $startdate . ' 00:00:00", INTERVAL ' . $k . ' DAY) AND finish <= DATE_ADD("' . $startdate . ' 23:59:59", INTERVAL ' . $k . ' DAY)'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $day = $row['start']; $date = date('Y-m-d', $day); $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } if ($daytotal > 0) { $daytotal = $daytotal - 1800; $totalhrs = $totalhrs - 1800; } $dayhrs = sprintf("%01.2f", (($daytotal / 60) / 60)); if ($daytotal > 0) { echo '' . $dayhrs . "\n"; } else { echo $dayhrs . "\n"; } if ($salary == 1) { $total = ((40) * ($wage) + $expense); } else { $total = ((sprintf("%01.2f", (($totalhrs / 60) / 60))) * ($wage) + $expense); } } ?>
Pay Period:
Project:
Company:
[Print In House Report - Print Sub Report - Code View]
Employee Class Fri Sat Sun Mon Tue Wed Thu Hours Expense Gross
' . $EmployeeData['lastname'] . ", " . $EmployeeData['firstname']; ?>
 
Legend
Projects > ' . $ProjectInfo['name'] . ''; $page = 'Timecard Report for ' . $CompanyInfo['name']; breadcrumb(); ?>
has no time records for the selected pay period.
0) { ?>Invalid company ID 0) { ?>Invalid project ID 0) { ?>Invalid pay period= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" ORDER BY e.lastname ASC, e.firstname ASC'); if (mysql_num_rows($result) > 0) { // dump out our users into an array of their own // so we can cycle through later while ($row = mysql_fetch_assoc($result)) { $employees[] = $row['employee']; } $CompanyInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM company WHERE id="' . $_REQUEST['company'] . '"')); $ProjectInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM project WHERE id="' . $_REQUEST['project'] . '"')); // start our table $title = $ProjectInfo['name'] . " | " . $CompanyInfo['name'] . " | " . $startdate . " through " . $enddate; phead(); ?>

TIMECARD



'; $daytotal = 0; if ($k == 0) { // start date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $startdate . ' 00:00:00" AND finish <= "' . $startdate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else if ($k == 6) { // end date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $enddate . ' 00:00:00" AND finish <= "' . $enddate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else { // in between $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= DATE_ADD("' . $startdate . ' 00:00:00", INTERVAL ' . $k . ' DAY) AND finish <= DATE_ADD("' . $startdate . ' 23:59:59", INTERVAL ' . $k . ' DAY)'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } if ($daytotal > 0) { $daytotal = $daytotal - 1800; $totalhrs = $totalhrs - 1800; } $dayhrs = sprintf("%01.2f", (($daytotal / 60) / 60)); echo $dayhrs . "\n"; if ($salary == 1) { $total = ((40) * ($wage) + $expense); } else { $total = ((sprintf("%01.2f", (($totalhrs / 60) / 60))) * ($wage) + $expense); } } ?>
Employee Class Fri Sat Sun Mon Tue Wed Thu Hours Expense Gross
Total
0) { ?>Invalid company ID 0) { ?>Invalid project ID 0) { ?>Invalid pay period= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" ORDER BY e.lastname ASC, e.firstname ASC'); if (mysql_num_rows($result) > 0) { // dump out our users into an array of their own // so we can cycle through later while ($row = mysql_fetch_assoc($result)) { $employees[] = $row['employee']; } $CompanyInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM company WHERE id="' . $_REQUEST['company'] . '"')); $ProjectInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM project WHERE id="' . $_REQUEST['project'] . '"')); $title = $ProjectInfo['name'] . " | " . $CompanyInfo['name'] . " | " . $startdate . " through " . $enddate; phead(); // start our table ?>

TIMECARD



'; $daytotal = 0; if ($k == 0) { // start date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $startdate . ' 00:00:00" AND finish <= "' . $startdate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else if ($k == 6) { // end date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $enddate . ' 00:00:00" AND finish <= "' . $enddate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else { // in between $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= DATE_ADD("' . $startdate . ' 00:00:00", INTERVAL ' . $k . ' DAY) AND finish <= DATE_ADD("' . $startdate . ' 23:59:59", INTERVAL ' . $k . ' DAY)'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } if ($daytotal > 0) { $daytotal = $daytotal - 1800; $totalhrs = $totalhrs - 1800; } $dayhrs = sprintf("%01.2f", (($daytotal / 60) / 60)); echo $dayhrs . "\n"; $total = (sprintf("%01.2f", (($totalhrs / 60) / 60))); } ?>
Employee Class Fri Sat Sun Mon Tue Wed Thu Hours
Total Hours
= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" ORDER BY e.lastname ASC, e.firstname ASC'); if (mysql_num_rows($result) > 0) { // dump out our users into an array of their own // so we can cycle through later while ($row = mysql_fetch_assoc($result)) { $employees[] = $row['employee']; } $CompanyInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM company WHERE id="' . $_REQUEST['company'] . '"')); $ProjectInfo = mysql_fetch_assoc(mysql_query('SELECT * FROM project WHERE id="' . $_REQUEST['project'] . '"')); // start our table $title = $ProjectInfo['name'] . " | " . $CompanyInfo['name'] . " | " . $startdate . " through " . $enddate; ?>

TIMECARD



'; $daytotal = 0; if ($k == 0) { // start date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $startdate . ' 00:00:00" AND finish <= "' . $startdate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else if ($k == 6) { // end date $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= "' . $enddate . ' 00:00:00" AND finish <= "' . $enddate . ' 23:59:59"'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } else { // in between $result = mysql_query('SELECT UNIX_TIMESTAMP(start) AS start, UNIX_TIMESTAMP(finish) AS finish FROM timecard WHERE employee=' . $employee . ' AND company=' . $_REQUEST['company'] . ' AND start >= DATE_ADD("' . $startdate . ' 00:00:00", INTERVAL ' . $k . ' DAY) AND finish <= DATE_ADD("' . $startdate . ' 23:59:59", INTERVAL ' . $k . ' DAY)'); while ($row = mysql_fetch_assoc($result)) { $difference = $row['finish'] - $row['start']; $daytotal = $daytotal + $difference; $totalhrs = $totalhrs + $difference; } } if ($daytotal > 0) { $daytotal = $daytotal - 1800; $totalhrs = $totalhrs - 1800; } $dayhrs = sprintf("%01.2f", (($daytotal / 60) / 60)); echo $dayhrs . "\n"; if ($salary == 1) { $total = ((40) * ($wage) + $expense); } else { $total = ((sprintf("%01.2f", (($totalhrs / 60) / 60))) * ($wage) + $expense); } } ?>
Employee Fri Sat Sun Mon Tue Wed Thu Hours Wage Expense Gross
 
' . $projrow['name'] . ''; $page = 'Code View for ' . $comprow['name'] . ' - Pay Period ' . $startdate . ' through ' . $enddate; breadcrumb(); ?>
= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" AND c.id=' . $_REQUEST['company'] . ' AND e.company=c.id AND e.id=t.employee AND t.code=cd.code ORDER BY e.lastname, e.firstname, t.code, t.start ASC'); if (mysql_num_rows($tcresults) == 0) { ?>
Code Day Hours Print
There is no time entered for this day.
 

TIMECARD

Code View -


= "' . $startdate . ' 00:00:00" AND t.finish <= "' . $enddate . ' 23:59:59" AND c.id=' . $_REQUEST['company'] . ' AND e.company=c.id AND e.id=t.employee AND t.code=cd.code ORDER BY e.lastname, e.firstname, t.code, t.start ASC'); while ($row = mysql_fetch_assoc($tcresults)) { $daytime = $row['finishtime'] - $row['starttime']; $hours = sprintf("%01.2f", (($daytime / 60) / 60)); if ($lastid != $row['eid']) { ?>
Code Day Hours