function notifyNow(&$evt, $what) { //notify added/edited/deleted event global $xx, $set, $nml, $apd, $app, $tit, $cid, $sda, $eda, $sti, $eti, $r_t, $ald, $chd, $uid, $repTxt; $emlStyle = "background:#FFFFDD; color:#000099; font:12px arial, sans-serif;"; //email body style definition //get category data $stH = stPrep("SELECT `name`,`color`,`bgColor`,`checkBx`,`checkLb`,`checkMk` FROM `categories` WHERE `ID` = ?"); stExec($stH, array($cid)); $row = $stH->fetch(PDO::FETCH_ASSOC); $stH = null; //compose email message $noteText = $what == 'add_exe' ? $xx['evt_event_added'] : ($what == 'upd_exe' ? $xx['evt_event_edited'] : $xx['evt_event_deleted']); $dateTime = $sda; if ($sti) { $dateTime .= ' ' . $xx['at_time'] . ' ' . $sti; } if ($eda or $eti) { $dateTime .= ' -'; } if ($eda) { $dateTime .= ' ' . $eda; } if ($eda and $eti) { $dateTime .= ' ' . $xx['at_time']; } if ($eti) { $dateTime .= ' ' . $eti; } $dateTime .= ($ald == 'all' ? ' ' . $xx['evt_all_day'] : '') . ($r_t ? ' (' . $repTxt . ')' : ''); $evD = DDtoID($sda); $status = ''; if (!$eda and !$r_t) { //no multi-day and not repeating if ($row['checkBx']) { $status .= $row['checkLb'] . ': ' . (strpos($chd, $evD) ? $row['checkMk'] : '- -'); } } $subject = "{$set['calendarTitle']} - {$noteText}: {$tit}"; $catColor = ($row['color'] ? "color:{$row['color']};" : "") . ($row['bgColor'] ? "background-color:{$row['bgColor']};" : ""); $eStyle = $catColor ? " style=\"{$catColor}\"" : ""; $eBoxStyle = ' style="padding-left:5px;' . (($app and !$apd) ? ' border-left:2px solid #ff0000;' : '') . '"'; $calUrl = $set['calendarUrl'] . (strpos($set['calendarUrl'], '?', 6) ? '&' : '?') . 'cD=' . $evD; $evtText = makeE($evt, $set['evtTemplGen'], 'td', '', '12345'); $msgText = "\n<html>\n<head>\n<title>{$set['calendarTitle']} {$xx['evt_mailer']}</title>\n<style type='text/css'>\nbody, p, table {{$emlStyle}}\ntd {vertical-align:top;}\n</style>\n</head>\n<body>\n<p>{$set['calendarTitle']} {$xx['evt_mailer']} " . IDtoDD(date("Y-m-d")) . "</p>\n<p>{$noteText}:</p>\n<table{$eBoxStyle}>\n\t<tr><td>{$xx['evt_title']}:</td><td><b><span{$eStyle}>{$tit}</span></b></td></tr>\n\t" . ($status ? "<tr><td>{$xx['evt_status']}:</td><td>{$status}</td></tr>" : '') . "\n\t<tr><td>{$xx['evt_date_time']}:</td><td>{$dateTime}</td></tr>\n\t{$evtText}\n</table>\n<p><a href='{$calUrl}'>{$xx['evt_open_calendar']}</a></p>\n</body>\n</html>\n"; //send notifications if ($nml) { //email address(es) to notify $sender = $set['notifSender'] ? $uid : 0; sendMail($subject, $msgText, $nml, $sender); } }
$eF = isset($_POST['eF']) ? $_POST['eF'] : array(0); //field filter if (isset($_POST['eF1'])) { $eF[] = 1; } if (isset($_POST['eF2'])) { $eF[] = 2; } if (isset($_POST['eF3'])) { $eF[] = 3; } $catName = isset($_POST["catName"]) ? $_POST["catName"] : ""; //category filter $fromDda = isset($_POST["fromDda"]) ? DDtoID($_POST["fromDda"]) : ""; //from event due date $tillDda = isset($_POST["tillDda"]) ? DDtoID($_POST["tillDda"]) : ""; //until event due date /* functions */ function catList($selCat) { global $xx; $where = ' WHERE status >= 0' . ($_SESSION['uid'] == 1 ? " AND public > 0" : ''); $rSet = dbQuery("SELECT name, color, background FROM [db]categories{$where} ORDER BY sequence"); if ($rSet !== false) { echo "<option value='*'>{$xx['sch_all_cats']} </option>\n"; while ($row = mysql_fetch_assoc($rSet)) { $row["name"] = stripslashes($row["name"]); $selected = $selCat == $row["name"] ? " selected='selected'" : ''; $catColor = ($row['color'] ? "color:" . $row['color'] . ";" : '') . ($row['background'] ? "background-color:" . $row['background'] . ";" : ''); echo "<option value=\"{$row["name"]}\"" . ($catColor ? " style='{$catColor}'" : '') . "{$selected}>{$row["name"]}</option>\n"; }
require './lang/ai-' . strtolower($adminLang) . '.php'; $fileName = isset($_POST['fileName']) ? $_POST['fileName'] : ''; //file name $fileDes = isset($_POST['fileDes']) ? stripslashes(strip_tags($_POST['fileDes'])) : ''; //file description $usrName = isset($_POST['usrName']) ? $_POST['usrName'] : ''; //user filter $catName = isset($_POST['catName']) ? $_POST['catName'] : ''; //category filter $fromDda = isset($_POST['fromDda']) ? DDtoID($_POST['fromDda']) : ''; //from event due date $fromMda = isset($_POST['fromMda']) ? DDtoID($_POST['fromMda']) : ''; //from event modified date $tillDda = isset($_POST['tillDda']) ? DDtoID($_POST['tillDda']) : ''; //untill event due date $tillMda = isset($_POST['tillMda']) ? DDtoID($_POST['tillMda']) : ''; //untill event modified date $meta = array(); //iCal meta data $calProps = array("PRODID", "VERSION"); //iCal properties and components of interest /* sub-functions */ function catList($selCat) { global $ax; $rSet = dbQuery("SELECT name, color, background FROM [db]categories WHERE status >= 0 ORDER BY sequence"); if ($rSet !== false) { echo "<option value='*'>{$ax['iex_all_cats']} </option>\n"; while ($row = mysql_fetch_assoc($rSet)) { $selected = $selCat == $row['name'] ? " selected='selected'" : ''; $catColor = ($row['color'] ? "color:{$row['color']};" : '') . ($row['background'] ? "background-color:{$row['background']};" : '');
echo "<h6><span{$eStyle}>{$evt['tix']}</span></h6>\n"; } if ($set['details4All'] == 1 or $set['details4All'] == 2 and $_SESSION['uid'] > 1 or $evt['mayE']) { echo makeE($evt, $set['evtTemplGen'], 'br', "<br>\n", '1234567') . "\n"; } 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;\">←</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);
//no access: force login //set user filter if (isset($_REQUEST['cU'])) { $_SESSION['cU'] = $_REQUEST['cU']; } elseif (!isset($_SESSION['cU'])) { $_SESSION['cU'] = array(0); } //set category filter if (isset($_REQUEST['cC'])) { $_SESSION['cC'] = $_REQUEST['cC']; } elseif (!isset($_SESSION['cC'])) { $_SESSION['cC'] = array(0); } //set current date if (isset($_REQUEST['nD'])) { $_SESSION['cD'] = $_SESSION['nD'] = DDtoID($_REQUEST['nD']); } elseif (isset($_GET['cD'])) { $_SESSION['cD'] = $_GET['cD']; } elseif (empty($_SESSION['cD'])) { $_SESSION['cD'] = date("Y-m-d"); } //set rss get-method filter $cF = "&cal={$calID}"; foreach ($_SESSION['cU'] as $usr) { if ($usr) { $cF .= '&cU%5B%5D=' . $usr; } } foreach ($_SESSION['cC'] as $cat) { if ($cat) { $cF .= '&cC%5B%5D=' . $cat;
function addEvents() { global $ax, $birthdayID, $dFormat, $tFormat; $msg = ''; $nofEvents = count($_POST['title']); $added = $dropped = 0; for ($i = 0; $i < $nofEvents; $i++) { if (empty($_POST['delete'][$i])) { $title = addslashes(strip_tags($_POST['title'][$i])); $venue = addslashes(strip_tags($_POST['venue'][$i])); $descr = addslashes(strip_tags($_POST['descr'][$i], '<a>')); //allow URLs $sDate = DDtoID($_POST['sDate'][$i], $dFormat); $eDate = $_POST['eDate'][$i] ? DDtoID($_POST['eDate'][$i], $dFormat) : "9999-00-00"; $sTime = DTtoIT($_POST['sTime'][$i], $tFormat); $eTime = $_POST['eTime'][$i] ? DTtoIT($_POST['eTime'][$i], $tFormat) : "99:00:00"; $catID = $_POST['catID'][$i] ? $_POST['catID'][$i] : 1; //no cat $rType = $rInterval = $rPeriod = $rMonth = 0; if (!empty($_POST['birthday'][$i]) or $catID == $birthdayID) { //birthday $rType = 1; $rInterval = 1; $rPeriod = 4; $eDate = "9999-00-00"; $catID = $birthdayID; } if (!eventInDb($title, $sDate, $eDate, $sTime, $eTime)) { //update events db $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'{$title}','{$descr}',DEFAULT,DEFAULT,{$catID},'{$venue}',{$_SESSION['uid']},DEFAULT,DEFAULT,DEFAULT,DEFAULT,'{$sDate}','{$eDate}',DEFAULT,'{$sTime}','{$eTime}',{$rType},{$rInterval},{$rPeriod},{$rMonth},DEFAULT,DEFAULT,DEFAULT,'" . date("Y-m-d H:i") . "', '" . date("Y-m-d H:i") . "',DEFAULT)"; $result = dbQuery($q); if (!$result) { $msg = $ax['iex_db_error']; } $added++; } else { $dropped++; } } } if (!$msg) { $msg = "{$added} {$ax['iex_events_added']}" . ($dropped > 0 ? " / {$dropped} {$ax['iex_events_dropped']}" : ''); } return $msg; }
//undelete } $nrAffected = mysql_affected_rows(); echo "<table class='fieldBoxFix'>\n\t\t<tr><td class='legend'> {$ax['mdb_events']} </td></tr>\n\t\t<tr><td>" . ($delevt ? $ax['mdb_deleted'] : $ax['mdb_undeleted']) . ": {$nrAffected}\n\t\t</table>\n"; } //init $msg = ''; $repair = empty($_POST["repair"]) ? 0 : 1; $compact = empty($_POST["compact"]) ? 0 : 1; $backup = empty($_POST["backup"]) ? 0 : 1; $restore = empty($_POST["restore"]) ? 0 : 1; $events = empty($_POST["events"]) ? 0 : 1; $delevt = empty($_POST["delevt"]) ? 0 : 1; $fromD = isset($_POST['fromD']) ? DDtoID($_POST['fromD']) : ''; //from event date $tillD = isset($_POST['tillD']) ? DDtoID($_POST['tillD']) : ''; //untill event date if ($fromD and $tillD and $fromD > $tillD) { $temp = $fromD; $fromD = $tillD; $tillD = $temp; } $mdb_exe = isset($_POST["mdb_exe"]) ? 1 : 0; //control logic if ($privs == 9) { if ($mdb_exe and (!$repair and !$compact and !$backup and !$restore and !$events)) { $msg = $ax['mdb_no_function_checked']; } echo "<br><p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n"; if (!$mdb_exe or !$repair and !$compact and !$backup and !$restore and !$events) { echo "<aside class='aside'>{$ax['xpl_manage_db']}</aside>\n\t\t\t<div class='centerBox'>\n";
function addEvents() { global $ax, $defcatID; $msg = ""; $nofEvents = count($_POST['title']); $added = $dropped = 0; for ($i = 0; $i < $nofEvents; $i++) { if (empty($_POST['delete'][$i]) and $_POST['r_t'][$i] >= 0) { //if delete not ticked and repeat-type is valid $title = mysql_real_escape_string(htmlspecialchars_decode(trim($_POST['title'][$i]))); $venue = mysql_real_escape_string(htmlspecialchars_decode(trim($_POST['venue'][$i]))); $descr = str_ireplace(array("\r\n", "\n", "\r"), "<br>", strip_tags(trim($_POST['descr'][$i]), '<a>')); //allow URLs and replace newline by <br> $descr = mysql_real_escape_string($descr); $sDate = DDtoID($_POST['sDate'][$i]); $eDate = $_POST['eDate'][$i] ? DDtoID($_POST['eDate'][$i]) : "9999-00-00"; $sTime = DTtoIT($_POST['sTime'][$i]); $eTime = $_POST['eTime'][$i] ? DTtoIT($_POST['eTime'][$i]) : "99:00:00"; $r_t = $_POST['r_t'][$i]; $r_i = $_POST['r_i'][$i]; $r_p = $_POST['r_p'][$i]; $r_m = $_POST['r_m'][$i]; $r_u = $_POST['r_u'][$i] ? DDtoID($_POST['r_u'][$i]) : "9999-00-00"; $catID = $_POST['catID'][$i] ? $_POST['catID'][$i] : 1; //no cat if (!eventInDb($title, $sDate, $eDate, $sTime, $eTime)) { //add event to db $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'{$title}','{$descr}',DEFAULT,DEFAULT,{$catID},'{$venue}',{$_SESSION['uid']},DEFAULT,DEFAULT,DEFAULT,DEFAULT,'{$sDate}','{$eDate}',DEFAULT,'{$sTime}','{$eTime}',{$r_t},{$r_i},{$r_p},{$r_m},'{$r_u}',DEFAULT,DEFAULT,'" . date("Y-m-d H:i") . "','" . date("Y-m-d H:i") . "',DEFAULT)"; $result = dbQuery($q); if (!$result) { $msg = $ax['iex_db_error']; } $added++; } else { $dropped++; } } } if (!$msg) { $msg = $added . " " . $ax['iex_events_added'] . ($dropped > 0 ? " / {$dropped} {$ax['iex_events_dropped']}" : ""); } return $msg; }
function addEvents() { global $ax, $birthdayID, $dFormat, $tFormat; $msg = ''; $nofEvents = count($_POST['title']); $added = $dropped = 0; for ($i = 0; $i < $nofEvents; $i++) { if (empty($_POST['ignore'][$i])) { $title = strip_tags($_POST['title'][$i]); $venue = strip_tags($_POST['venue'][$i]); $descr = strip_tags($_POST['descr'][$i], '<a>'); //allow URLs $descr = addUrlImgTags($descr, 'x-'); //add URL link tags $sDate = DDtoID($_POST['sDate'][$i], $dFormat); $eDate = $_POST['eDate'][$i] ? DDtoID($_POST['eDate'][$i], $dFormat) : "9999-00-00"; $sTime = DTtoIT($_POST['sTime'][$i], $tFormat); $eTime = $_POST['eTime'][$i] ? DTtoIT($_POST['eTime'][$i], $tFormat) : "99:00:00"; if (empty($sTime)) { //all day $sTime = '00:00'; $eTime = '23:59'; } $catID = $_POST['catID'][$i] ? $_POST['catID'][$i] : 1; //no cat $rType = $rInterval = $rPeriod = $rMonth = 0; if (!empty($_POST['birthday'][$i]) or $catID == $birthdayID) { //birthday $catID = $birthdayID; $rType = 1; $rInterval = 1; $rPeriod = 4; $eDate = "9999-00-00"; } if (!eventInDb($title, $sDate, $eDate, $sTime, $eTime)) { //add event to db $q = "INSERT INTO `events` (`title`,`venue`,`text1`,`catID`,`userID`,`sDate`,`eDate`,`sTime`,`eTime`,`rType`,`rInterval`,`rPeriod`,`rMonth`,`aDateTime`,`mDateTime`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $stH = stPrep($q); $result = stExec($stH, array($title, $venue, $descr, $catID, $_SESSION['uid'], $sDate, $eDate, $sTime, $eTime, $rType, $rInterval, $rPeriod, $rMonth, date("Y-m-d H:i"), date("Y-m-d H:i"))); if ($result) { $added++; } else { $msg = $ax['iex_db_error']; } } else { $dropped++; } } } if (!$msg) { $msg = "{$added} {$ax['iex_events_added']}" . ($dropped > 0 ? " / {$dropped} {$ax['iex_events_dropped']}" : ''); } return $msg; }
function addEvents() { global $ax, $defcatID; $msg = ""; $nofEvents = count($_POST['title']); $added = $dropped = 0; for ($i = 0; $i < $nofEvents; $i++) { if (empty($_POST['delete'][$i]) and $_POST['r_t'][$i] >= 0) { //if delete not ticked and repeat-type is valid $title = htmlspecialchars_decode(trim($_POST['title'][$i])); $venue = htmlspecialchars_decode(trim($_POST['venue'][$i])); $descr = strip_tags(trim($_POST['descr'][$i]), '<a>'); $descr = addUrlImgTags($descr, 'x-'); //add URL link tags $descr = str_ireplace(array("\r\n", "\n", "\r"), "<br>", $descr); //allow URLs and replace newline by <br> $sDate = DDtoID($_POST['sDate'][$i]); $eDate = $_POST['eDate'][$i] ? DDtoID($_POST['eDate'][$i]) : "9999-00-00"; $sTime = DTtoIT($_POST['sTime'][$i]); $eTime = $_POST['eTime'][$i] ? DTtoIT($_POST['eTime'][$i]) : "99:00:00"; if (empty($sTime)) { //all day $sTime = '00:00'; $eTime = '23:59'; } $r_t = $_POST['r_t'][$i]; $r_i = $_POST['r_i'][$i]; $r_p = $_POST['r_p'][$i]; $r_m = $_POST['r_m'][$i]; $r_u = $_POST['r_u'][$i] ? DDtoID($_POST['r_u'][$i]) : "9999-00-00"; $catID = $_POST['catID'][$i] ? $_POST['catID'][$i] : 1; //no cat if (!eventInDb($title, $sDate, $eDate, $sTime, $eTime)) { //add event to db $q = "INSERT INTO `events` (`title`,`venue`,`text1`,`catID`,`userID`,`sDate`,`eDate`,`sTime`,`eTime`,`rType`,`rInterval`,`rPeriod`,`rMonth`,`rUntil`,`aDateTime`,`mDateTime`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $stH = stPrep($q); $result = stExec($stH, array($title, $venue, $descr, $catID, $_SESSION['uid'], $sDate, $eDate, $sTime, $eTime, $r_t, $r_i, $r_p, $r_m, $r_u, date("Y-m-d H:i"), date("Y-m-d H:i"))); if ($result) { $added++; } else { $msg = $ax['iex_db_error']; } } else { $dropped++; } } } if (!$msg) { $msg = $added . " " . $ax['iex_events_added'] . ($dropped > 0 ? " / {$dropped} {$ax['iex_events_dropped']}" : ""); } return $msg; }