include 'header.php'; require 'perm.php'; $eid = param('eid'); $result = $xoopsDB->query('SELECT rvid FROM ' . RVTBL . " WHERE eid={$eid} AND exid=0", 1); if ($xoopsDB->getRowsNum($result) > 0) { redirect_header(empty($_SERVER['HTTP_REFERER']) ? EGUIDE_URL . '/admin.php' : $_SERVER['HTTP_REFERER'], 1, _NOPERM); } $event = fetch_event($eid, 0); if (!$event) { redirect_header(EGUIDE_URL . '/index.php', 2, _MD_NOEVENT); } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = EGPREFIX . '_editdate.html'; assign_module_css(); $edate = $event['edate']; $xoopsTpl->assign('event', edit_eventdata($event)); $paths = array(); if (!empty($event['title'])) { $paths[$event['title']] = "event.php?eid={$eid}"; } $paths[_MD_EDIT_EXTENT] = "editdate.php?eid={$eid}"; set_eguide_breadcrumbs($event['catid'], $paths); $myts =& MyTextSanitizer::getInstance(); $now = time(); $extents = get_extents($eid, true); $errors = array(); if (isset($_POST['adds'])) { $dels = empty($_POST['dels']) ? array() : $_POST['dels']; $mods = $_POST['mods']; $exps = $_POST['exps']; $adds = preg_split('/[\\n\\r]+/', trim($_POST['adds']));
} else { $errs[] = _MD_RESERV_FULL; } } } if (empty($data)) { redirect_header(EGUIDE_URL . "/index.php", 2, _MD_NOEVENT); exit; } $data['exid'] = $exid; $data['isadmin'] = true; $data['link'] = true; include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = EGPREFIX . '_entry.html'; assign_module_css(); edit_eventdata($data); $xoopsTpl->assign('event', $data); if ($errs) { $xoopsTpl->assign('errors', $errs); } // check pical exists $module_handler =& xoops_gethandler('module'); $module =& $module_handler->getByDirname(PICAL); if (is_object($module) && $module->getVar('isactive') == 1) { $xoopsTpl->assign('caldate', formatTimestamp($data['edate'], 'Y-m-d')); } // page title $xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name') . " | " . _MD_RESERVATION); if ($data['closedate'] < $now && !$data['past_register']) { if ($data['reservation']) { $xoopsTpl->assign('message', _MD_RESERV_CLOSE);
$result = $xoopsDB->query('SELECT ' . $fields . ' FROM ' . EGTBL . ' e LEFT JOIN ' . OPTBL . ' o ON e.eid=o.eid LEFT JOIN ' . EXTBL . " x ON e.eid=eidref\n WHERE {$cond} ORDER BY edate"); include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = EGPREFIX . '_collect.html'; assign_module_css(); $num = $xoopsDB->getRowsNum($result); $dateline = $timeline = $cells = $event = array(); $peid = 0; // prime event id while ($data = $xoopsDB->fetchArray($result)) { $edate = $data['edate']; $data['date'] = eventdate($edate); $day = formatTimestamp($edate, 'Y-m-d'); $time = formatTimestamp($edate, 'H:i'); $eid = $data['eid']; if (!isset($event[$eid])) { $event[$eid] = edit_eventdata($data); if (!$peid && $data['exid']) { $peid = $data['eid']; } } if (!isset($timeline[$time])) { $timeline[$time] = formatTimestamp($edate, _MD_STIME_FMT); } if (!isset($cells[$day])) { $cells[$day] = array(); $dateline[$day] = formatTimestamp($edate, _MD_SDATE_FMT); } if (isset($cells[$day][$time])) { $cells[$day][$time][] = $data; } else { $cells[$day][$time] = array($data);
$event['link'] = true; $event['expire'] = $event['edate'] - $event['closetime'] > $now; $more = 'event.php?eid=' . $event['eid']; $cid = $event['topicid']; if (isset($catlist[$cid])) { $event['catid'] = $cid; $event['catname'] = $catlist[$cid]['name']; $event['catimg'] = $catlist[$cid]['image']; } if (!empty($event['exid'])) { $event['extent'] = true; // also show editdate link $more .= '&sub=' . $event['exid']; } $event['detail'] = $more; edit_eventdata($event); $events[] = $event; } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = EGPREFIX . '_index.html'; $xoopsTpl->assign('events', $events); assign_module_css(); if (count($catlist) > 1) { foreach ($catlist as $id => $cat) { if ($cat['catpri']) { $catlist[$id]['name'] = '-- ' . $cat['name']; } } $xoopsTpl->assign('categories', array('options' => $catlist, 'action' => 'index.php', 'dirname' => basename(dirname(__FILE__)))); } if (empty($prev)) {
if ($data['email']) { $items[] = array('label' => _MD_EMAIL, 'value' => $myts->displayTarea($data['email'])); } if ($data['uid']) { $items[] = array('label' => _MD_UNAME, 'value' => display_username($data['uid'], true)); } if ($rvdata['operator']) { $items[] = array('label' => _MD_RESERV_REGISTER, 'value' => xoops_getLinkedUnameFromId($rvdata['operator'])); } $items[] = array('label' => _MD_STATUS, 'value' => $rv_stats[$data['status']]); $items[] = array('label' => _MD_ORDER_DATE, 'value' => formatTimestamp($data['rdate'], _MD_TIME_FMT)); foreach (unserialize_text($rvdata['info']) as $lab => $v) { $items[] = array('label' => $lab, 'value' => $myts->displayTarea($v)); } edit_eventdata($head); $xoopsTpl->assign('event', edit_eventdata($head)); $xoopsTpl->assign('items', $items); $xoopsTpl->assign('submit', $backanc); break; default: $xoopsOption['template_main'] = EGPREFIX . '_receipt.html'; $xoopsTpl->assign('lang_title', _MD_RESERVATION); $status = 0; $pat = $rep = array(); $pat[] = '{TITLE}'; $rep[] = $title; $pat[] = '{EVENT_URL}'; $rep[] = EGUIDE_URL . "/event.php?eid={$eid}" . ($exid ? "&sub={$exid}" : ''); $pat[] = '{REQ_UNAME}'; $rep[] = $xoopsUser->getVar('uname'); $template = file_get_contents(template_dir('confirm.tpl') . "/confirm.tpl");