Example #1
0
function showGrid(&$events, $date)
{
    global $privs, $hoverBox, $evtDone, $set, $xx, $upcoTxt;
    $lastDate = '';
    $showDetails = ($set['details4All'] == 1 or $set['details4All'] == 2 and $_SESSION['uid'] > 1);
    foreach ($events as $evt) {
        if (!$evt['mde'] or !in_array($evt['eid'], $evtDone)) {
            //!mde or mde not processed
            $evtDate = $evt['mde'] ? makeD($evt['sda'], 5) . " - " . makeD($evt['eda'], 5) : makeD($date, 5);
            $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
            if ($set['eventColor']) {
                $eStyle = ($evt['cco'] ? 'color:' . $evt['cco'] . ';' : '') . ($evt['cbg'] ? 'background-color:' . $evt['cbg'] . ';' : '');
            } else {
                $eStyle = $evt['uco'] ? 'background-color:' . $evt['uco'] . ';' : '';
            }
            $eStyle = $eStyle ? ' style="' . $eStyle . '"' : '';
            $chBox = '';
            if ($evt['cbx']) {
                $chBox .= !$evt['mde'] ? strpos($evt['chd'], $date) ? $evt['cmk'] : '☐' : '?';
            }
            if ($chBox) {
                $mayCheck = ($privs > 3 or $privs > 1 and $evt['uid'] == $_SESSION['uid']) ? true : false;
                $attrib = ($mayCheck and !$evt['mde']) ? "class='chkBox point' onclick=\"checkE(" . $evt['eid'] . ",'" . $date . "');\" title=\"{$xx['vws_check_mark']}\"" : 'class="chkBox"';
                $chBox = '<span ' . $attrib . ">" . trim($chBox) . '</span>';
            }
            if ($hoverBox) {
                $popText = "<b>{$evtTime}:" . ((!$evt['mde'] and $evt['eti']) ? ' - ' . ITtoDT($evt['eti']) : '') . " {$evt['tit']}</b><br>";
                if ($showDetails or $evt['mayE']) {
                    $popText .= makeE($evt, $set['popBoxFields'], 'br', '<br>');
                }
                $popText = htmlspecialchars(addslashes($popText));
                $popClass = ($evt['pri'] ? 'private' : 'normal') . (($evt['mde'] or $evt['r_t']) ? ' repeat' : '');
                $popAttr = " onmouseover=\"pop(this,'{$popText}','{$popClass}')\"";
            } else {
                $popAttr = '';
            }
            $eBoxStyle = ($evt['app'] and !$evt['apd']) ? " style='border-left:2px solid #ff0000;'" : '';
            echo $lastDate != $evtDate ? "<br>\n<h6>{$evtDate}</h6>\n" : "<br>\n";
            echo "<table>\n<tr>\n\t\t\t\t<td class='widthCol1'>{$evtTime}</td>\n\t\t\t\t<td class='eBox'{$eBoxStyle}>";
            if ($showDetails or $evt['mayE']) {
                echo "<h6>{$chBox}<span class='point'{$eStyle} onclick=\"editE({$evt['eid']},'{$date}');\"{$popAttr}>{$evt['tit']}</span></h6>\n";
                echo makeE($evt, $set['evtTemplUpc'], 'br', '<br>') . "\n";
            } else {
                echo "<h6>{$chBox}<span{$eStyle}{$popAttr}>{$evt['tit']}</span></h6>\n";
            }
            echo "</td></tr></table>\n";
            $evtDone[] = $evt['eid'];
            //add text version to $upcoTxt
            if ($lastDate != $evtDate) {
                $upcoTxt .= "\n{$evtDate}\n" . str_repeat('-', strlen($evtDate));
            }
            //new or same date
            $upcoTxt .= "\n{$evtTime}\n" . html_entity_decode($evt['tit'], ENT_QUOTES) . "\n";
            if ($showDetails or $evt['mayE']) {
                $upcoTxt .= html_entity_decode(makeE($evt, $set['evtTemplUpc'], 'br', "\n"), ENT_QUOTES) . "\n";
            }
            $lastDate = $evtDate;
        }
    }
}
Example #2
0
 function displayUE(&$evtList)
 {
     global $evtList, $set, $xx, $sbMaxNbr, $sbCalUrl, $rxULink;
     $evtDone = array();
     $lastDate = '';
     foreach ($evtList as $date => &$events) {
         foreach ($events as $evt) {
             if (!$evt['mde'] or !in_array($evt['eid'], $evtDone)) {
                 //!mde or mde not processed
                 $evtDone[] = $evt['eid'];
                 $evtDate = $evt['mde'] ? makeD($evt['sda'], 5) . " - " . makeD($evt['eda'], 5) : makeD($date, 5);
                 $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
                 if ($set['popFieldsSbar']) {
                     $popText = "<div class='ssb_gen ssb_popUp'><b>{$evtTime} {$evt['tit']}</b>";
                     $popText = makeE($evt, $set['popFieldsSbar'], 'br', "<br>");
                     $popText = htmlspecialchars(addslashes($popText . '</div>'));
                     $popClass = ($evt['mde'] or $evt['r_t']) ? 'ssb_repeat' : 'ssb_normal';
                     $popAttr = " onmouseover=\"pop(this,'{$popText}','{$popClass}',50)\"";
                 } else {
                     $popAttr = '';
                 }
                 if ($set['eventColor']) {
                     $eStyle = ($evt['cco'] ? "color:{$evt['cco']};" : '') . ($evt['cbg'] ? "background-color:{$evt['cbg']};" : '');
                 } else {
                     $eStyle = $evt['uco'] ? "background-color:{$evt['uco']};" : '';
                 }
                 $eStyle = $eStyle ? " style='{$eStyle}'" : '';
                 if (empty($sbCalUrl)) {
                     $eTitle = $evt['tit'];
                 } else {
                     $jumpD = (strpos($sbCalUrl, '?') ? '&amp;' : '?') . "cD={$evt['sda']}";
                     $eTitle = "<a href='{$sbCalUrl}{$jumpD}' target='luxcal'>{$evt['tit']}</a>";
                 }
                 if ($lastDate != $evtDate) {
                     echo "<div class='ssb_gen ssb_date'>{$evtDate}</div>\n";
                     $lastDate = $evtDate;
                 }
                 echo "<div class='ssb_gen ssb_event ssb_arrow'{$popAttr}>\n\t\t\t\t\t<div class='ssb_gen ssb_evtTime'>{$evtTime}</div>\n<div class='ssb_gen ssb_evtTitle'{$eStyle}>{$eTitle}</div>\n\t\t\t\t\t</div>\n";
                 if ($set['showLinkInSB'] and preg_match_all($rxULink, $evt['des'], $urls, PREG_SET_ORDER)) {
                     //display URL links
                     echo "<div class='ssb_gen ssb_evtUrl'{$eStyle}>";
                     foreach ($urls as $url) {
                         echo "{$url[0]}<br>";
                     }
                     echo "</div>\n";
                 }
                 if (--$sbMaxNbr < 1) {
                     break 2;
                 }
             }
         }
     }
 }
