3 * GForge Cron Viewing Page
5 * Copyright 2002 GForge, LLC
8 * This file is part of GForge.
10 * GForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * GForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with GForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once $gfwww.'include/pre.php';
28 require_once $gfwww.'admin/admin_utils.php';
29 require_once $gfcommon.'include/cron_utils.php';
31 site_admin_header(array('title'=>_('Site admin')));
33 $which = getIntFromRequest('which');
35 if (!$which || $which==100) {
39 $sql_str = " WHERE job='$which' ";
43 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
44 <?php echo html_build_select_box_from_arrays(array_keys($cron_arr), $cron_arr, 'which', $which,true,'Any'); ?>
45 <input type="submit" name="submit" value="<?php echo _('Submit');?>">
55 echo $HTML->listTableTop ($title_arr);
57 $sql = 'SELECT COUNT(*) AS count FROM cron_history '.$sql_str;
58 $res = db_query($sql);
59 $totalCount = db_result($res, 0, 'count');
61 $offset = getIntFromRequest('offset');
62 if($offset > $totalCount) {
66 $sql = 'SELECT * FROM cron_history '.$sql_str.' ORDER BY rundate DESC LIMIT '.ADMIN_CRONMAN_ROWS.' OFFSET '.$offset;
67 $res = db_query($sql);
69 for ($i=0; $i<db_numrows($res); $i++) {
71 echo '<tr '. $HTML->boxGetAltRowStyle($i+1) .'>
72 <td>'. date(_('Y-m-d H:i'), db_result($res,$i,'rundate')).'</td>
73 <td>'. $cron_arr[db_result($res,$i,'job')].'</td>
74 <td>'. nl2br(db_result($res,$i,'output')).'</td></tr>';
78 echo $HTML->listTableBottom();
80 if($totalCount > ADMIN_CRONMAN_ROWS) {
83 <table class="tablegetmore" width="100%" cellpadding="5" cellspacing="0">
87 $previousUrl = 'cronman.php?which='.$which.'&offset='.($offset - ADMIN_CRONMAN_ROWS);
88 echo '<a href="'.$previousUrl.'" class="prev">'
89 . html_image('t2.png', '15', '15', array('border'=>'0','align'=>'middle'))
90 . ' '._('Previous').'</a>';
94 echo '</td><td align="right">';
95 if ($totalCount > $offset + ADMIN_CRONMAN_ROWS) {
96 $nextUrl = 'cronman.php?which='.$which.'&offset='.($offset + ADMIN_CRONMAN_ROWS);
97 echo '<a href="'.$nextUrl.'" class="next">'
99 . html_image('t.png', '15', '15', array('border'=>'0','align'=>'middle')) . '</a>';
109 site_admin_footer(array());
113 // c-file-style: "bsd"