Пример #1
0
                }
            }
            echo '</div>';
            print_paging_bar($matchcount, intval($table->get_page_start() / $perpage), $perpage, $baseurl . '&amp;', 'spage');
        }
        if ($matchcount > 0) {
            $usersprinted = array();
            foreach ($userlist as $user) {
                if (in_array($user->id, $usersprinted)) {
                    /// Prevent duplicates by r.hidden - MDL-13935
                    continue;
                }
                $usersprinted[] = $user->id;
                /// Add new user to the array of users printed
                $user = make_context_subobj($user);
                print_user($user, $course, $bulkoperations);
            }
        } else {
            print_heading(get_string('nothingtodisplay'));
        }
    }
} else {
    $countrysort = strpos($sort, 'country') !== false;
    $timeformat = get_string('strftimedate');
    if ($userlist) {
        // only show the plugin if multiple enrolment plugins
        // are enabled...
        if (strpos($CFG->enrol_plugins_enabled, ',') === false) {
            $showenrolplugin = true;
        } else {
            $showenrolplugin = false;
        echo lang_get('sponsors_list');
        ?>
</th>
		<td>
		<?php 
        echo sprintf(lang_get('total_sponsorship_amount'), sponsorship_format_amount($t_total_sponsorship));
        if (access_has_bug_level(config_get('view_sponsorship_details_threshold'), $f_bug_id)) {
            echo '<br /><br />';
            $i = 0;
            foreach ($t_sponsorship_ids as $id) {
                $t_sponsorship = sponsorship_get($id);
                $t_date_added = date(config_get('normal_date_format'), $t_sponsorship->date_submitted);
                echo $i > 0 ? '<br />' : '';
                $i++;
                echo sprintf(lang_get('label'), $t_date_added) . lang_get('word_separator');
                print_user($t_sponsorship->user_id);
                echo ' (' . sponsorship_format_amount($t_sponsorship->amount) . ')';
                if (access_has_bug_level(config_get('handle_sponsored_bugs_threshold'), $f_bug_id)) {
                    echo ' ' . get_enum_element('sponsorship', $t_sponsorship->paid);
                }
            }
        }
        ?>
		</td>
		</tr>
<?php 
    }
    ?>
</table>

<?php 
Пример #3
0
    print_avatar($t_bugnote->reporter_id);
    ?>
		<span class="small bugnote-permalink"><a rel="bookmark" href="<?php 
    echo string_get_bugnote_view_url($t_bugnote->bug_id, $t_bugnote->id);
    ?>
" title="<?php 
    echo lang_get('bugnote_link_title');
    ?>
"><?php 
    echo htmlentities(config_get_global('bugnote_link_tag')) . $t_bugnote_id_formatted;
    ?>
</a></span><br />

		<span class="bugnote-reporter">
		<?php 
    echo print_user($t_bugnote->reporter_id);
    ?>
		<span class="small access-level"><?php 
    if (user_exists($t_bugnote->reporter_id)) {
        $t_access_level = access_get_project_level(null, (int) $t_bugnote->reporter_id);
        // Only display access level when higher than 0 (ANYBODY)
        if ($t_access_level > ANYBODY) {
            echo '(', get_enum_element('access_levels', $t_access_level), ')';
        }
    }
    ?>
</span>
		</span>

		<?php 
    if (VS_PRIVATE == $t_bugnote->view_state) {
Пример #4
0
	</tr>
	<tr>
		<td class="nopad" width="20%">
			<table class="hide" cellspacing="1">
				<tr>
					<td class="print">
						(<?php 
        echo bugnote_format_id($t_row['id']);
        ?>
)
					</td>
				</tr>
				<tr>
					<td class="print">
						<?php 
        print_user($t_row['reporter_id']);
        ?>
&#160;&#160;&#160;
					</td>
				</tr>
				<tr>
					<td class="print">
						<?php 
        echo $t_date_submitted;
        ?>
&#160;&#160;&#160;
						<?php 
        if ($t_date_submitted != $t_last_modified) {
            echo '<br />(' . lang_get('last_edited') . lang_get('word_separator') . $t_last_modified . ')';
        }
        ?>
Пример #5
0
$rows = news_get_rows(helper_get_current_project());
# Loop through results
for ($i = 0; $i < sizeof($rows); $i++) {
    extract($rows[$i], EXTR_PREFIX_ALL, 'v');
    if (VS_PRIVATE == $v_view_state && !access_has_project_level(config_get('private_news_threshold'), $v_project_id)) {
        continue;
    }
    $v_headline = string_display($v_headline);
    $v_date_posted = date(config_get('complete_date_format'), $v_date_posted);
    $t_notes = array();
    $t_note_string = '';
    if (1 == $v_announcement) {
        array_push($t_notes, lang_get('announcement'));
    }
    if (VS_PRIVATE == $v_view_state) {
        array_push($t_notes, lang_get('private'));
    }
    if (sizeof($t_notes) > 0) {
        $t_note_string = '[' . implode(' ', $t_notes) . ']';
    }
    echo "<li><span class=\"italic-small\">{$v_date_posted}</span> - <span class=\"bold\"><a href=\"news_view_page.php?news_id={$v_id}\">{$v_headline}</a></span> <span class=\"small\"> ";
    print_user($v_poster_id);
    echo ' ' . $t_note_string;
    echo "</span></li>";
}
# end for loop
?>
</ul>

<?php 
html_page_bottom1(__FILE__);
Пример #6
0
 }
 if ($_GET['verbose']) {
     $verbose = $_GET['verbose'];
 } else {
     $verbose = 0;
 }
 if ($uuser->createip) {
     $sth = db_query("select * from u_users where createip = ? and aid != ?", array($uuser->createip, $uuser->aid));
     $u = $sth->fetch();
     if ($u) {
         echo "<h2>Accounts created from " . $uuser->createip . "</h2>\n";
         print_header();
         do {
             $bgcolor = $count % 2 ? "#F7F7F7" : "#ECECFF";
             $uu = new ForumUser($u['aid'], false);
             print_user($uu, get_stats($uu), $bgcolor);
             $count++;
         } while ($u = $sth->fetch());
         print_footer();
     }
     $sth->closeCursor();
 }
 echo "<h2>IP addresses</h2>\n";
 if ($verbose > 1) {
     $v2 = "class=selected";
 } else {
     if ($verbose > 0) {
         $v1 = "class=selected";
     } else {
         $v0 = "class=selected";
     }
Пример #7
0
	</tr>
	<tr>
		<td class="nopad" width="20%">
			<table class="hide" cellspacing="1">
				<tr>
					<td class="print">
						(<?php 
        echo bugnote_format_id($t_row->id);
        ?>
)
					</td>
				</tr>
				<tr>
					<td class="print">
						<?php 
        print_user($t_row->reporter_id);
        ?>
&#160;&#160;&#160;
					</td>
				</tr>
				<tr>
					<td class="print">
						<?php 
        echo $t_date_submitted;
        ?>
&#160;&#160;&#160;
						<?php 
        if ($t_date_submitted != $t_last_modified) {
            echo '<br />(' . lang_get('last_edited') . lang_get('word_separator') . $t_last_modified . ')';
        }
        ?>
Пример #8
0
	<td class="small-caption">
		<?php echo lang_get( 'field' ) ?>
	</td>
	<td class="small-caption">
		<?php echo lang_get( 'change' ) ?>
	</td>
</tr>
<?php
	foreach ( $t_history as $t_item ) {
?>
<tr <?php echo helper_alternate_class() ?>>
	<td class="small-caption">
		<?php echo $t_item['date'] ?>
	</td>
	<td class="small-caption">
		<?php print_user( $t_item['userid'] ) ?>
	</td>
	<td class="small-caption">
		<?php echo string_display( $t_item['note'] ) ?>
	</td>
	<td class="small-caption">
		<?php echo ( $t_item['raw'] ? string_display_line_links( $t_item['change'] ) : $t_item['change'] ) ?>
	</td>
</tr>
<?php
	} # end for loop
?>
</table>
<?php
	collapse_closed( 'history' );
?>
        echo lang_get('users_monitoring_bug');
        ?>
	</td>
</tr>
<tr class="row-1">
	<td class="category" width="15%">
		<?php 
        echo lang_get('monitoring_user_list');
        ?>
	</td>
	<td>
<?php 
        for ($i = 0; $i < $num_users; $i++) {
            $row = db_fetch_array($result);
            echo $i > 0 ? ', ' : '';
            echo print_user($row['user_id']);
        }
        ?>
	</td>
</tr>
<?php 
    }
    ?>
</table>
</div>

<?php 
    if (ON == config_get('use_javascript')) {
        ?>
<script type="text/javascript">
<!--
 * @package mod-scheduler
 * @category mod
 * @author Gustav Delius, Valery Fremaux > 1.8
 */
/**
 * Security traps
 */
if (!defined('MOODLE_INTERNAL')) {
    error("This file cannot be loaded directly");
}
$studentid = required_param('studentid', PARAM_INT);
$usehtmleditor = can_use_html_editor();
if ($subaction != '') {
    include "viewstudent.controller.php";
}
print_user(get_record('user', 'id', $studentid), $course);
//print tabs
$tabrows = array();
$row = array();
if ($page == 'appointments') {
    $currenttab = get_string('appointments', 'scheduler');
} else {
    $currenttab = get_string('notes', 'scheduler');
}
$tabname = get_string('appointments', 'scheduler');
$order = @$order;
$row[] = new tabobject($tabname, "view.php?what=viewstudent&amp;id={$cm->id}&amp;studentid={$studentid}&amp;course={$scheduler->course}&amp;order={$order}&amp;page=appointments", $tabname);
$tabname = get_string('comments', 'scheduler');
$row[] = new tabobject($tabname, "view.php?what=viewstudent&amp;id={$cm->id}&amp;studentid={$studentid}&amp;course={$scheduler->course}&amp;order={$order}&amp;page=notes", $tabname);
$tabrows[] = $row;
print_tabs($tabrows, $currenttab);
Пример #11
0
        $json['msg'] = '0';
        echo json_encode($json);
    } else {
        $zip->addFile($pic_path_org, $file_name . '.bmp');
        $zip->close();
        @unlink($pic_path_org);
        // 删除图片
        $download_name = $url . $file_name . '.zip';
        $json['msg'] = '1';
        $json['url'] = $file_name . '.zip';
        echo json_encode($json);
        //dump($pic_path_org);
    }
    exit;
} elseif ($_REQUEST['act'] == 'print_ok') {
    print_user();
    $zip = isset($_REQUEST['xia']) ? $_REQUEST['xia'] : '';
    if (strstr($zip, 'normal_a')) {
        $name = '普通版,正面';
    } elseif (strstr($zip, 'normal_b')) {
        $name = '普通版,背面';
    } elseif (strstr($zip, 'simple_a')) {
        $name = '简版,正面';
    } elseif (strstr($zip, 'simple_b')) {
        $name = '简版,背面';
    }
    $smarty->assign('name', $name);
    $smarty->assign('zip', $zip);
    $smarty->assign('act', $_REQUEST['act']);
}
$smarty->display('print.dwt');
     		if ( !($attempts = get_records('questionnaire_attempts','qid',$instance) )) {
     			echo "oups";
     		}
     */
     $attempts = get_records('questionnaire_attempts', 'qid', $instance);
     //print_r($attempts);
     foreach ($attempts as $attempt) {
         $usersattempts[] = $attempt->userid;
     }
     echo "Questionnaire Users Attempts Count = " . count($usersattempts) . " , ";
     //print_r($usersattempts);
     $result = array_diff($usersincourse, $usersattempts);
     echo "Lazy Users Count = " . count($result) . "<br/>";
     foreach ($result as $lazzyuserid) {
         $lazzyuser = get_record('user', 'id', $lazzyuserid);
         print_user($lazzyuser, $COURSE);
     }
     print_footer($course);
     break;
 case 'cross':
     $type = 'cross';
     /// Fall down into the vresp section.
 /// Fall down into the vresp section.
 case 'vresp':
     // view by response
     if (!has_capability('mod/questionnaire:viewsingleresponse', $context, NULL, false)) {
         /// Print the page header
         $extranav = array();
         $extranav[] = array('name' => get_string('questionnairereport', 'questionnaire'), 'link' => '', 'type' => 'activity');
         $extranav[] = array('name' => $strviewallresponses, 'link' => "", 'type' => 'activity');
         $navigation = build_navigation($extranav, $questionnaire->cm);
Пример #13
0
<?php

// This script allows for checking for similar user names. May be used
// when testing new algorithms for the similarity check.
require_once 'adodb/adodb.inc.php';
include_once 'libuseful/SqlQuery.class.php5';
include_once 'services/sql_query.class.php';
include_once 'services/userdb.class.php';
include_once 'functions/config.inc.php';
include_once 'objects/user.class.php';
$db =& ADONewConnection(cfg("db_dbn")) or die("FreechForum::FreechForum(): Error: Can't connect." . " Please check username, password and hostname.");
function print_user($user, $needle)
{
    echo "Match: " . $user->get_name() . " = " . $user->get_lexical_similarity($needle) . "<br>";
}
$userdb = new UserDB($db);
$needle = new User();
$needle->set_name($_GET['name']);
if ($_GET['name2']) {
    $user = new User();
    $user->set_name($_GET['name2']);
    die("Similarity: " . $user->get_lexical_similarity($needle) . "<br>");
}
$users = $userdb->get_similar_users_from_name($needle->get_name());
foreach ($users as $user) {
    print_user($user, $needle);
}
echo "DONE.";
/**
* a raster for html printing of a report structure header
* with all the relevant data about a user.
*
*/
function training_reports_print_header_html($userid, $courseid, $data, $short = false)
{
    global $CFG;
    $user = get_record('user', 'id', $userid);
    $course = get_record('course', 'id', $courseid);
    print_user($user, $course);
    $usergroups = groups_get_all_groups($courseid, $userid, 0, 'g.id, g.name');
    echo "<center>";
    echo "<div style=\"width:80%;text-align:left;padding:3px;\" class=\"userinfobox\">";
    // print group status
    if (!empty($usergroups)) {
        print_string('groups');
        echo ' : ';
        foreach ($usergroups as $group) {
            $str = $group->name;
            if ($group->id == get_current_group($courseid)) {
                $str = "<b>{$str}</b>";
            }
            $groupnames[] = $str;
        }
        echo implode(', ', $groupnames);
    }
    $context = get_context_instance(CONTEXT_COURSE, $courseid);
    echo '<br/>';
    print_string('roles');
    echo ' : ';
    echo get_user_roles_in_context($userid, $context);
    if (!empty($data->linktousersheet)) {
        echo "<br/><a href=\"{$CFG->wwwroot}/course/report/trainingsessions/index.php?view=user&amp;id={$courseid}&amp;userid={$userid}\">" . get_string('seedetails', 'report_trainingsessions') . '</a>';
    }
    // print completion bar
    if ($data->items) {
        $completed = $data->done / $data->items;
    } else {
        $completed = 0;
    }
    $remaining = 1 - $completed;
    $completedpc = ceil($completed * 100);
    $remainingpc = 100 - $completedpc;
    $completedwidth = floor(500 * $completed);
    $remainingwidth = floor(500 * $remaining);
    echo '<p class="completionbar">';
    print_string('done', 'report_trainingsessions');
    echo "<img src=\"{$CFG->wwwroot}/course/report/trainingsessions/pix/green.gif\" style=\"width:{$completedwidth}px\" class=\"donebar\" align=\"top\" title=\"{$completedpc} %\" />";
    echo "<img src=\"{$CFG->wwwroot}/course/report/trainingsessions/pix/blue.gif\" style=\"width:{$remainingwidth}px\" class=\"remainingbar\" align=\"top\"  title=\"{$remainingpc} %\" />";
    // Start printing the overall times
    if (!$short) {
        echo '<br/>';
        echo get_string('equlearningtime', 'report_trainingsessions');
        echo training_reports_format_time(0 + @$data->elapsed, 'html');
        echo ' (' . (0 + @$data->events) . ')';
        // plug here specific details
    }
    echo '</p></div></center>';
}
Пример #15
0
function print_news_entry($p_headline, $p_body, $p_poster_id, $p_view_state, $p_announcement, $p_date_posted)
{
    $t_headline = string_display_links($p_headline);
    $t_body = string_display_links($p_body);
    $t_date_posted = date(config_get('normal_date_format'), $p_date_posted);
    if (VS_PRIVATE == $p_view_state) {
        $t_news_css = 'news-heading-private';
    } else {
        $t_news_css = 'news-heading-public';
    }
    $output = '<div align="center">';
    $output .= '<table class="width75" cellspacing="0">';
    $output .= '<tr>';
    $output .= "<td class=\"{$t_news_css}\">";
    $output .= "<span class=\"bold\">{$t_headline}</span> - ";
    $output .= "<span class=\"italic-small\">{$t_date_posted}</span> - ";
    echo $output;
    /** @todo eventually we should replace print's with methods to construct the strings. */
    print_user($p_poster_id);
    $output = '';
    if (1 == $p_announcement) {
        $output .= ' <span class="small">';
        $output .= '[' . lang_get('announcement') . ']';
        $output .= '</span>';
    }
    if (VS_PRIVATE == $p_view_state) {
        $output .= ' <span class="small">';
        $output .= '[' . lang_get('private') . ']';
        $output .= '</span>';
    }
    $output .= '</td>';
    $output .= '</tr>';
    $output .= '<tr>';
    $output .= "<td class=\"news-body\">{$t_body}</td>";
    $output .= '</tr>';
    $output .= '</table>';
    $output .= '</div>';
    echo $output;
}
Пример #16
0
</tr>
<tr class="row-1">
	<td class="category" width="15%">
		<?php 
    echo lang_get('monitoring_user_list');
    ?>
	</td>
	<td>
<?php 
    if (0 == $num_users) {
        echo lang_get('no_users_monitoring_bug');
    } else {
        $t_can_delete_others = access_has_bug_level(config_get('monitor_delete_others_bug_threshold'), $f_bug_id);
        for ($i = 0; $i < $num_users; $i++) {
            echo $i > 0 ? ', ' : '';
            echo print_user($t_users[$i]);
            if ($t_can_delete_others) {
                echo ' [<a class="small" href="' . helper_mantis_url('bug_monitor_delete.php') . '?bug_id=' . $f_bug_id . '&user_id=' . $t_users[$i] . form_security_param('bug_monitor_delete') . '">' . lang_get('delete_link') . '</a>]';
            }
        }
    }
    if (access_has_bug_level(config_get('monitor_add_others_bug_threshold'), $f_bug_id)) {
        echo '<br /><br />', lang_get('username');
        ?>
		<form method="get" action="bug_monitor_add.php">
		<?php 
        echo form_security_field('bug_monitor_add');
        ?>
			<input type="hidden" name="bug_id" value="<?php 
        echo (int) $f_bug_id;
        ?>
Пример #17
0
        # choose color based on status
        $t_status_label = html_get_status_css_class($t_bug->status, auth_get_current_user_id(), $t_bug->project_id);
        echo '<tr class="' . $t_status_label . '">';
        echo '<td><a href="' . string_get_bug_view_url($t_sponsor_row['bug']) . '">' . bug_format_id($t_sponsor_row['bug']) . '</a></td>';
        echo '<td>' . string_display_line(project_get_field($t_bug->project_id, 'name')) . '&#160;</td>';
        echo '<td class="right">' . $t_released_label . '&#160;</td>';
        echo '<td><a title="' . $t_resolution . '"><span class="underline">' . $t_status . '</span>&#160;</a></td>';
        # summary
        echo '<td>' . string_display_line($t_bug->summary);
        if (VS_PRIVATE == $t_bug->view_state) {
            printf(' <img src="%s" alt="(%s)" title="%s" />', $t_icon_path . 'protected.gif', lang_get('private'), lang_get('private'));
        }
        echo '</td>';
        # describe sponsorship amount
        echo '<td>';
        print_user($t_sponsor->user_id);
        echo '</td>';
        echo '<td class="right">' . sponsorship_format_amount($t_sponsor->amount) . '</td>';
        echo '<td><select name="sponsor_' . $t_row['bug'] . '_' . $t_sponsor->id . '">';
        print_enum_string_option_list('sponsorship', $t_sponsor->paid);
        echo '</select></td>';
        echo '</tr>';
        if (SPONSORSHIP_PAID == $t_sponsor->paid) {
            $t_total_paid += $t_sponsor->amount;
        } else {
            $t_total_owing += $t_sponsor->amount;
        }
    }
    $t_hidden_bug_list = implode(',', $t_buglist);
    ?>
<!-- Totals -->
                    $t_note .= $v3_note;
            }
            if ($f_type_page != 'html') {
                $v3_note = stripslashes(str_replace('\\n', '|', $t_note));
            } else {
                $v3_note = string_display_links($t_note);
            }
            ?>
<table>
<tr>
	<?php 
            if ($bugnote_index < $field_name_count && (!isset($t_prefs[$bugnote_index]) || 1 == $t_prefs[$bugnote_index])) {
                ?>
	<td class=xl2216681 nowrap style='border-top:none;border-left:none'>
	<?php 
                print_user($v3_reporter_id);
                echo "</td>";
            }
            $bugnote_index++;
            ?>

	<?php 
            if ($bugnote_index < $field_name_count && (!isset($t_prefs[$bugnote_index]) || 1 == $t_prefs[$bugnote_index])) {
                ?>
	<td class=xl2216681 nowrap style='border-top:none;border-left:none'>
	<?php 
                echo $v3_date_submitted;
                echo "</td>";
            }
            $bugnote_index++;
            ?>
Пример #19
0
		</tr>
	</thead>

	<tbody>
<?php 
foreach ($t_history as $t_item) {
    ?>
		<tr>
			<td class="small-caption">
				<?php 
    echo $t_item['date'];
    ?>
			</td>
			<td class="small-caption">
				<?php 
    print_user($t_item['userid']);
    ?>
			</td>
			<td class="small-caption">
				<?php 
    echo string_display($t_item['note']);
    ?>
			</td>
			<td class="small-caption">
				<?php 
    echo $t_item['raw'] ? string_display_line_links($t_item['change']) : $t_item['change'];
    ?>
			</td>
		</tr>
<?php 
}
Пример #20
0
<tr>
	<td class="print-spacer" colspan="2">
		<hr />
	</td>
</tr>
<tr>
	<td class="nopad" width="20%">
		<table class="hide" cellspacing="1">
		<tr>
			<td class="print">
				(<?php echo bugnote_format_id( $t_bugnote->id ) ?>)
			</td>
		</tr>
		<tr>
			<td class="print">
				<?php print_user( $t_bugnote->reporter_id ) ?>&#160;&#160;&#160;
			</td>
		</tr>
		<tr>
			<td class="print">
				<?php echo $t_date_submitted ?>&#160;&#160;&#160;
				<?php if ( $t_bugnote->date_submitted != $t_bugnote->last_modified ) {
					echo '<br />(' . lang_get( 'last_edited') . lang_get( 'word_separator' ) . $t_last_modified . ')';
				} ?>
			</td>
		</tr>
		</table>
	</td>
	<td class="nopad" width="85%">
		<table class="hide" cellspacing="1">
		<tr>