Example #3
0
$sDoLastW = date("Y-m-d", mktime(12, 0, 0, $m, $sDow - 7, $y));
$sDoNextW = date("Y-m-d", mktime(12, 0, 0, $m, $sDow + 7, $y));
/* display header */
$weekNr = $set['weekNumber'] ? ' (' . $xx['vws_week'] . ' ' . date('W', mktime(12, 0, 0, $m, $sDow + 1, $y)) . ')' : '';
$header = '&nbsp;<span' . ($_SESSION['mobile'] ? '' : " class='viewHdr'") . '>' . makeD($sDayOfWk, 2) . ' - ' . makeD($eDayOfWk, 2) . "{$weekNr}</span>&nbsp;";
echo "<h4 class='floatC'><a class='noPrint' href='index.php?lc&amp;cD={$sDoLastW}'>&nbsp;&#9664;&nbsp;</a>{$header}<a class='noPrint' href='index.php?lc&amp;cD={$sDoNextW}'>&nbsp;&#9654;&nbsp;</a></h4>\n";
$cWidth = round(98 / strlen($days), 1) . '%';
/* display day headers */
echo "<div" . ($_SESSION['mobile'] ? '' : " class='scrollBoxHead'") . ">\n";
echo "<table class='grid'>\n\t<tr><th class='tCol'>{$xx['vws_time']}</th>\n";
for ($i = 0; $i < 7; $i++) {
    $cTime = mktime(12, 0, 0, $m, $sDow + $i, $y);
    //current time
    if (strpos($days, date("N", $cTime)) !== false) {
        $sDate = date("Y-m-d", $cTime);
        echo "<th class='dCol point' style='width:{$cWidth}' onclick=\"goDay('{$sDate}');\" title=\"{$xx['vws_view_day']}\">" . makeD($sDate, $_SESSION['mobile'] ? 1 : 4, 'xs') . "</th>\n";
    }
}
echo "</tr>\n</table>\n\t</div>";
/* retrieve events */
retrieve($sDayOfWk, $sDoNextW, 'guc');
/* display days */
echo "<div" . ($_SESSION['mobile'] ? '' : " class='scrollBoxWe'") . ">\n";
echo "<table class='grid'>\n\t<tr><td class='tCol tColBg'>\n";
showHours();
echo "</td>\n";
for ($i = 0; $i < 7; $i++) {
    $cTime = mktime(12, 0, 0, $m, $sDow + $i, $y);
    //current time
    $cDate = date("Y-m-d", $cTime);
    //current date
Example #4
0
function showMatches()
{
    global $privs, $set, $xx, $evtList, $schText;
    //display matching events
    echo '<div class="eventBg">' . "\n";
    if ($evtList) {
        $match = '%(' . str_replace(array('_', '&'), array('.', '[^<>]+?'), $schText) . ')(?![^<]*>)%i';
        //convert to regex (?!: neg.look-ahead condition)
        $evtDone = array();
        $lastDate = '';
        foreach ($evtList as $date => &$events) {
            foreach ($events as $evt) {
                if (!$evt['mde'] or !in_array($evt['eid'], $evtDone)) {
                    //!mde or mde not processed
                    $evtDone[] = $evt['eid'];
                    $evtDate = $evt['mde'] ? makeD($evt['sda'], 5) . " - " . makeD($evt['eda'], 5) : makeD($date, 5);
                    $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
                    if ($set['eventColor']) {
                        $eStyle = ($evt['cco'] ? "color:{$evt['cco']};" : '') . ($evt['cbg'] ? "background-color:{$evt['cbg']};" : '');
                    } else {
                        $eStyle = $evt['uco'] ? "background-color:{$evt['uco']};" : '';
                    }
                    $eStyle = $eStyle ? ' style="' . $eStyle . '"' : '';
                    $chBox = '';
                    if ($evt['cbx']) {
                        $chBox .= !$evt['mde'] ? strpos($evt['chd'], $date) ? $evt['cmk'] : '&#x2610;' : '?';
                    }
                    if ($chBox) {
                        $mayCheck = ($privs > 3 or $privs > 1 and $evt['uid'] == $_SESSION['uid']) ? true : false;
                        $attrib = ($mayCheck and !$evt['mde']) ? " class='chkBox point' onclick=\"checkE({$evt['eid']},'{$date}');\" title=\"{$xx['vws_check_mark']}\"" : 'class="chkBox arrow"';
                        $chBox = "<span{$attrib}>" . trim($chBox) . "</span> ";
                    }
                    if ($evt['app'] and !$evt['apd']) {
                        $eBoxStyle = 'border-left:2px solid #ff0000;';
                    }
                    $eBoxStyle = $eBoxStyle ? " style='{$eBoxStyle}'" : '';
                    echo $lastDate != $evtDate ? "<br><h6><a href='index.php?lc&amp;cP=2&amp;cD={$date}' title=\"{$xx['sch_calendar']}\">{$evtDate}</a></h6>\n" : "<br>\n";
                    echo "<table>\n<tr>\n\t\t\t\t\t\t<td class='widthCol1'>{$evtTime}</td>\n\t\t\t\t\t\t<td class='eBox'{$eBoxStyle}>";
                    if ($set['details4All'] == 1 or $set['details4All'] == 2 and $_SESSION['uid'] > 1 or $evt['mayE']) {
                        echo "<h6>{$chBox}<span class='point'{$eStyle} onclick=\"editE({$evt['eid']},'{$date}');\">" . preg_replace($match, '<mark>$1</mark>', $evt['tit']) . "</span></h6>\n";
                        echo makeE($evt, $set['evtTemplGen'], 'br', "<br>\n") . "\n";
                    } else {
                        echo "<h6>{$chBox}<span{$eStyle}>" . preg_replace($match, '<mark>$1</mark>', $evt['tit']) . "</span></h6>\n";
                    }
                    echo "</td></tr></table>\n";
                    $lastDate = $evtDate;
                }
            }
        }
    } else {
        echo $xx['sch_no_results'] . "\n";
    }
    echo "</div>\n";
}
Example #5
0
        echo "</td>\n</tr>\n</table>\n<br>\n";
    }
}
//sanity check
if (empty($lcV)) {
    exit('not permitted (' . substr(basename(__FILE__), 0, -4) . ')');
}
//launch via script only
//main program
$evtList = array();
$fromD = isset($_POST['fromD']) ? DDtoID($_POST['fromD']) : date('Y-m-d');
$fromD = min($fromD, date('Y-m-d'));
//display header
echo "<div class='subHead'>\n\t<form method='post' id='selectD' name='selectD' action='index.php?lc'>{$xx['chg_from_date']}: \n\t<input type='hidden' name='token' value='{$_SESSION['token']}'>\n\t<input type='text' id='fromD' name='fromD' value='" . IDtoDD($fromD) . "' size='10'>\n\t<button class='noPrint' title=\"{$xx['chg_select_date']}\" onclick=\"dPicker(0,'selectD','fromD');return false;\">&larr;</button>\n\t</form>\n</div>\n";
// retrieve changed events
grabChanges($fromD, 0);
//query db for changes
//display changes
echo '<div class="eventBg' . ($_SESSION['mobile'] ? '"' : ' scrollBoxCh"') . ">\n";
if ($fromD != date('Y-m-d')) {
    echo "<h4>" . makeD($fromD, 2) . " - " . makeD(date('Y-m-d'), 2) . "</h4>\n<br>\n";
}
if ($evtList) {
    foreach ($evtList as $date => &$events) {
        echo "<br><h6>" . $xx['chg_changed_on'] . " " . makeD($date, 5) . "</h6><br>\n";
        showEvents($events, $date);
    }
} else {
    echo "<br>{$xx['chg_no_changes']}<br>\n";
}
echo "</div>\n<br>";
Example #6
0
 //# of months per row
 echo '<td class="holder">';
 /* collect month info */
 $timeDay1 = mktime(12, 0, 0, $cm, 1, $y);
 //Unix time of month
 $day1 = date("Y-m-d", $timeDay1);
 $thisM = substr($day1, 5, 2);
 $thisY = substr($day1, 0, 4);
 $sOffset = $set['weekStart'] ? date("N", $timeDay1) - 1 : date("w", $timeDay1);
 //offset first day
 $eOffset = date("t", $timeDay1) + $sOffset;
 //offset last day
 $daysToShow = $eOffset == 28 ? 28 : ($eOffset > 35 ? 42 : 35);
 //4,5 or 6 weeks
 /* display month header */
 echo "<h5 class='floatC point' onclick=\"goMonth('{$day1}');\" title=\"{$xx['vws_view_month']}\">" . makeD($day1, 3) . "</h5>\n";
 echo "<table class='grid'>\n";
 if ($set['weekNumber']) {
     echo "<col class='wkCol'>";
 }
 //add week # column
 echo "<col span='7' class='dCol7'>\n";
 echo "<tr>\n";
 if ($set['weekNumber']) {
     echo '<th>' . $xx['vws_wk'] . '</th>';
 }
 //week # hdr
 for ($x = $set['weekStart']; $x < $set['weekStart'] + 7; $x++) {
     echo "<th>{$wkDays_s[$x]}</th>";
 }
 //week days
