Beispiel #1
0
function tests_news() {
	global $db, $enrolled_courses, $system_courses;
	$news = array();

	if ($enrolled_courses == ''){
		return $news;
	} 
	$sql = "SELECT T.test_id, T.course_id, T.title, T.start_date as start_date, UNIX_TIMESTAMP(T.start_date) AS sd, UNIX_TIMESTAMP(T.end_date) AS ed 
          FROM ".TABLE_PREFIX."tests T, ".TABLE_PREFIX."tests_questions_assoc Q 
         WHERE Q.test_id=T.test_id 
           AND T.course_id IN $enrolled_courses 
         GROUP BY T.test_id 
         ORDER BY T.start_date DESC";
	$result = mysql_query($sql, $db);
	if($result){
		while($row = mysql_fetch_assoc($result)){
			//show only the visible tests
			if ( ($row['sd'] <= time()) && ($row['ed'] >= time())){
				$news[] = array('time'=>$row['start_date'], 
								'object'=>$row,
								'alt'=>_AT('tests'),
								'course'=>$system_courses[$row['course_id']]['title'],
								'thumb'=>'images/home-tests_sm.png',
								'link'=>'<a href="bounce.php?course='.$row['course_id'].'&p='.urlencode('mods/_standard/tests/test_intro.php?tid='.$row['test_id']).'" '
										.(strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="'.$row['title'].'"' : '') .'>'
										.validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a> <small>('._AT('start_date').':'.AT_DATE('%F %j, %g:%i',$row['start_date']).')</small>');
			}
		}
	}
	return $news;
}
Beispiel #2
0
function assignments_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'assignments WHERE course_id IN ' . $enrolled_courses . ' ORDER BY date_due DESC';
    $result = mysql_query($sql, $db);
    if ($result) {
        while ($row = mysql_fetch_assoc($result)) {
            $news[] = array('time' => $row['date_due'], 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'alt' => _AT('assignment'), 'thumb' => 'images/home-forums_sm.png', 'link' => _AT('assignment_due', $row['title'], '<small>' . AT_DATE('%F %j, %g:%i', $row['date_due']) . '</small>'));
        }
    }
    return $news;
}
Beispiel #3
0
function assignments_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT * FROM %sassignments WHERE course_id IN %s ORDER BY date_due DESC';
    $rows_assignments = queryDB($sql, array(TABLE_PREFIX, $enrolled_courses));
    if (count($rows_assignments) > 0) {
        foreach ($rows_assignments as $row) {
            $news[] = array('time' => $row['date_due'], 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'alt' => _AT('assignment'), 'thumb' => 'images/home-forums_sm.png', 'link' => _AT('assignment_due', $row['title'], '<small>' . AT_DATE('%F %j, %g:%i', $row['date_due']) . '</small>'));
        }
    }
    return $news;
}
Beispiel #4
0
function tests_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT T.test_id, T.course_id, T.title, T.start_date as start_date, UNIX_TIMESTAMP(T.start_date) AS sd, UNIX_TIMESTAMP(T.end_date) AS ed \n          FROM %stests T, %stests_questions_assoc Q \n         WHERE Q.test_id=T.test_id \n           AND T.course_id IN %s \n         GROUP BY T.test_id \n         ORDER BY T.start_date DESC";
    $rows_tests = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_tests) > 0) {
        foreach ($rows_tests as $row) {
            //show only the visible tests
            if ($row['sd'] <= time() && $row['ed'] >= time()) {
                $news[] = array('time' => $row['start_date'], 'object' => $row, 'alt' => _AT('tests'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-tests_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/tests/test_intro.php?tid=' . $row['test_id']) . '" ' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a> <small>(' . _AT('start_date') . ':' . AT_DATE('%F %j, %g:%i', $row['start_date']) . ')</small>');
            }
        }
    }
    return $news;
}
</dd>

			<dt><?php 
echo _AT('created_date');
?>
</dt>
			<dd><?php 
echo AT_DATE(_AT('startend_date_long_format'), $this->group_obj->getCreatedDate(), AT_DATE_MYSQL_DATETIME);
?>
</dd>

			<dt><?php 
echo _AT('group_last_updated');
?>
</dt>
			<dd><?php 
echo AT_DATE(_AT('startend_date_long_format'), $this->group_obj->getLastUpdated(), AT_DATE_MYSQL_DATETIME);
?>
</dd>

			<dt><?php 
echo _AT('number_of_members');
?>
</dt>
			<dd><?php 
echo count($this->group_obj->group_members);
?>
</dd>
		</dl>
	</div><br />
</div>
Beispiel #6
0
            echo $owner_arg_prefix . 'id=' . $id;
            ?>
" name="form">
				<input type="hidden" name="comment_id" value="<?php 
            echo $row['comment_id'];
            ?>
" />
				<div class="row">
					<a name="c<?php 
            echo $row['comment_id'];
            ?>
"></a><h4><?php 
            echo get_display_name($row['member_id']);
            ?>
 - <?php 
            echo AT_DATE(_AT('server_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME);
            ?>
</h4>
					<textarea rows="4" cols="40" name="edit_comment"><?php 
            echo htmlspecialchars($row['comment']);
            ?>
</textarea>
				</div>
				<div class="row buttons">
					<input type="submit" name="edit_submit" value="<?php 
            echo _AT('save');
            ?>
" />
					<input type="submit" name="edit_cancel" value="<?php 
            echo _AT('cancel');
            ?>
Beispiel #7
0
    $newscount = count($this->all_news);
    $num_pages = ceil($newscount / $perpage);
    $start = ($p - 1) * $perpage;
    $end = $p * $perpage;
    $page = isset(${$page}) ? $page : $p;
    print_paginator($page, $num_pages, '', 1);
    for ($i = $start; $i <= $end; $i++) {
        $count = $i;
        if (isset($this->all_news)) {
            echo '<ul class="current_list">';
            if (isset($this->all_news[$i]['thumb'])) {
                echo '<li><img src="' . $this->all_news[$i]['thumb'] . '" alt="' . $this->all_news[$i]['alt'] . '" title="' . $this->all_news[$i]['alt'] . '"/> ' . $this->all_news[$i]['link'] . ' <br />';
                if ($this->all_news[$i]['object']['course_id']) {
                    echo '<span class="current_list_date_time">' . 'Posted in&nbsp;' . '<a href="bounce.php?course=' . $this->all_news[$i]['object']['course_id'] . '">' . $this->all_news[$i]['course'] . '</a>';
                }
                echo '&nbsp;on&nbsp;' . AT_DATE('%F %j, %g:%i', $this->all_news[$i]['time']) . '</span></li>';
            }
            echo '</ul>';
        }
    }
    if ($perpage == count($this->all_news)) {
        ?>
	<div id="show-pages"><a href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?p=1"><?php 
        echo _AT('show_pages');
        ?>
</a></div>
    <?php 
    } else {
Beispiel #8
0
"><?php 
        echo $file;
        ?>
</label></td>
			<td>
				<?php 
        if ($file . '.html' == $this->admin['tranFile'] && $this->admin['produceTran']) {
            echo _AT('chat_currently_active');
        } else {
            echo _AT('chat_inactive');
        }
        ?>
			</td>
	
			<td><?php 
        echo AT_DATE(_AT('server_date_format'), $date);
        ?>
</td>
		</tr>
	<?php 
    }
    ?>
	</tbody>

	<tfoot>
	<tr>
		<td colspan="4"><input type="submit" name="view" value="<?php 
    echo _AT('view');
    ?>
" /> <input type="submit" name="delete" value="<?php 
    echo _AT('delete');
Beispiel #9
0
			<td><input type="radio" id="p_<?php 
        echo $row['poll_id'];
        ?>
" name="poll" value="<?php 
        echo $row['poll_id'];
        ?>
" /></td>
			<td><label for="p_<?php 
        echo $row['poll_id'];
        ?>
"><?php 
        echo AT_print($row['question'], 'polls.question');
        ?>
</label></td>
			<td><?php 
        echo AT_DATE(_AT("server_date_format"), $row['created_date']);
        ?>
</td>
			<td><?php 
        echo $row['total'];
        ?>
</td>
		</tr>
	<?php 
    } while ($row = mysql_fetch_assoc($this->result));
} else {
    ?>
	<tr>
		<td colspan="4"><?php 
    echo _AT('none_found');
    ?>
Beispiel #10
0
<?php

if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
require AT_INCLUDE_PATH . '../mods/_standard/forums/lib/forums.inc.php';
$record_limit = 3;
//Numero massimo dei possibili sottocontenuti visualizzabili nella home-page
$cnt = 0;
// count number of returned forums
$all_forums = get_forums($_SESSION['course_id']);
foreach ($all_forums as $shared => $forums) {
    if (is_array($forums)) {
        foreach ($forums as $row) {
            if ($cnt >= $record_limit) {
                break 2;
            }
            $cnt++;
            $link_title = AT_print($row['title'], 'forums.title') . ' (' . AT_DATE('%F %j, %g:%i', $row['last_post'], AT_DATE_MYSQL_DATETIME) . ')';
            $list[] = '<a href="' . url_rewrite('mods/_standard/forums/forum/index.php?fid=' . $row['forum_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . $link_title . '"' : '') . '>' . validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>';
        }
    }
}
if (count($list) > 0) {
    return $list;
} else {
    return 0;
}
Beispiel #11
0
        } else {
            ?>
				<span><?php 
            echo $this->job_obj->getCategoryNameById($row['categories']);
            ?>
</span>
				<?php 
        }
        ?>
				</td>
				<td><?php 
        echo AT_DATE(_AT("announcement_date_format"), $row['created_date']);
        ?>
</td>
				<td><?php 
        echo AT_DATE(_AT("announcement_date_format"), $row['closing_date']);
        ?>
</td>
			</tr>
			<?php 
    }
    ?>
			<?php 
} else {
    ?>
			<tr><td colspan="6"><?php 
    echo _AT('none_found');
    ?>
</td></tr>
			<?php 
}
Beispiel #12
0
    $start = ($p - 1) * $perpage;
    $end = $p * $perpage;
    $page = isset(${$page}) ? $page : '';
    print_paginator($page, $num_pages, '', 1);
    for ($i = $start; $i <= $end; $i++) {
        $count = $i;
        if (isset($this->all_news)) {
            echo '<ul class="current_list">' . "\n";
            if (isset($this->all_news[$i]['thumb'])) {
                $alt = isset($this->all_news[$i]['alt']) ? $this->all_news[$i]['alt'] : '';
                $link = isset($this->all_news[$i]['link']) ? $this->all_news[$i]['link'] : '';
                echo '<li><img src="' . $this->all_news[$i]['thumb'] . '" alt="' . $alt . '" title="' . $alt . '" class="img1616"/> ' . $link . ' <br />' . "\n";
                if (isset($this->all_news[$i]['object']['course_id'])) {
                    echo '<small>(<a href="bounce.php?course=' . $this->all_news[$i]['object']['course_id'] . '">' . $this->all_news[$i]['course'] . '</a>)|' . "\n";
                }
                echo '(' . AT_DATE('%F %j, %g:%i', $this->all_news[$i]['time']) . ')</small><hr style=""/></li>' . "\n";
            }
            echo '</ul>';
        }
    }
    if ($perpage == count($this->all_news)) {
        ?>
	<a href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?p=1"><?php 
        echo _AT('show_pages');
        ?>
</a>
    <?php 
    } else {
Beispiel #13
0
if ($row1 = mysql_fetch_row($result1)) {
					echo '<a href="mods/_standard/forums/forum/subscribe_forum.php?fid='.$row['forum_id'].SEP.'us=1">
							<br /><img border="0" src="'.AT_BASE_HREF.'images/unsubscribe-envelope.png" alt="" /> '._AT('unsubscribe1').'</a>';
						} else {
							echo '<a href="mods/_standard/forums/forum/subscribe_forum.php?fid='.$row['forum_id'].'">
							<br /><img border="0" src="'.AT_BASE_HREF.'images/subscribe-envelope.png" alt="" /> '._AT('subscribe1').'</a>';
						}
					} ?>
					<p><?php echo AT_print($row['description'], 'forums.description'); ?></p>
				</td>
				<td align="center" valign="top"><?php echo $row['num_topics']; ?></td>
				<td align="center" valign="top"><?php echo $row['num_posts']; ?></td>
				<td align="right" valign="top"><?php

					if ($row['last_post'] == '0000-00-00 00:00:00') {
						echo '<strong>'._AT('na').'</strong>';
					} else {
						echo AT_DATE(_AT('server_date_format'), $row['last_post'], AT_DATE_MYSQL_DATETIME);
					} ?>
				</td>
			</tr><?php
		endforeach;
	}
	echo '</tbody>';
} else {
	echo '<tr><td class="row1" colspan="4"><strong>'._AT('no_forums').'</strong></td></tr>';
}
echo '</table>';

require (AT_INCLUDE_PATH.'footer.inc.php');
?>