function show_grouphistory($group_id)
{
    /*      
    	show the group_history rows that are relevant to 
    	this group_id
    */
    global $sys_datefmt;
    $result = group_get_history($group_id);
    $rows = db_numrows($result);
    if ($rows > 0) {
        echo '
		<H3>Group Change History</H3>
		<P>';
        $title_arr = array();
        $title_arr[] = 'Field';
        $title_arr[] = 'Old Value';
        $title_arr[] = 'Date';
        $title_arr[] = 'By';
        echo html_build_list_table_top($title_arr);
        for ($i = 0; $i < $rows; $i++) {
            $field = db_result($result, $i, 'field_name');
            echo '
			<TR BGCOLOR="' . html_get_alt_row_color($i) . '"><TD>' . $field . '</TD><TD>';
            if ($field == 'removed user') {
                echo user_getname(db_result($result, $i, 'old_value'));
            } else {
                echo db_result($result, $i, 'old_value');
            }
            echo '</TD>' . '<TD>' . date($sys_datefmt, db_result($result, $i, 'date')) . '</TD>' . '<TD>' . db_result($result, $i, 'user_name') . '</TD></TR>';
        }
        echo '	 
		</TABLE>';
    } else {
        echo '  
		<H3>No Changes Have Been Made to This Group</H3>';
    }
}
Exemplo n.º 2
0
function show_grouphistory($group_id)
{
    /*	  
    	show the group_history rows that are relevant to 
    	this group_id
    */
    $result = group_get_history($group_id);
    $rows = db_numrows($result);
    if ($rows > 0) {
        echo '
		<h3>' . _('Group Change History') . '</h3>
		<p/>';
        $title_arr = array();
        $title_arr[] = _('Field');
        $title_arr[] = _('Old Value');
        $title_arr[] = _('Date');
        $title_arr[] = _('By');
        echo $GLOBALS['HTML']->listTableTop($title_arr);
        for ($i = 0; $i < $rows; $i++) {
            $field = db_result($result, $i, 'field_name');
            echo '
			<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle($i) . '><td>' . $field . '</td><td>';
            if ($field == 'removed user') {
                echo user_getname(db_result($result, $i, 'old_value'));
            } else {
                echo db_result($result, $i, 'old_value');
            }
            echo '</td>' . '<td>' . date(_('Y-m-d H:i'), db_result($result, $i, 'adddate')) . '</td>' . '<td>' . db_result($result, $i, 'user_name') . '</td></tr>';
        }
        echo $GLOBALS['HTML']->listTableBottom();
    } else {
        echo '  
		<h3>' . _('No changes') . '</h3>';
    }
}