2003-12-21 05:55:48 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2007-11-12 22:28:17 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/util.inc");
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("search_string", "offset"));
|
|
|
|
|
2008-08-07 20:43:52 +00:00
|
|
|
function show_profile_link2($profile, $n) {
|
2003-12-21 05:55:48 +00:00
|
|
|
$user = lookup_user_id($profile->userid);
|
2008-08-07 20:43:52 +00:00
|
|
|
echo "<tr><td>".user_links($user)."</td><td>".date_str($user->create_time)."</td><td>$user->country</td><td>".(int)$user->total_credit."</td><td>".(int)$user->expavg_credit."</td></tr>\n";
|
2003-12-21 05:55:48 +00:00
|
|
|
}
|
|
|
|
|
2006-03-11 00:17:46 +00:00
|
|
|
$search_string = get_str('search_string');
|
2011-08-25 22:12:48 +00:00
|
|
|
$search_string = sanitize_tags($search_string);
|
|
|
|
$search_string = BoincDb::escape_string($search_string);
|
2006-03-11 00:17:46 +00:00
|
|
|
$offset = get_int('offset', true);
|
2003-12-21 05:55:48 +00:00
|
|
|
if (!$offset) $offset=0;
|
|
|
|
$count = 10;
|
|
|
|
|
2011-07-25 22:05:49 +00:00
|
|
|
page_head(tra("Profiles containing '%1'", $search_string));
|
2007-11-12 22:28:17 +00:00
|
|
|
$profiles = BoincProfile::enum("match(response1, response2) against ('$search_string') limit $offset,$count");
|
2008-08-07 20:43:52 +00:00
|
|
|
start_table();
|
|
|
|
echo "
|
2011-07-25 22:05:49 +00:00
|
|
|
<tr><th>".tra("User name")."</th>
|
|
|
|
<th>".tra("Joined project")."</th>
|
|
|
|
<th>".tra("Country")."</th>
|
|
|
|
<th>".tra("Total credit")."</th>
|
|
|
|
<th>".tra("Recent credit")."</th></tr>
|
2007-10-29 04:02:41 +00:00
|
|
|
";
|
2003-12-21 05:55:48 +00:00
|
|
|
$n = 0;
|
2007-11-12 22:28:17 +00:00
|
|
|
foreach($profiles as $profile) {
|
2008-08-07 20:43:52 +00:00
|
|
|
show_profile_link2($profile, $n+$offset+1);
|
2003-12-21 05:55:48 +00:00
|
|
|
$n += 1;
|
|
|
|
}
|
2008-08-07 20:43:52 +00:00
|
|
|
end_table();
|
2007-10-29 04:02:41 +00:00
|
|
|
|
2003-12-21 05:55:48 +00:00
|
|
|
if ($offset==0 && $n==0) {
|
2011-07-25 22:05:49 +00:00
|
|
|
echo tra("No profiles found containing '%1'", $search_string);
|
2003-12-21 05:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($n==$count) {
|
|
|
|
$s = urlencode($search_string);
|
|
|
|
$offset += $count;
|
|
|
|
echo "
|
2011-07-25 22:05:49 +00:00
|
|
|
<a href=profile_search_action.php?search_string=$s&offset=$offset>".tra("Next %1", $count)."</a>
|
2003-12-21 05:55:48 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|