Exemplo n.º 1
0
 *  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 'classes/class.ical.inc.php';
// $Id: iCalView.php,v 1.3 2005/10/30 22:37:19 atrommer Exp $
// if we have a uid, grab their schedule
// if we have aid, grab area schedule
// otherwise, do nothing
if ($_REQUEST['uid']) {
    $oSched = getMySched($_REQUEST['uid'], 2);
} elseif ($_REQUEST['aid']) {
    $oSched = getAreaSched($_REQUEST['aid'], 2);
} else {
    accessDenied("Invalid user or area!");
}
$iCal = (object) new iCal('', 0);
// (ProgrammID, Method [1 = Publish | 0 = Request])
$categories = array('Work', 'Party');
// main loop for the events
foreach ($oSched as $Sched) {
    $aAssign = array();
    $oEventEmps = getEventEmps($Sched->event_id);
    // add all event emps to the attendees
    foreach ($oEventEmps as $Emp) {
        $aTemp = array($Emp->user_first . ' ' . $Emp->user_last => $Emp->user_email . ",1");
        $aAssign = array_merge($aAssign, $aTemp);
    }
Exemplo n.º 2
0
function printArea($iArea)
{
    // displays the area schedule
    $oAreaDetails = getAreas($_SESSION['USERID'], $iArea);
    // make sure a row is returned, if not, user is being bad
    if (!count($oAreaDetails)) {
        // no areas, tried to circumvent sec, yell at them
        accessDenied("You tried to access an area you aren't assigned to!");
    }
    $oAreaSched = getAreaSched($_REQUEST['area']);
    if (!count($oAreaSched)) {
        // let user know we have no rows
        print "You haven't created a schedule for this area yet.";
    }
    ?>
	<html>
	<head>
	<title>Viewing Schedule for <?php 
    echo $oAreaDetails[0]->area_name;
    ?>
</title>
	<link href="global.css" rel="stylesheet" type="text/css">
	</head>
	
	<body>
	<table width="100%" cellpadding="2" cellspacing="0">
		<tr>
		<td width="50%">
		Below are the events for <?php 
    echo $oAreaDetails[0]->area_name;
    ?>
.
		<?php 
    // Area events go to the left
    foreach ($oAreaSched as $Sched) {
        // get area positions
        $oAreaPos = getAreaPos($_REQUEST['area']);
        ?>
			<br>
			<hr align="left">
			<?php 
        echo $Sched->event_name;
        ?>
			<table width="100%" border="0" cellpadding="2" class="contactInfo">
				  <tr>
					<td class="contactInfoName"><?php 
        print date("D, n/d/y", strtotime($Sched->event_date));
        ?>
</td>
					</tr>
				  <tr>
					<td>Start: <?php 
        echo date("g:i a", strtotime($Sched->event_start));
        ?>
					<div align="left"></div></td>
					<td>End: <?php 
        echo date("g:i a", strtotime($Sched->event_end));
        ?>
</td>
				  </tr>
				  <tr valign="top">
				  <?php 
        // now we go through each pos and list the scheduled emps
        foreach ($oAreaPos as $Pos) {
            ?>
				  	<td><table border="0" cellpadding="2" class="contactInfo">
				  	<tr><td colspan=2><strong><?php 
            echo $Pos->pos_name;
            ?>
</strong></td></tr><?php 
            $bRow = true;
            $oEventEmps = getEventEmps($Sched->event_id, $Pos->pos_id);
            if (count($oEventEmps)) {
                // we have emps, display them
                foreach ($oEventEmps as $Emp) {
                    $bRow = !$bRow;
                    ?>
					  		<tr<?php 
                    if ($bRow) {
                        print " class=evenRow";
                    }
                    ?>
>
					  			<td colspan=2><?php 
                    echo $Emp->user_first . ' ' . $Emp->user_last;
                    ?>
</td>
					  		</tr>
					  		<?php 
                }
            } else {
                //we don't, display msg
                print "<tr><td colspan=2><i>No employees scheduled yet</i></td></tr>";
            }
            ?>
</table></td><?php 
        }
        ?>
				  </tr>
			</table>
		<?php 
    }
    ?>
		</td>
		</tr>
	</table>
	<?php 
}
Exemplo n.º 3
0
		<input type="hidden" name="event" value="<?php 
    echo $iEvent;
    ?>
">
		<input type="hidden" name="confirmDelete" value="1">
		<input type="submit" name="delete" value="Click here to delete <?php 
    echo $aEventDetails->event_name;
    ?>
" >
	</form>
<?php 
}
// now that we're clean, get the schedule for the area
// pass it the selected date from the drop down
// method will default to current day forward if !postback
$oAreaSched = getAreaSched($_REQUEST['area'], $_REQUEST['filter']);
doHeader("Editing Schedule for " . $oAreaDetails[0]->area_name);
if ($_REQUEST['del']) {
    deleteConfirm($_REQUEST['area'], $_REQUEST['event']);
}
?>
<span class="contactInfo"><a href="printSched.php?area=<?php 
echo $_REQUEST['area'];
?>
" target="_blank">Printable Schedule</a> |
<?php 
if ($_REQUEST['filter'] != 1) {
    ?>
<a href="editSched.php?area=<?php 
    echo $_REQUEST['area'];
    ?>