You are not logged in!!!"; } else { //********** BEGIN CONTENT **********// echo "

Punch History

"; echo "

Below is your company punch history. You can use the form boxes to narrow down the results as needed, by date, user, or a combination.

"; echo "
"; echo "
"; echo "
"; echo "
"; echo " "; echo " "; echo "
"; echo "
"; echo " "; echo "
"; echo "
"; // tag order to query depending on drop-down if ($_POST['order'] == "Newest to Oldest") { $order="ORDER BY punches.id DESC"; } else { $order="ORDER BY punches.id"; } // actual query $query = "SELECT punches.id as punchid, users.id as user, users.firstname as firstname, users.lastname as lastname, punches.intime as intime, punches.outtime as outtime, punches.notes as notes, punches.modified as modified FROM punches INNER JOIN users ON punches.userid = users.id $order"; $stmt = $sql->prepare($query); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); //set up table header and open table echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; // $rows is an array containing all records... foreach ($rows as $row) echo ""; echo ''; echo '
First NameLast NameTime InTime OutHoursFlagNotes
" . $row['firstname'] . "" . $row['lastname'] . "" . $row['intime'] . "" . $row['outtime'] . "" . $row['hours'] . "" . $row['flag'] . "" . $row['notes'] . "
'; //********** END CONTENT **********// } require_once($yaptc_inc . "footer.inc.php"); ?>