} if ($catid) { $res = $xoopsDB->query("SELECT * FROM " . TCAT . " WHERE catid={$catid} AND cuid={$uid}"); if (!$res || $xoopsDB->getRowsNum($res) == 0) { // invalid category ID redirect_header('category.php', 3, _NOPERM); exit; } $cat = $xoopsDB->fetchArray($res); $editid[$catid] = " edit"; } else { $cat = array('catid' => 0, 'cname' => '', 'description' => ''); } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = 'logtick_category.html'; set_logtick_breadcrumbs(array(_MD_CATEGORY_EDIT => 'category.php')); $xoopsTpl->assign('edit', $cat); $xoopsTpl->assign('uid', $uid); $cats = lt_get_categories($uid, 1); foreach ($editid as $id => $mark) { if (isset($cats[$id])) { $cats[$id]['class'] = $mark; } } $xoopsTpl->assign('categories', $cats); // not selected categories $res = $xoopsDB->query("SELECT c.* FROM " . TCAT . " c LEFT JOIN " . TUC . " ON uidref={$uid} AND catref=catid WHERE catref IS NULL ORDER BY cname"); $rests = array(); while ($data = $xoopsDB->fetchArray($res)) { $id = $data['catid']; $data['cname'] = htmlspecialchars($data['cname']);
$values[] = 'lspan=' . span2sec($myts->stripSlashesGPC($_POST['span'])); $res = $xoopsDB->query("UPDATE " . TLOG . " SET " . join(',', $values) . " WHERE logid=" . $logid); echo $xoopsDB->error(); redirect_header('index.php', 1, _MD_LOGTICK_STORED); exit; } else { if (isset($_POST['delete'])) { $logid = intval($_POST['logid']); $res = $xoopsDB->query("DELETE FROM " . TLOG . " WHERE logid={$logid}"); redirect_header('index.php', 1, _MD_LOGTICK_DELETED); exit; } } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = 'logtick_editlog.html'; set_logtick_breadcrumbs(array(_MD_LOGTICK_EDITLOG => 'index.php')); $res = $xoopsDB->query("SELECT * FROM " . TLOG . " WHERE logid={$logid}"); $data = $xoopsDB->fetchArray($res); $ptime = new pastTime(); $data['comment'] = htmlspecialchars($data['comment']); $data['lspan'] = htmlspecialchars($data['lspan']); $spans = lt_split_options($xoopsModuleConfig['timespans']); $span = $data['lspan']; foreach (array_keys($spans) as $v) { if (span2sec($v) == $span) { $data['span'] = $v; break; } } if (!isset($data['span'])) { $spans[$lspan] = $ptime->getSpan($lspan);
if ($comment) { // ignore no comment $xoopsDB->query("INSERT INTO " . TLOG . "(" . join(',', array_keys($values)) . ") VALUES (" . join(',', $values) . ")"); $after = 1; } if (isset($_POST['opt']) && empty($_POST['opt'])) { echo "<script>history.go(-1);</script>"; exit; } } if ($after) { utf8out(show_list($uid, $catid, $after)); } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = 'logtick_index.html'; set_logtick_breadcrumbs(); //$res = $xoopsDB->query("SELECT uid, uname FROM ".$xoopsDB->prefix('users'). // " WHERE uid IN (SELECT luid FROM ".TLOG." GROUP BY luid)"); $res = $xoopsDB->query("SELECT uid, uname FROM " . $xoopsDB->prefix('users') . " WHERE uid IN (" . get_exists_ids(TLOG, 'luid') . ")"); $users = array(); if ($res && $xoopsDB->getRowsNum($res)) { if (isset($_SESSION['logtick']['uids']) && empty($uid)) { $uid = $_SESSION['logtick']['uids']; } $uids = split(',', $uid); while ($user = $xoopsDB->fetchArray($res)) { $user['uname'] = htmlspecialchars($user['uname']); $user['checked'] = in_array($user['uid'], $uids); $users[] = $user; } }
$day = intval($_GET['d']); } if (!isset($_GET['m']) && !isset($_GET['d']) && $day < $bdef) { $month--; } if (!isset($_GET['d']) && time() < mktime($hour, $min)) { $day--; } include XOOPS_ROOT_PATH . '/header.php'; $xoopsOption['template_main'] = 'logtick_summary.html'; if (preg_match('/^\\d+$/', $uid)) { $title = sprintf(_MD_LOGTICK_SUMMARY, xoops_getLinkedUnameFromId($uid)); } else { $title = _MD_LOGTICK_SUM; } set_logtick_breadcrumbs(array(strip_tags($title) => 'summary.php')); $xoopsTpl->assign('title', $title); $sums = array(); get_summary($sums, $uid); $labs = array(_MD_SUM_TOTAL); if (is_numeric($uid)) { $cond = "luid={$uid}"; } elseif (preg_match('/^\\d+(,\\d+)+$/', $uid)) { $cond = "luid IN ({$uid})"; } else { $cond = "1"; } $res = $xoopsDB->query("SELECT min(mtime),max(mtime),1 FROM " . TLOG . " WHERE {$cond} GROUP BY 3"); list($stime, $ltime) = $xoopsDB->fetchRow($res); $legends = array(); $legends[_MD_SUM_TOTAL] = legend_range($stime, $ltime);