Added feature to let admins edit all punches

This commit is contained in:
2015-02-24 11:37:40 -05:00
parent 769f6b16c3
commit c768fb1bf5
2 changed files with 57 additions and 4 deletions

View File

@@ -33,6 +33,27 @@ function killSession()
// Edit Punch
function editPunch($yaptc_db, $punchid, $intime, $outtime, $notes)
{
$stmt = $yaptc_db->prepare("UPDATE punches SET punches.intime = :intime, punches.outtime = :outtime, punches.notes = :notes WHERE punches.id = :punchid;");
$stmt->execute(array(
':punchid' => $punchid,
':intime' => $intime,
':outtime' => $outtime,
':notes' => $notes
));
}
// Delete Punch
function deletePunch($yaptc_db, $punchid)
{
$stmt = $yaptc_db->prepare("DELETE FROM punches WHERE punches.id = :punchid;");
$stmt->execute(array(
':punchid' => $punchid
));
}
// Punch Out
function punchOut($yaptc_db, $punchid, $notes, $outtime, $modified=NULL)
{