Location: PHPKode > projects > ConPortal > conportal/4am.php
<?php
/*
 *  ConPortal - Pomona College ITS / Bucknell University ISR scheduling appplication
 *  Copyright (C) 2005-2008 Pomona College & Bucknell University
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of version 2 of the GNU General Public License
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
include_once('standard.php'); 

$punched_in_now = getPunchedIn();
if (count($punched_in_now) > 0)
	{
		foreach ($punched_in_now as $row)
		{
			/* Prior, extra-snarky email body :)

			$body = $row["first"] . " " . $row["last"] . " must be working extra-hard - it's 4AM " .
 				"and " . $row["first"] . " is still here!  While " . $row["first"] ."'s " .
				"dedication to putting in extra hours should be duly noted and recognized " . 
				"when it comes time to give raises or promote to higher positions, you may " .
				"wish to warn " . $row["first"] . " that working excessively long hours may " .
				"lead to early burn-out.  Please encourage " . $row["first"] . " to punch out " . 
				"and go home at a reasonable hour.  Thank you!";  */

			$body = "It is 4 AM and " . $row["first"] . " " . $row["last"] . " has not punched out.";
					
			$subject = $row["first"] . " " . $row["last"] . " is working extra-hard!";
			
			if(BUCKNELL_OPTIONS ==  TRUE)
			{	
				$to = SUPERS . ", " . $row['username'] . "@bucknell.edu";
			}
			if(ALBANY_OPTIONS == TRUE)
			{
				$to = SUPERS;
			}

			send_email($body, $subject, $to);
		}
}

//remove old shift changelog records
removeOldChangelogRecords();
Return current item: ConPortal