for ($i=1; $i<=$num_pages; $i++) { if ($i == $page) { echo '<span class="forum-paginator-active">'.$i.'</span>'; } else { echo '<a href="'.url_rewrite($_SERVER['PHP_SELF'].'?fid='.$fid.SEP.'pid='.$pid.SEP.'page='.$i.SEP.'order='.$_SESSION['thread_order']).'">'.$i.'</a>'; } if ($i<$num_pages){ echo ' <span class="spacer">|</span> '; } } echo '</div>'; echo '<ul class="forum-thread">'; while ($row = mysql_fetch_assoc($result)) { print_entry($row); $subject = $row['subject']; if ($_GET['reply'] == $row['post_id']) { $saved_post = $row; } } echo '</ul>'; echo '<div class="forum-paginator">'; echo _AT('page').': '; for ($i=1; $i<=$num_pages; $i++) { if ($i == $page) { echo '<span class="forum-paginator-active">'.$i.'</span>'; } else { echo '<a href="'.url_rewrite($_SERVER['PHP_SELF'].'?fid='.$fid.SEP.'pid='.$pid.SEP.'page='.$i.SEP.'order='.$_SESSION['thread_order']).'">'.$i.'</a>'; }
function print_date_entries($date, $user, $hide_icons, $ssi) { global $events, $readonly, $is_admin, $public_access, $public_access_can_add; $cnt = 0; $get_unapproved = $GLOBALS["DISPLAY_UNAPPROVED"] == "Y"; // public access events always must be approved before being displayed if ($user == "__public__") { $get_unapproved = false; } $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); $dateu = mktime(3, 0, 0, $month, $day, $year); $can_add = $readonly == "N" || $is_admin; if ($public_access == "Y" && $public_access_can_add != "Y" && $user == "__public__") { $can_add = false; } if (!$hide_icons && !$ssi && $can_add) { print "<A HREF=\"edit_entry.php?"; if (strcmp($user, $GLOBALS["login"])) { print "user={$user}&"; } print "date={$date}\">" . "<IMG SRC=\"new.gif\" WIDTH=\"10\" HEIGHT=\"10\" ALT=\"" . translate("New Entry") . "\" BORDER=\"0\" ALIGN=\"right\">" . "</A>"; $cnt++; } if (!$ssi) { echo "<FONT SIZE=\"-1\"><A CLASS=\"dayofmonth\" HREF=\"day.php?"; if (strcmp($user, $GLOBALS["login"])) { echo "user={$user}&"; } echo "date={$date}\">{$day}</A></FONT>"; if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y" && date("w", $dateu) == $GLOBALS["WEEK_START"]) { echo "<A HREF=\"week.php?date={$date}"; if (strcmp($user, $GLOBALS["login"])) { echo "&user={$user}"; } echo "\" CLASS=\"weeknumber\">"; echo "<FONT SIZE=\"-2\" CLASS=\"weeknumber\">(" . translate("Week") . " " . week_number($dateu) . ")</FONT></A>"; } print "<BR>\n"; $cnt++; } // get all the repeating events for this date and store in array $rep $rep = get_repeating_entries($user, $date); $cur_rep = 0; // get all the non-repeating events for this date and store in $ev $ev = get_entries($user, $date); for ($i = 0; $i < count($ev); $i++) { // print out any repeating events that are before this one... while ($cur_rep < count($rep) && $rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time']) { if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') { if (!empty($rep[$cur_rep]['cal_ext_for_id'])) { $viewid = $rep[$cur_rep]['cal_ext_for_id']; $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $rep[$cur_rep]['cal_id']; $viewname = $rep[$cur_rep]['cal_name']; } print_entry($viewid, $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $hide_icons); $cnt++; } $cur_rep++; } if ($get_unapproved || $ev[$i]['cal_status'] == 'A') { if (!empty($ev[$i]['cal_ext_for_id'])) { $viewid = $ev[$i]['cal_ext_for_id']; $viewname = $ev[$i]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $ev[$i]['cal_id']; $viewname = $ev[$i]['cal_name']; } print_entry($viewid, $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $viewname, $ev[$i]['cal_description'], $ev[$i]['cal_status'], $ev[$i]['cal_priority'], $ev[$i]['cal_access'], $ev[$i]['cal_login'], $hide_icons); $cnt++; } } // print out any remaining repeating events while ($cur_rep < count($rep)) { if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') { if (!empty($rep[$cur_rep]['cal_ext_for_id'])) { $viewid = $rep[$cur_rep]['cal_ext_for_id']; $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $rep[$cur_rep]['cal_id']; $viewname = $rep[$cur_rep]['cal_name']; } print_entry($viewid, $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $hide_icons); $cnt++; } $cur_rep++; } if ($cnt == 0) { echo " "; } // so the table cell has at least something }
/** * Prints all the calendar entries for the specified user for the specified date. * * If we are displaying data from someone other than * the logged in user, then check the access permission of the entry. * * @param string $date Date in YYYYMMDD format * @param string $user Username * @param bool $ssi Is this being called from week_ssi.php? */ function print_date_entries($date, $user, $ssi) { global $events, $readonly, $is_admin, $login, $public_access, $public_access_can_add, $cat_id; $cnt = 0; $get_unapproved = $GLOBALS["DISPLAY_UNAPPROVED"] == "Y"; // public access events always must be approved before being displayed if ($user == "__public__") { $get_unapproved = false; } $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); $dateu = mktime(3, 0, 0, $month, $day, $year); $can_add = $readonly == "N" || $is_admin; if ($public_access == "Y" && $public_access_can_add != "Y" && $login == "__public__") { $can_add = false; } if ($readonly == 'Y') { $can_add = false; } if (!$ssi && $can_add) { print "<a title=\"" . translate("New Entry") . "\" href=\"edit_entry.php?"; if (strcmp($user, $GLOBALS["login"])) { print "user={$user}&"; } if (!empty($cat_id)) { print "cat_id={$cat_id}&"; } print "date={$date}\"><img src=\"new.gif\" alt=\"" . translate("New Entry") . "\" class=\"new\" /></a>"; $cnt++; } if (!$ssi) { echo "<a class=\"dayofmonth\" href=\"day.php?"; if (strcmp($user, $GLOBALS["login"])) { echo "user={$user}&"; } if (!empty($cat_id)) { echo "cat_id={$cat_id}&"; } echo "date={$date}\">{$day}</a>"; if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y" && date("w", $dateu) == $GLOBALS["WEEK_START"]) { echo " <a title=\"" . translate("Week") . " " . week_number($dateu) . "\" href=\"week.php?date={$date}"; if (strcmp($user, $GLOBALS["login"])) { echo "&user={$user}"; } if (!empty($cat_id)) { echo "&cat_id={$cat_id}"; } echo "\" class=\"weeknumber\">"; echo "(" . translate("Week") . " " . week_number($dateu) . ")</a>"; } print "<br />\n"; $cnt++; } // get all the repeating events for this date and store in array $rep $rep = get_repeating_entries($user, $date, $get_unapproved); $cur_rep = 0; // get all the non-repeating events for this date and store in $ev $ev = get_entries($user, $date, $get_unapproved); for ($i = 0; $i < count($ev); $i++) { // print out any repeating events that are before this one... while ($cur_rep < count($rep) && $rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time']) { if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') { if (!empty($rep[$cur_rep]['cal_ext_for_id'])) { $viewid = $rep[$cur_rep]['cal_ext_for_id']; $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $rep[$cur_rep]['cal_id']; $viewname = $rep[$cur_rep]['cal_name']; } print_entry($viewid, $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $rep[$cur_rep]['cal_category']); $cnt++; } $cur_rep++; } if ($get_unapproved || $ev[$i]['cal_status'] == 'A') { if (!empty($ev[$i]['cal_ext_for_id'])) { $viewid = $ev[$i]['cal_ext_for_id']; $viewname = $ev[$i]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $ev[$i]['cal_id']; $viewname = $ev[$i]['cal_name']; } print_entry($viewid, $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $viewname, $ev[$i]['cal_description'], $ev[$i]['cal_status'], $ev[$i]['cal_priority'], $ev[$i]['cal_access'], $ev[$i]['cal_login'], $ev[$i]['cal_category']); $cnt++; } } // print out any remaining repeating events while ($cur_rep < count($rep)) { if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') { if (!empty($rep[$cur_rep]['cal_ext_for_id'])) { $viewid = $rep[$cur_rep]['cal_ext_for_id']; $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $rep[$cur_rep]['cal_id']; $viewname = $rep[$cur_rep]['cal_name']; } print_entry($viewid, $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $rep[$cur_rep]['cal_category']); $cnt++; } $cur_rep++; } if ($cnt == 0) { echo " "; } // so the table cell has at least something }
function print_date_entries($date, $user, $ssi = false) { global $cat_id, $DISPLAY_TASKS_IN_GRID, $DISPLAY_UNAPPROVED, $events, $is_admin, $is_nonuser, $login, $PUBLIC_ACCESS, $PUBLIC_ACCESS_CAN_ADD, $readonly, $tasks, $WEEK_START; static $newEntryStr; if (empty($newEntryStr)) { $newEntryStr = translate('New Entry'); } $cnt = 0; $get_unapproved = $DISPLAY_UNAPPROVED == 'Y'; $moons = getMoonPhases(substr($date, 0, 4), substr($date, 4, 2)); $ret = ''; $can_add = $readonly == 'N' || $is_admin; if ($PUBLIC_ACCESS == 'Y' && $PUBLIC_ACCESS_CAN_ADD != 'Y' && $login == '__public__') { $can_add = false; } if ($readonly == 'Y') { $can_add = false; } if ($is_nonuser) { $can_add = false; } if (!$ssi) { /* translate ( 'First Quarter Moon') translate ( 'Full Moon' ) translate ( 'Last Quarter Moon') translate ( 'New Moon' ) */ $userCatStr = (strcmp($user, $login) ? 'user='******'&' : '') . (empty($cat_id) ? '' : 'cat_id=' . $cat_id . '&'); if (!empty($moons[$date])) { $tmp = $moons[$date]; } $moon_title = empty($tmp) ? '' : translate(ucfirst($tmp) . (strpos('fullnew', $tmp) !== false ? '' : ' Quarter') . ' Moon'); $ret = ($can_add ? ' <a title="' . $newEntryStr . '" href="edit_entry.php?' . $userCatStr . 'date=' . $date . '"><img src="images/new.png" alt="' . $newEntryStr . '" class="new" /></a>' : '') . ' <a class="dayofmonth" href="day.php?' . $userCatStr . 'date=' . $date . '">' . substr($date, 6, 2) . '</a>' . (empty($tmp) ? '' : '<img src="images/' . $tmp . 'moon.gif" title="' . $moon_title . '" alt="' . $moon_title . '" />') . "<br />\n"; $cnt++; } // Get, combime and sort the events for this date. $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date, $get_unapproved)); // If wanted, get all due tasks for this date. if ((empty($DISPLAY_TASKS_IN_GRID) || $DISPLAY_TASKS_IN_GRID == 'Y') && $date >= date('Ymd')) { $ev = combine_and_sort_events($ev, get_tasks($date, $get_unapproved)); } for ($i = 0, $evCnt = count($ev); $i < $evCnt; $i++) { if ($get_unapproved || $ev[$i]->getStatus() == 'A') { $ret .= print_entry($ev[$i], $date); $cnt++; } } if ($cnt == 0) { $ret .= ' '; } // So the table cell has at least something. return $ret; }
function list_directory($display_name, $path) { global $localconfig; // Allow local configuration file to override any of these globals. global $mimetype, $disposition, $cacheable, $ignore, $recurse, $indexfile; // And these locals. $title = ''; $annotation = ''; if (file_exists("{$path}/{$localconfig}")) { include "{$path}/{$localconfig}"; } $handle = @opendir($path) or die("Directory {$display_name} not found."); $files = array(); $subdirs = array(); while ($entry = readdir($handle)) { if (is_indexfile($entry)) { closedir($handle); send_file("{$path}/{$entry}"); return; } elseif ($entry != '..' && $entry != '.' && !is_ignored($entry)) { if (!is_dir("{$path}/{$entry}")) { $files[] = $entry; } elseif ($recurse) { $subdirs[] = $entry; } } } closedir($handle); sort_array($files); sort_array($subdirs); open_doc($title); announce_directory($display_name, $title, $annotation); print "<table width=\"100%\" border=0 cellspacing=1 cellpadding=2>\n"; for ($s = reset($subdirs); $s; $s = next($subdirs)) { print_entry("{$s}/", '(dir)', ' '); } for ($s = reset($files); $s; $s = next($files)) { print_entry($s, solidify(pretty_size(filesize("{$path}/{$s}"))), solidify(pretty_date(filemtime("{$path}/{$s}")))); } print "</table>\n"; close_doc(); }
require "../settings.php"; require "../core-settings.php"; require "bank-pay-supp-write.php"; if (isset($_POST["key"])) { switch ($_POST["key"]) { case "search": $OUTPUT = show_entries($_POST); break; case "confirm": $OUTPUT = process_entries($_POST); break; default: $OUTPUT = get_filter(); } } elseif (isset($_GET["supid"])) { $OUTPUT = print_entry($_GET); } else { $OUTPUT = get_filter(); } require "../template.php"; function get_filter() { $display = "\n\t\t<h2>Select Date Range For Listing</h2>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='search'>\n\t\t\t<tr>\n\t\t\t\t<th colspan='2'>Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>\n\t\t\t\t\t" . mkDateSelect("from", date("Y"), date("m"), "01") . "\n\t\t\t\t\tTo\n\t\t\t\t\t" . mkDateSelect("to") . "\n\t\t\t\t</td>\n\t\t\t\t<td><input type='submit' value='View'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>"; return $display; } function show_entries($_POST, $err = "") { extract($_POST); $fromdate = "{$from_year}-{$from_month}-{$from_day}"; $todate = "{$to_year}-{$to_month}-{$to_day}"; db_connect();
} # what is the current id if (isset($_REQUEST['id'])) { $id = $_REQUEST['id']; } else { header("Location: index.php"); die('need an id'); } # Make sure we can get here. if ($sections[$table]['level']['edit'] < get_page_acccess_level() && ($table != "users" || $id != get_userid())) { #header("Location: {$matches[1]}/index.php"); die("Not authorized. " . get_userid()); } # print top print_header($table); print_menu($section); # print form to edit entry $msg = print_entry($id, $table, false); # list files associated if ($section['files']) { $tmp = show_files($id, $table, false); if ($msg == "") { $msg = $tmp; } else { if ($tmp != "") { $msg = "{$msg}<br/>{$tmp}"; } } } # print footer of html print_footer($msg);
require "common.php"; # find the table $table = isset($_REQUEST['table']) ? $_REQUEST['table'] : ""; $section = $sections[$table]; if (empty($section)) { #header("Location: index.php"); die("Invalid table."); } # what is the current id if (isset($_REQUEST['id'])) { $id = $_REQUEST['id']; } else { #header("Location: index.php"); die('need an id'); } # Make sure we can get here. if ($sections[$table]['level']['show'] < get_page_acccess_level() && ($table != "users" || $id != get_userid())) { #header("Location: index.php"); die("Not authorized."); } # print top print_header($table); print_menu($section); # print form to show entry print_entry($id, $table, true); # list files associated if ($section['files']) { show_files($id, $table, true); } # print footer of html print_footer();
</select></td> </tr> </table></td> </tr> <tr> <td><?php if ($set_sem) { $_SESSION['semester'] = $semester; print_entry($res); } ?> </td> </tr> </table> </body> </html>