Example #7
0
$sOffset = $set['weekStart'] ? date("N", $timeD1) - 1 : date("w", $timeD1);
//offset first day
$eOffset = date("t", $timeD1) + $sOffset;
//offset last day
$daysToShow = $eOffset == 28 ? 28 : ($eOffset > 35 ? 42 : 35);
//4, 5 or 6 weeks
$sDate = date("Y-m-d", $timeD1 - $sOffset * 86400);
//start date in 1st week
$eDate = date("Y-m-d", $timeD1 + ($daysToShow - $sOffset - 1) * 86400);
//end date in last week
retrieve($sDate, $eDate);
//retrieve events
/* display header */
$fullCalUrl = $set['mCalUrlFull'] ? $set['mCalUrlFull'] : 'index.php?lc&amp;cP=2&amp;cD=' . $dateD1;
echo "<div class='floatC fontS'>{$xx['vws_click_for_full']}</div>\n";
echo "<h6 class='floatC'><a href='" . htmlentities($_SERVER['PHP_SELF']) . '?oM=', $offM - 1, "' title=\"{$xx['vws_prev_month']}\">&lt;&lt;</a>&nbsp;&nbsp;&nbsp;<a href=\"{$fullCalUrl}\" title=\"{$xx['vws_view_full']}\" target='_blank'>", makeD($dateD1, 3), "</a>&nbsp;&nbsp;&nbsp;<a href='" . htmlentities($_SERVER['PHP_SELF']) . '?oM=', $offM + 1, "' title=\"{$xx['vws_next_month']}\">&gt;&gt;</a></h6>\n";
/* display month */
$days = $set['miniCalView'] == 1 ? '1234567' : $set['workWeekDays'];
//set days to show
$cWidth = round(98 / strlen($days), 1) . '%';
echo "<table class='grid'>\n\t<col span='" . strlen($days) . "' class='dCol' style='width:{$cWidth}'>\n\t<tr>\n";
for ($i = 0; $i < 7; $i++) {
    $cTime = mktime(12, 0, 0, $curM, $i - $sOffset + 1, $curY);
    //current time
    if (strpos($days, date("N", $cTime)) !== false) {
        echo "<th>{$wkDays_s[$set['weekStart'] + $i]}</th>";
    }
    //week days
}
echo "</tr>\n";
for ($i = 0; $i < $daysToShow; $i++) {
Example #8
0
 //make side bar with todo list
 echo "<div id='taskBar'>\n\t\t\t<img class='floatR point' onclick=\"show('taskBar')\" src='images/close.png' alt='close'>\n\t\t\t<div class='barHead move' onmousedown=\"dragMe('taskBar',event)\">{$xx['hdr_todo_list']}</div>\n\n\t\t\t<div class='barBody'>\n";
 $curD = $_SESSION['cD'];
 $curT = mktime(12, 0, 0, substr($curD, 5, 2), substr($curD, 8, 2), substr($curD, 0, 4));
 //current Unix time
 $startD = date("Y-m-d", $curT - 30 * 86400);
 //current date - 1 month
 $endD = date("Y-m-d", $curT + ($set['lookaheadDays'] - 1) * 86400);
 //current date + look ahead nr of days
 $filter = '(c.chbox = 1)';
 //events in cat with a check mark
 retrieve($startD, $endD, 'u', $filter);
 //display todo list
 if ($evtList) {
     foreach ($evtList as $date => &$events) {
         echo "<h6>" . makeD($date, 5) . "</h6>\n";
         foreach ($events as $evt) {
             $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
             $onClick = ($set['details4All'] == 1 or $set['details4All'] == 2 and $_SESSION['uid'] > 1 or $evt['mayE']) ? " class='point' onclick=\"editE({$evt['eid']},'{$date}');\"" : " class='arrow'";
             if ($set['eventColor']) {
                 $eStyle = ($evt['cco'] ? "color:{$evt['cco']};" : '') . ($evt['cbg'] ? "background-color:{$evt['cbg']};" : '');
             } else {
                 $eStyle = $evt['uco'] ? "background-color:{$evt['uco']};" : '';
             }
             $eStyle = $eStyle ? " style='{$eStyle}'" : '';
             $chBox = '';
             if ($evt['cbx']) {
                 $chBox .= strpos($evt['chd'], $date) ? $evt['cmk'] : '&#x2610;';
             }
             if ($chBox) {
                 $mayCheck = ($privs > 3 or $privs > 1 and $evt['uid'] == $_SESSION['uid']) ? true : false;
Example #9
0
*/
//sanity check
if (empty($lcV)) {
    exit('not permitted (' . substr(basename(__FILE__), 0, -4) . ')');
}
//launch via script only
//initialize
require './views/dw_functions.php';
$evtList = array();
$cD = $_SESSION['cD'];
$tcDate = mktime(12, 0, 0, substr($cD, 5, 2), substr($cD, 8, 2), substr($cD, 0, 4));
//Unix time of cD
$nextDay = date("Y-m-d", $tcDate + 86400);
$prevDay = date("Y-m-d", $tcDate - 86400);
/* display header*/
$header = "<span" . ($_SESSION['mobile'] ? '' : " class='viewHdr'") . '>' . makeD($cD, 5) . '</span>';
echo "<h4 class='floatC'><a class='noPrint' href='index.php?lc&amp;cD={$prevDay}'>&nbsp;&#9664;&nbsp;</a>{$header}<a class='noPrint' href='index.php?lc&amp;cD={$nextDay}'>&nbsp;&#9654;&nbsp;</a></h4>\n";
/* display day headers */
echo "<div" . ($_SESSION['mobile'] ? '' : " class='scrollBoxHead'") . ">\n\t<table class='grid'>\n\t<tr><th class='tCol'>{$xx['vws_time']}</th><th class='dCol'>{$xx['vws_events']}</th></tr>\n\t</table>\n</div>\n";
/* retrieve events */
retrieve($cD, $nextDay, 'guc');
/* display day */
echo "<div" . ($_SESSION['mobile'] ? '' : " class='scrollBoxDa'") . ">\n\t<table class='grid'>\n\t<tr>\n<td class='tCol tColBg'>\n";
showHours();
echo "</td>";
$dayBg = '';
$curSeq = 0;
if (!empty($evtList[$cD])) {
    //check day background should be set
    foreach ($evtList[$cD] as $evt) {
        if ($evt['dbg'] and $evt['seq'] > $curSeq) {
Example #10
0
}
//launch via script only
?>
<!DOCTYPE html>
<html lang="<?php 
echo ISOCODE;
?>
">
<head>
<meta charset="utf-8">
<title><?php 
echo $set['calendarTitle'] . ' - LogIn';
?>
</title>
<link rel="icon" href="lcal.ico">
<link rel="stylesheet" href="css/css.php" type="text/css">
<script src="common/toolbox.js"></script>
</head>

<body>
<header>
<?php 
echo "<span class='floatL'>{$set['calendarTitle']}</span><span class='floatR'>{$uname}</span><span>" . makeD(date("Y-m-d"), 5) . "</span>";
?>
</header>
<div class='navBar'>&nbsp;</div>
<div class='content'>
<?php 
if ($pageTitle) {
    echo "<br><h3 class='pageTitle'>{$pageTitle}</h3>\n";
}
Example #11
0
function cronSendChg()
{
    global $evtList, $emlStyle, $set, $xx, $changes;
    //initialize
    $sentTo = '';
    $evtList = array();
    $fromD = date("Y-m-d", mktime(12, 0, 0) - $set['chgNofDays'] * 86400);
    //start date
    $emlText = "<html>\n<head>\n<title>{$set['calendarTitle']} mailer</title>\n<style type='text/css'>\nbody, p, table {{$emlStyle}}\nh5 {font-size:13px;}\ntd {vertical-align:top;}\n</style>\n</head>\n<body>\n";
    //grab and process changed events
    grabChanges($fromD, 1);
    foreach ($evtList as $chDate => &$events) {
        $emlText .= "<h5>{$xx['chg_changed_on']} " . makeD($chDate, 5) . "</h5>\n";
        $emlText .= makeGrid($events);
        $changes += count($events);
    }
    if ($changes) {
        $period = $fromD != date('Y-m-d') ? makeD($fromD, 2) . " - " . makeD(date('Y-m-d'), 2) : makeD(date('Y-m-d'), 2);
        $emlText .= "<p><a href='{$set['calendarUrl']}'>{$xx['evt_open_calendar']}</a></p>\n</body>\n</html>\n";
        if ($set['chgEmailList']) {
            //email address(es) to notify
            $subject = "{$set['calendarTitle']} - {$xx['chg_changes']}: {$period}";
            $sent = sendMail($subject, $emlText, $set['chgEmailList']);
            $sentTo = $sent ? $sent : "Sending mail failed. See logs/luxcal.log for details";
        }
    }
    return $sentTo;
}
Example #12
0
     //check day background should be set
     foreach ($evtList[$cDate] as $evt) {
         if ($evt['dbg'] and $evt['seq'] > $curSeq) {
             $dayBg = " style='background:{$evt['cbg']}'";
             $curSeq = $evt['seq'];
         }
     }
 }
 if ($set['weeksToShow'] < 2) {
     //single month
     $dow = ($i < $sOffset or $i >= $eOffset) ? 'out' : ($dayNr > 5 ? 'we0' : 'wd0');
 } else {
     $dow = ($dayNr > 5 ? 'we' : 'wd') . strval($curM % 2);
     //alternate color per month
 }
 $day = $curD . $curM == "11" ? makeD($cDate, 2) : (($i == 0 or $curD == "1") ? makeD($cDate, 1) : ($set['monthInDCell'] ? makeD($cDate, 1, 'x3') : $curD));
 $class = ($curD == "1" or $curD . $curM == "11") ? 'firstDom' : 'dom';
 if (!$_SESSION['hdr']) {
     $day = "<span class='{$class} floatR'>{$day}</span>";
 } else {
     $day = "<span class='{$class} floatR hyper' onclick=\"goDay('{$cDate}');\" title=\"{$xx['vws_view_day']}\">{$day}</span>";
 }
 if ($cDate == date("Y-m-d")) {
     $dow .= ' today';
     $celcol = " style='background:#AA9944'";
 } elseif (isset($_SESSION['nD']) and $cDate == $_SESSION['nD']) {
     $dow .= ' slday';
 }
 $dHead = $privs > 1 ? " class='hyper' onclick=\"newE('{$cDate}');\" title=\"{$xx['vws_add_event']}\"" : '';
 if ($set['weeksToShow'] > 0 or $i >= $sOffset and $i < $eOffset) {
     //no single month or day inside
Example #13
0
//Unix time of end date
$eDate = date("Y-m-d", $eTime);
$parSep = strpos($set['calendarUrl'], '?cal=') ? '&amp;' : '?';
//? or &amp;
$evtList = array();
retrieve($sDate, $eDate, '', $filter);
//process events and send feeds
$evtDone = array();
if ($evtList) {
    foreach ($evtList as $date => &$events) {
        foreach ($events as &$evt) {
            if (!$evt['mde'] or !in_array($evt['eid'], $evtDone)) {
                //!mde or mde not processed
                $evtDone[] = $evt['eid'];
                $checkBx = strpos($evt['chd'], $date) ? $evt['cmk'] : '';
                $evtDate = $evt['mde'] ? makeD($evt['sda'], 5) . ' - ' . makeD($evt['eda'], 5) : makeD($date, 5);
                $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
                $feed = "<item>\n";
                $feed .= "<title>{$evtDate}: {$checkBx}{$evt['tit']}</title>\n";
                $feed .= "<link>{$set['calendarUrl']}{$parSep}cD={$date}</link>\n";
                $feed .= "<description>\n<![CDATA[\n";
                $feed .= "{$evtTime}\n";
                if ($set['details4All'] == 1) {
                    $feed .= '<br>' . makeE($evt, $set['evtTemplGen'], 'br', "<br>\n", '12345');
                }
                $feed .= "]]>\n</description>\n";
                $feed .= "<guid isPermaLink='false'>{$set['calendarUrl']}{$parSep}evt={$evt['eid']}&amp;{$date}</guid>\n";
                $feed .= "</item>\n";
                echo $feed;
            }
        }
Example #14
0
function upcoList()
{
    //make list with upcoming events
    global $xx, $set, $evtList;
    if ($set['navUpcoList']) {
        echo "<div id='upcoBar'>\n<div class='barHead move' onmousedown=\"dragMe('upcoBar',event)\">{$xx['hdr_upco_list']}<span class='floatR select' onclick=\"show('upcoBar')\">&nbsp;&#10060;&nbsp;</span></div>\n";
        $startD = $_SESSION['cD'];
        $eTime = mktime(12, 0, 0, substr($startD, 5, 2), substr($startD, 8, 2), substr($startD, 0, 4)) + ($set['lookaheadDays'] - 1) * 86400;
        //Unix time of end date
        $endD = date("Y-m-d", $eTime);
        retrieve($startD, $endD, 'guc');
        echo '<h6 class="floatC">' . IDtoDD($startD) . ' - ' . IDtoDD($endD) . "</h6>\n";
        //display events
        echo "<div class='barBody'>\n";
        if ($evtList) {
            $evtDone = array();
            $lastDate = '';
            foreach ($evtList as $date => &$events) {
                foreach ($events as $evt) {
                    if (!$evt['mde'] or !in_array($evt['eid'], $evtDone)) {
                        //!mde or mde not processed
                        $evtDone[] = $evt['eid'];
                        $evtDate = $evt['mde'] ? makeD($evt['sda'], 5) . " - " . makeD($evt['eda'], 5) : makeD($date, 5);
                        $evtTime = $evt['ald'] ? $xx['vws_all_day'] : ITtoDT($evt['sti']) . ($evt['eti'] ? ' - ' . ITtoDT($evt['eti']) : '');
                        $details = ($set['details4All'] == 1 or $set['details4All'] == 2 and $_SESSION['uid'] > 1 or $evt['mayE']);
                        $onClick = $details ? " class='point' onclick=\"editE({$evt['eid']},'{$date}');\"" : " class='arrow'";
                        if ($set['eventColor']) {
                            $eStyle = ($evt['cco'] ? "color:{$evt['cco']};" : '') . ($evt['cbg'] ? "background-color:{$evt['cbg']};" : '');
                        } else {
                            $eStyle = $evt['uco'] ? "background-color:{$evt['uco']};" : '';
                        }
                        $eStyle = $eStyle ? " style='{$eStyle}'" : '';
                        echo $lastDate != $evtDate ? "<h6>{$evtDate}</h6>\n" : '';
                        echo "<p>{$evtTime}</p><p{$onClick}{$eStyle}>&nbsp;&nbsp;{$evt['tit']}</p><br>\n";
                        $lastDate = $evtDate;
                    }
                }
            }
        } else {
            echo $xx['none'] . "\n";
        }
        echo "</div>\n</div>\n";
    }
}
Example #15
0
<link rel="stylesheet" href="css/css.php" type="text/css">
<script>
<?php 
//used by dtpicker.js
echo "var mode = \"{$mode}\";\nvar tFormat = \"{$set['timeFormat']}\";\nvar dFormat = \"{$set['dateFormat']}\";\nvar wStart = {$set['weekStart']};\nvar dwStartH = {$set['dwStartHour']};\nvar dwEndH = {$set['dwEndHour']};\nvar dpToday = \"{$xx['hdr_today']}\";\nvar dpClear = \"{$xx['hdr_clear']}\";\nvar dpMonths = new Array('", implode("','", $months), "');\nvar dpWkdays = new Array('", implode("','", $wkDays_m), "');\nvar dwTimeSlot = {$set['dwTimeSlot']};\n";
//used by dw_functions.php
?>
</script>
<script src="common/dtpicker.js"></script>
<script src="common/cpicker.js"></script>
<script src="common/toolbox.js"></script>
</head>

<body>
<?php 
echo "<header>\n\t<span class='floatL'>{$set['calendarTitle']}</span><span class='floatR'>{$uname}</span><span class='noPrint'>" . makeD(date("Y-m-d"), 5) . "</span>\n</header>\n";
echo "<div class=\"navBar noPrint\">\n\t<div class=\"floatR\">\n\t<button type='button' title=\"{$xx['hdr_back_to_cal']}\" onclick=\"window.location.href='index.php?lc&amp;cP=0'\">{$xx['hdr_calendar']}</button>\n\t<button type='button' title=\"{$xx['hdr_print_page']}\" onclick='printNice();'>{$xx['hdr_button_print']}</button>\n";
if ($privs >= 4) {
    //manager or admin rights
    echo "<select title=\"{$xx['hdr_select_admin_functions']}\" name='views' onchange='jumpMenu(this)'>\n\t<option value='#'>{$xx['hdr_admin']}&nbsp;</option>\n";
    if ($privs == 4) {
        //manager
        echo "<option value='index.php?lc&amp;cP=91'" . ($cP == "91" ? " selected='selected'>" : '>') . $xx['hdr_categories'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=92'" . ($cP == "92" ? " selected='selected'>" : '>') . $xx['hdr_users'] . "</option>\n";
    } else {
        //admin
        echo "<option value='index.php?lc&amp;cP=90'" . ($cP == "90" ? " selected='selected'>" : '>') . $xx['hdr_settings'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=91'" . ($cP == "91" ? " selected='selected'>" : '>') . $xx['hdr_categories'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=92'" . ($cP == "92" ? " selected='selected'>" : '>') . $xx['hdr_users'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=93'" . ($cP == "93" ? " selected='selected'>" : '>') . $xx['hdr_database'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=94'" . ($cP == "94" ? " selected='selected'>" : '>') . $xx['hdr_import_ics'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=95'" . ($cP == "95" ? " selected='selected'>" : '>') . $xx['hdr_export_ics'] . "</option>\n\t\t<option value='index.php?lc&amp;cP=96'" . ($cP == "96" ? " selected='selected'>" : '>') . $xx['hdr_import_csv'] . "</option>\n";
    }
    echo "</select> \n";
}
echo "<button type='button' title=\"{$xx['hdr_help']}\" onclick=\"help();\">" . ($set['navButText'] ? $xx['hdr_button_help'] : '&nbsp;?&nbsp;') . "</button>\n";
if ($_SESSION['uid'] == 1) {