Location: PHPKode > projects > ConPortal > conportal/inc/differentials/display.php
<?php
/*
 *  ConPortal - Pomona College ITS 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
 */

function print_differentials_form()
{
	$diff_list = getDifferentialShifts();
	
	echo "<center>";
	echo "<h2>Use this form to remove differential ranges that are used on the punch history page.</h2><br /><br />";
	echo "<b>Two caveats: To disable differential shifts altogether, or to make all shifts differential, try looking
		in Edit Preferences and setting those options under Shift Creation Options.</b><br /><br />";
	echo "</center>";
	echo "<table class='shift_history'>";
	
	if (!count($diff_list)) {
        echo "<tr class='d0'><td class='center impt' colspan='3'>No differential shifts found in database.</td></tr>\n";
    } else {
   		echo "<tr><th>Start Day</th><th>Start Time</th><th>End Day</th><th>End Time</th><th>Delete?</th></tr>";
    	foreach ($diff_list as $diff) 
    		{
            $start_array = time_to_array($diff['start_time']);
            $end_array = time_to_array($diff['end_time']);
    		
            echo "<tr><td>" . $diff['start_d_o_w'] . "</td><td>" . 
            	$start_array['12hour'] . ":" . $start_array['min'] . " " . $start_array['AMPM'] . 
            	"</td><td>" . $diff['end_d_o_w'] . "</td><td>" . 
            	$end_array['12hour'] . ":" . $end_array['min'] . " " . $end_array['AMPM'] . 
            	"</td><td ><a href='differential_delete.php?pid=" . $diff['pid'] . "'>" .
                    "Delete!</a></td></tr>";
        }
    }
    echo "</table>";
	
	echo "<br /><br /><br /><center><h2>Enter a new differential range here:</h2><br />";
	echo "<form method='post' action='redirects/add_differentials.php'>";
	echo "<b>Start day:</b><br />";
	display_friendly_day_of_week_dropdown("start");
	echo "  at  ";
	display_friendly_12h_15m_AMPM_dropdown("start") . "<br /><br />";
	echo "<br /><b>End day:</b><br />";
	display_friendly_day_of_week_dropdown("end");
	echo "  at  ";
	display_friendly_12h_15m_AMPM_dropdown("end") . "<br /><br />";
	echo "<br /><br />";
	echo "<input type='submit' name='add_differential' value='Add!' />";
	echo "</center>";
}
?>
Return current item: ConPortal