Location: PHPKode > projects > ConPortal > conportal/redirects/edit_punch.php
<?php
/*
 *  ConPortal - Pomona College ITS & Bucknell University ISR scheduling appplication
 *  Copyright (C) 2005-2007  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
 */

/*PLEASE NOTE:
	This function does NOT (despite the name to the contrary!) actually edit anything in the database.
 	This generates the list of selectable punches so an admin can pick one to edit.  Actually re-writing
	the value into the database happens in redirects/add_punch.php.  Thanks!  */

require_once('../standard.php');
xhtml_header('Punch Editing'); 


if (isset($_POST['pid']) && isset($_POST['super_pid']) && 
	isset($_POST['start_year'])  and (int)$_POST['start_year']  and
    isset($_POST['start_month']) and (int)$_POST['start_month'] and
    isset($_POST['start_day'])   and (int)$_POST['start_day']   and
    isset($_POST['length'])      and (int)$_POST['length']) 
{
    $start = mktime(0, 0, 0, (int)$_POST['start_month'],
                    (int)$_POST['start_day'], (int)$_POST['start_year']);
    $end   = strtotime("+".((int)$_POST['length'])." days", $start);

	print_punch_history($_POST['pid'], $start, $end, TRUE);

    //header("Location: " . BASE_URL . "punch_tracking.php");
}
else
{
   error("Something wasn't filled out properly!  Now I am sad!");
   display_errors();
}

xhtml_footer();
?>
Return current item: ConPortal