function addForm() { $ret = "<table>"; $ret .= "<tr>"; $ret .= "<td><select id=addmonth>"; for ($i = 1; $i <= 12; $i++) { $ret .= sprintf("<option value=%d %s>%s</option>", $i, date('n') == $i ? 'selected' : '', date('F', mktime(0, 0, 0, $i, 1, 2000))); } $ret .= "</select></td>"; $ret .= "<td><input type=text size=4 id=addyear value="; if (date('n') == 12) { $ret .= date('Y') + 1; } else { $ret .= date('Y'); } $ret .= " /></td>"; $ret .= "<td><select id=addtype>"; $db = hours_dbconnect(); $q = "SELECT id,title FROM EvalTypes"; $r = $db->query($q); while ($w = $db->fetch_row($r)) { $ret .= "<option value={$w['0']}>{$w['1']}</option>"; } $ret .= "</select></td>"; $ret .= "<th>Score</th>"; $ret .= "<td><input type=text size=3 id=addscore /></td>"; $ret .= "<th>Pos.</th>"; $ret .= "<td><input type=text size=18 id=addpos value=Primary /></td>"; $ret .= "<td><input type=submit id=addsub value=Add /></td>"; $ret .= "</tr></table>"; return $ret; }
include '../../../../config.php'; require $FANNIE_ROOT . 'auth/login.php'; include '../db.php'; $name = checkLogin(); $perm = validateUserQuiet('evals'); if ($name === false && $perm === false) { header("Location: {$FANNIE_URL}auth/ui/loginform.php?redirect={$FANNIE_URL}legacy/it/hours/eval/list.php"); return; } else { if ($perm === false) { echo "Error"; return; } } $db = hours_dbconnect(); $order = 'name'; if (isset($_REQUEST['o'])) { switch ($_REQUEST['o']) { case 'adpID': $order = 'adpID'; break; case 'hireDate': $order = 'hireDate'; break; case 'evalDate': $order = 'evalDate'; break; default: $order = 'name'; break;
$checkW = $sql->fetch_row($checkR); if (validateUserQuiet('view_all_hours', $checkW['department'])) { $validated = true; } /* no access permissions found, so only allow the logged in user to see themself */ if (!$validated) { $empID = getUID($name); } } echo "<html><head><title>View</title>"; echo "<style type=text/css>\n#payperiods {\n margin-top: 50px;\n}\n\n#payperiods td {\n text-align: right;\n}\n\n#payperiods th {\n text-align: center;\n}\n\n#payperiods td.left {\n text-align: left;\n}\n\n#payperiods th.left {\n text-align: left;\n}\n\n#payperiods th.right {\n text-align: right;\n}\n\ntr.one td {\n background: #ffffcc;\n}\ntr.one th {\n background: #ffffcc;\n text-align: right;\n}\n\ntr.two td {\n background: #ffffff;\n}\ntr.two th {\n background: #ffffff;\n text-align: right;\n}\na {\n color: blue;\n}\n\n#temptable th {\n text-align: left;\n}\n#temptable td {\n text-align: right;\n padding-left: 2em;\n}\n\n#temptable {\n font-size: 125%;\n}\n\n#newtable th{\n text-align: left;\n}\n#newtable td{\n text-align: right;\n}\n\n</style>"; echo "</head><body>"; echo "<h3>Salary Employee PTO Status</h3>"; $sql = hours_dbconnect(); $infoQ = $sql->prepare_statement("select e.name,e.adpID,\n s.totalTaken as daysTaken\n from employees as e left join\n salarypto_ytd as s on e.empID=s.empID\n where e.empID=?"); $infoR = $sql->exec_statement($infoQ, array($empID)); $infoW = $sql->fetch_row($infoR); echo "<h2>{$infoW['0']} [ <a href={$FANNIE_URL}auth/ui/loginform.php?logout=yes>Logout</a> ]</h2>"; echo "<table cellspacing=0 cellpadding=4 border=1 id=newtable>"; echo "<tr class=one><th>PTO Allocation</th><td>{$infoW['1']}</td></tr>"; echo "<tr class=two><th>PTO Taken, YTD</th><td>{$infoW['2']}</td></tr>"; echo "<tr class=one><th>PTO Remaining</th><td>" . ($infoW[1] - $infoW[2]) . "</td></tr>"; echo "</tr></table>"; $periodsQ = $sql->prepare_statement("select daysUsed,month(dstamp),year(dstamp) \n from salaryHours where empID=? order by dstamp DESC"); $periodsR = $sql->exec_statement($periodsQ, array($empID)); $class = array("one", "two"); $c = 0; echo "<table id=payperiods cellspacing=0 cellpadding=4 border=1>"; echo "<tr><th>Month</th><th>PTO Taken</th></tr>";