Location: PHPKode > projects > ConPortal > conportal/edit_my_info.php
<?php
/*
 *  ConPortal - Pomona College ITS 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
 */
require_once('standard.php');

//FIXME: Someday this stuff should be moved into it's own files, prolly user db/display

xhtml_header('Change my info');

$info   = getUserDetails($_SESSION['pid']);

//display warnings if they entered something improper
if($_SESSION['invalidPhone'] == TRUE)
	{
		echo "<div class =\"warn\">Invalid Phone Number!</div><br>";
		$_SESSION['invalidPhone'] = FALSE;
	}
if($_SESSION['invalidCell'] == TRUE)
	{
		echo "<div class =\"warn\">Invalid Cell Phone Number!</div><br>";
		$_SESSION['invalidCell'] = FALSE;
	}
if($_SESSION['invalidSN'] == TRUE)
	{
		echo "<div class =\"warn\">Invalid Screen Name!</div><br>";
		$_SESSION['invalidSN'] = FALSE;
	}
if($_SESSION['invalidScalingFactor'] == TRUE)
	{
		echo "<div class =\"warn\">Invalid Scaling Factor!</div><br>";
		$_SESSION['invalidScalingFactor'] = FALSE;
	}	
	
?>
<form method='post' action='redirects/edit_my_info.php' id='modUserInfo'><div>
  <input type='hidden' name='pid' value='<?= $info['pid'] ?>' />
  <p>Editing <?= $info['name'] ?>'s information:</p>
<?php
	if(BUCKNELL_OPTIONS == TRUE)
	{
		echo "<br /><br /><label for='phone'>  Publically viewable phone number:  </label>
    			<input type='text' name='phone' id='phone' size='12' value='" . $info['phone'] . 
			"' /><br /><br /><label for='cell'>  Phone number viewable only by staff:  </label>
    			<input type='text' name='cell' id='cell' size='12' value='" . $info['cell'] . "' />";
	}
	if(ALBANY_OPTIONS == TRUE)
	{
		echo "<br /><br /><label for='phone'>  Phone Number:  </label>
    			<input type='text' name='phone' id='phone' size='12' value='" . $info['phone'] . "' />";
		
	}

?>
  <br /><br /><label for='sn'>  Screen Name:  </label>
    <input type='text' name='sn' id='sn' size='20'
           value='<?= $info['screen_name'] ?>' />
   <?php        
   		if(USER_CONTROLS_DROPTAKE_EMAIL)    
   		{
   ?>
  <br /><br /><label for='drop_emails'>  I wish to receive drop shift notifications:  </label>
    <input type='checkbox' name='drop_emails' id='drop_emails'
           <?
           	if($info["drop_emails"])
           		echo "CHECKED";
           ?>
            />
  <br /><br /><label for='take_emails'>  I wish to receive take shift notifications:  </label>
    <input type='checkbox' name='take_emails' id='take_emails'
           <?
           	if($info["take_emails"])
           		echo "CHECKED";
           ?>
           />
    <?php
		}
    ?>
    <br /><br><label for='scaling_factor'>  Scaling factor in the shift schedule display.<br />
    		Use this to make the shift blocks larger or smaller.<br />
    		The default value is 1.  Experiment and see what you like:  </label> <br /><br />
    <input type='text' name='scaling_factor' id='scaling_factor' size='6'
           value='<?= $info['scaling_factor'] ?>' /> 
    
     <br /><br /><label for='show_date_range'>  I wish to see the range of dates for shifts:  </label>
    <input type='checkbox' name='show_date_range' id='show_date_range'
           <?
           	if($info["show_date_range"])
           		echo "CHECKED";
           ?>
           />
           
       <br /><br /><label for='show_names'>  I wish to see the owners of shifts:  </label>
    <input type='checkbox' name='show_names' id='show_names'
           <?
           	if($info["show_names"])
           		echo "CHECKED";
           ?>
           />
      
       <br /><br /><label for='show_times'>  I wish to see the start and end times of shifts:  </label>
    <input type='checkbox' name='show_times' id='show_times'
           <?
           	if($info["show_times"])
           		echo "CHECKED";
           ?>
           />
           
        <br /><br /><label for='show_dropdowns'>  I wish to see take/drop dropdowns on shifts:  </label>
    <input type='checkbox' name='show_dropdowns' id='show_dropdowns'
           <?
           	if($info["show_dropdowns"])
           		echo "CHECKED";
           ?>
           />

	<br /><br /><label for='show_shift_open'>  I wish to see "Shift Open" on unclaimed shifts:  </label>
    <input type='checkbox' name='show_shift_open' id='show_shift_open'
           <?
           	if($info["show_shift_open"])
           		echo "CHECKED";
           ?>
           />
           
         <br /><br /><label for='show_shiftpid'>  I wish to see shift pids <br />
         	(Probably only useful if you're a <s>nerd</s> programmer):  </label> <br />
    <input type='checkbox' name='show_shiftpid' id='show_shiftpid'
           <?
           	if($info["show_shiftpid"])
           		echo "CHECKED";
           ?>
           />
    <?
	if(checkPerm($_SESSION, "appointments"))
	{
	?>
	    <br /><br /><label for='show_create_appointments'>  I wish to see an option to <br />
         	create appointments - only valid if you have that permission:  </label> <br />
    <input type='checkbox' name='show_create_appointments' id='show_create_appointments'
           <?
           	if($info["show_create_appointments"])
           		echo "CHECKED";
           ?>
           />
	<?
	}
	?>    

    
  <br /><br /><label for='taller'>  I wish I was a little bit taller:  </label>
    <input type='checkbox' name='taller' id='taller'
           value='<?= $info['taller'] ?>' />
  <br /><br /><br><input type="submit" value="Modify..." />
</div></form>

<? xhtml_footer() ?>
Return current item: ConPortal