Exemplo n.º 1
0
{
    function __construct()
    {
        $this->open('../../fitdayDB.db');
    }
}
$db = new MyDB();
if (!$db) {
    echo $db->lastErrorMsg();
}
$type = $_GET['type'];
if ($type == "top3") {
    getTop3($db);
}
if ($type == "rank") {
    getRank($db);
}
if ($type == "timeline") {
    $pagenum = $_GET['page'];
    getPageN($pagenum, $db);
}
function getRank($db)
{
    $userid = $_SESSION['users'];
    $nowdate = date('Y-m-d', time());
    $datetime = strtotime(date("Y-m-d", time()));
    //获取当前日期并转换成时间戳
    $tomorrow = date('Y-m-d', $datetime + 86400);
    //在时间戳的基础上加一天(即60*60*24)
    $searchsql = "Select userid,sum(calorie) as allcal from Exercise where ( userid='{$userid}' or userid in (select friendid from Friendship where userid = '{$userid}')) and endTime<'{$tomorrow}' and endTime>='{$nowdate}' group by userid order by allcal desc";
    $result = $db->query($searchsql);
Exemplo n.º 2
0
    ?>

												<div class="modal fade" id="<?php 
    print $b["_t"];
    ?>
" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog">
														<div class="modal-content">
															<div class="modal-header">
																<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
																<h4 class="modal-title" id="myModalLabel">																
																<?php 
    if ($currentBadge != null || $b["Secret"] != true) {
        ?>
																	<img src="<?php 
        print getRank($b["Level"]);
        ?>
" />
																	<?php 
        print $b["Name"];
    } else {
        print 'Badge Oculto';
    }
    ?>
</h4>
															</div>
															<div class="modal-body">
																<?php 
    if ($currentBadge != null || $b["Secret"] != true) {
        print $b["Content"];
    } else {
Exemplo n.º 3
0
    $throttled = true;
    error_log("<br>" . $e->getMessage());
}
if (!$users) {
    $users = getFollowers($nick, $connfb);
}
// keys
try {
    $keys = getKeys($nick, null, $client);
} catch (Exception $e) {
    $throttled = true;
    error_log($e->getMessage());
    $keys = getKeys($nick, $conn);
}
// turtle
$rank = getRank($users);
$ledger = getLedger($webid, $conn);
$project = getProject($ledger);
$main = 'http://gitpay.org/' . $user['login'] . '#this';
$githubaccount = 'http://github.com/' . $user['login'];
if ($webid && $webid['bitcoin']) {
    $bitcoin = $webid['bitcoin'];
}
if ($webid && $webid['preferredURI']) {
    $preferredURI = $webid['preferredURI'];
}
$turtle = getTurtle($user, $webid, $users, $keys);
insertKeys($keys, $nick, $conn);
writeTurtle($turtle);
if (!empty($_SESSION['login'])) {
    activateUser('https://gitpay.org/' . $_SESSION['login'] . '#this', $conn);
Exemplo n.º 4
0
///
///	[History]
///		Date        	Version  	Author    	Content
///		---------- 	 -------  	--------  	 ------------------------------------
///	    2009/11/16      1.1    	龙首成      	  学生管理
// header('Content-Type:   text/html;   charset=utf-8');
require "include/sessionstud.php";
require "include/function.include.php";
require_once "stud_addapp.class.php";
$citem = new selitem();
$itype = $_SESSION['itype'];
$iname = $_SESSION['icode'];
$stuno = $_SESSION["studno"];
$studcode = $_SESSION["studcode"];
$irank = $_SESSION['irank'];
$trank = getRank($irank);
//$showitem=$citem->finditem($icode);
if ($_POST['submit']) {
    // echo $showtime=date("Y-d-m H:i:s");
    $itemcode = $citem->setitem($itype, $iname, $irank);
    $itenc = $itemcode[0]['item_code'];
    //echo $itenc;
    // print_r($itemcode);
    $insertok = $citem->insertapp($itype, $itenc, $studno, $studcode, $showtime);
    //写入表
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Exemplo n.º 5
0
function getPlayerClass($playerName)
{
    $pid = getPid($playerName);
    if ($pid == 0) {
        return 0;
    }
    $tournRank = 1;
    $strictRank = 1;
    $query = "SELECT u.username, u.user_onirc, u.user_email, u.user_game_type, u.user_blurb, u.user_viewblurb, u.user_viewemail, s.open_num_games, s.open_num_bases, s.open_num_pills, s.open_num_tanks, s.tourn_num_games, s.tourn_score, s.tourn_wins, s.tourn_loses, s.tourn_num_bases, s.tourn_num_pills, s.tourn_num_tanks, s.strict_num_games, s.strict_wins, s.strict_loses, s.strict_num_bases, s.strict_num_pills, s.strict_num_tanks, s.strict_score, u.user_regdate, u.user_icq, u.user_aim, u.user_website, u.user_occ, u.user_from, u.user_yim, u.user_msnm, u.user_sig, u.user_emailforward, u.user_showforward from stats_player s, users u where s.pid = u.user_id and u.user_id = " . $pid;
    $result = mysql_query($query);
    $pc = new PlayerInfoClass();
    $pc->setStuff($pid, mysql_result($result, 0, "username"), mysql_result($result, 0, "user_email"), mysql_result($result, 0, "user_game_type"), mysql_result($result, 0, "user_blurb"), mysql_result($result, 0, "user_viewblurb"), mysql_result($result, 0, "user_viewemail"), mysql_result($result, 0, "open_num_games"), mysql_result($result, 0, "open_num_pills"), mysql_result($result, 0, "open_num_bases"), mysql_result($result, 0, "open_num_tanks"), mysql_result($result, 0, "tourn_num_games"), mysql_result($result, 0, "tourn_wins"), mysql_result($result, 0, "tourn_loses"), mysql_result($result, 0, "tourn_score"), mysql_result($result, 0, "tourn_num_pills"), mysql_result($result, 0, "tourn_num_bases"), mysql_result($result, 0, "tourn_num_tanks"), $tournRank, mysql_result($result, 0, "strict_num_games"), mysql_result($result, 0, "strict_score"), mysql_result($result, 0, "strict_wins"), mysql_result($result, 0, "strict_loses"), mysql_result($result, 0, "strict_num_pills"), mysql_result($result, 0, "strict_num_bases"), mysql_result($result, 0, "strict_num_tanks"), $strictRank, mysql_result($result, 0, "user_icq"), mysql_result($result, 0, "user_aim"), mysql_result($result, 0, "user_yim"), mysql_result($result, 0, "user_website"), mysql_result($result, 0, "user_occ"), mysql_result($result, 0, "user_msnm"), mysql_result($result, 0, "user_regdate"), mysql_result($result, 0, "user_sig"), mcHasTopLevelCollection($pid), mysql_result($result, 0, "user_emailforward"), mysql_result($result, 0, "user_showforward"));
    $pc->setOnIrc(mysql_result($result, 0, "user_onirc"));
    // Get number of posts
    $query = "SELECT count(*) AS total FROM posts where poster_id = " . $pid;
    $result = mysql_query($query);
    $pc->setNumPosts(mysql_result($result, 0, "total"));
    if ($pc->getNumPosts() > 0) {
        // Get Posting statistics
        $result = mysql_query("SELECT count(*) AS total FROM posts");
        $pc->setPercentPosts($pc->getNumPosts() / mysql_result($result, 0, "total") * 100);
        if ((time() - strtotime($pc->getRegisteredDate())) / (24 * 60 * 60) < 1) {
            $pc->setPostsPerDay($pc->getNumPosts());
        } else {
            $pc->setPostsPerDay($pc->getNumPosts() / ((time() - strtotime($pc->getRegisteredDate())) / (24 * 60 * 60)));
        }
        mysql_free_result($result);
    }
    $teams = array();
    $query = "select t.name from stats_team t, team_members m where t.tid = m.tid and m.pid = '{$pid}' order by t.name";
    $result = mysql_query($query);
    $count = 0;
    while ($count < mysql_numrows($result)) {
        $teams[$count] = mysql_result($result, $count, "name");
        $count++;
    }
    $pc->setTeams($teams);
    // Get ranks
    $pc->setTournRank(getRank("stats_player", "tourn_score", $pc->getTournScore(), $pid, "pid", "tourn"));
    $pc->setStrictRank(getRank("stats_player", "strict_score", $pc->getStrictScore(), $pid, "pid", "strict"));
    $pc->setPageViews(getPageViews("view_player", $pid));
    # Get Active Games
    $activeGames = array();
    $activeSql = "SELECT g.gs_ip, g.gs_port, g.gs_key from game_server g, active_player p where p.ap_left = 0 and p.ap_pid = '{$pid}' and g.gs_key = p.ap_serverkey";
    $activeResult = mysql_query($activeSql);
    $count = 0;
    while ($count < mysql_numrows($activeResult)) {
        $activeGames[$count] = mysql_result($activeResult, $count, "gs_ip");
        $activeGames[$count + 1] = mysql_result($activeResult, $count, "gs_port");
        $activeGames[$count + 2] = mysql_result($activeResult, $count, "gs_key");
        $count += 3;
    }
    $pc->setActiveGames($activeGames);
    return $pc;
}
Exemplo n.º 6
0
        if ($list->uid1 == Request::getParam('user')->id) {
            $id = $list->uid2;
            if ($list->countMsg1 > 0) {
                $count = ' <span class="mail_count">+' . $list->countMsg1 . '</span>';
            }
        } else {
            $id = $list->uid1;
            if ($list->countMsg2 > 0) {
                $count = ' <span class="mail_count">+' . $list->countMsg2 . '</span>';
            }
        }
        echo '<div class="tile">';
        echo '<div class="tileImg">';
        echo '<img src="' . getAvatar($id) . '">';
        echo '<a href="' . url($id) . '"></a>';
        echo '</div>';
        echo '<div class="tileInfo">';
        echo '<div><a class="tileName" href="' . url('mail' . $id) . '">' . $list->nickname . '</a>' . $count . '</div>';
        echo '<div>' . getRank($list->elo) . '</div>';
        echo '<a class="mailBtn" href="{URL:mail' . $id . '}" title="{L:INDEX_SEND_MAIL}"></a>';
        echo '<a class="challengeBtn" href="">{L:INDEX_CHALLENGE}</a>';
        echo '</div>';
        echo '</div>';
        //printTime($list->time)
        //$list->message
    }
    echo '</div>';
    echo '<div class="pagin">' . Pagination::printPagination() . '</div>';
} else {
    echo '{L:INDEX_NO_DIALOGS}';
}
Exemplo n.º 7
0
function profile()
{
    // The usual suspects.
    global $MySelf;
    global $DB;
    // Set the ID.
    $ID = sanitize($_GET[id]);
    numericCheck($_GET[id], 0);
    // Load the profile.
    $profile = new profile($ID);
    $username = ucfirst(idToUsername($ID));
    // Cache our permissions.
    $canSeeUsers = $MySelf->canSeeUsers();
    // Need the api.
    $api = new api($ID);
    // Create table header.
    $table = new table(2, true);
    $table->addHeader(">> About " . $username);
    $table->addRow();
    $table->addCol("Current rank:");
    $table->addCol(getRank($ID));
    $table->addRow();
    $table->addCol("Last login:"******"SELECT lastlogin FROM users WHERE id='" . $ID . "' AND deleted='0' LIMIT 1");
    $table->addCol(date("d.m.y. H:i:s", $lastLog[0]));
    $table->addRow();
    $table->addCol("Total logins:");
    $lastLog = $DB->getCol("SELECT COUNT(authkey) FROM auth WHERE user='******' LIMIT 1");
    $table->addCol(number_format($lastLog[0], 0));
    $table->addRow();
    $table->addCol("Valid api-key on file:");
    $table->addCol(yesno($api->valid(), true));
    $table->addRow();
    $table->addCol("Is available for mining:");
    if ($profile->isOwn()) {
        if ($profile->MinerFlag()) {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&mining=false\">set not available</a>]";
        } else {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&mining=true\">set available</a>]";
        }
    }
    $table->addCol(yesno($profile->MinerFlag(), true) . $temp);
    $table->addRow();
    $table->addCol("Is available for hauling:");
    if ($profile->isOwn()) {
        if ($profile->HaulerFlag()) {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&hauling=false\">set not available</a>]";
        } else {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&hauling=true\">set available</a>]";
        }
    }
    $table->addCol(yesno($profile->HaulerFlag(), true) . $temp);
    $table->addRow();
    $table->addCol("Is available for fighting:");
    if ($profile->isOwn()) {
        if ($profile->FighterFlag()) {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&fighting=false\">set not available</a>]";
        } else {
            $temp = " [<a href=\"index.php?action=modprofile&id=" . $ID . "&fighting=true\">set available</a>]";
        }
    }
    $table->addCol(yesno($profile->FighterFlag(), true) . $temp);
    if ($profile->emailVisible() || $profile->isOwn()) {
        if ($profile->isOwn()) {
            if ($profile->emailVisible()) {
                $temp = " (public) [<a href=\"index.php?action=modprofile&id=" . $ID . "&email=hide\">hide from public</a>]";
            } else {
                $temp = " (hidden) [<a href=\"index.php?action=modprofile&id=" . $ID . "&email=show\">make public</a>]";
            }
        }
        $table->addRow();
        $table->addCol("Email address:");
        $email = $DB->getCol("SELECT email FROM users WHERE id='" . $ID . "' LIMIT 1");
        $table->addCol($email[0] . $temp);
    }
    // Statistics.
    $stats = new table(2, true);
    $stats->addHeader(">> Statistical breakdown");
    $miningRunsJoined = $DB->getCol("SELECT COUNT(id) FROM joinups WHERE userid='" . $ID . "'");
    $miningRunsJoined = $miningRunsJoined[0];
    $OpjoinUps = $DB->getCol("SELECT COUNT(id) FROM joinups WHERE userid='" . $ID . "'");
    $OpjoinUps = $OpjoinUps[0];
    $joinUps = $DB->getCol("SELECT COUNT(id) FROM (SELECT * from joinups WHERE userid='" . $ID . "' GROUP BY run) as uJoinups");
    $joinUps = $joinUps[0];
    $haulingRuns = $DB->getCol("SELECT COUNT(id) FROM hauled WHERE hauler='" . $ID . "'");
    $haulingRuns = $haulingRuns[0];
    $timeMining = $DB->getCol("SELECT SUM(parted - joined) FROM joinups WHERE userid='" . $ID . "' AND parted >1");
    $timeMining = $timeMining[0];
    $timesKicked = $DB->getCol("SELECT COUNT(id) FROM joinups WHERE userid='" . $ID . "' AND status='1'");
    $timesKicked = $timesKicked[0];
    $timesRemoved = $DB->getCol("SELECT COUNT(id) FROM joinups WHERE userid='" . $ID . "' AND status='2'");
    $timesRemoved = $timesRemoved[0];
    $timesBanned = $DB->getCol("SELECT COUNT(id) FROM joinups WHERE userid='" . $ID . "' AND status='3'");
    $timesBanned = $timesBanned[0];
    $timesCharity = $DB->getCol("SELECT COUNT(id) FROM (SELECT * from joinups WHERE userid='" . $ID . "' GROUP BY run) as uJoinups WHERE userid='" . $ID . "' AND charity='1'");
    $timesCharity = $timesCharity[0];
    $tmec = $DB->getCol("SELECT AVG(tmec) FROM runs WHERE isOfficial = 1");
    $tmecJoined = $DB->getCol("SELECT AVG(runs.tmec) FROM joinups, runs WHERE joinups.userid='" . $ID . "' AND joinups.run = runs.id AND runs.endtime > 0 AND runs.isOfficial = 1");
    $tmecNotJoined = $DB->getCol("SELECT AVG(runs.tmec) FROM joinups, runs WHERE joinups.userid='" . $ID . "' AND joinups.run <> runs.id AND runs.endtime > 0 AND runs.isOfficial = 1");
    $tmecDiff = $tmecJoined[0] - $tmecNotJoined[0];
    $stats->addRow();
    $stats->addCol("Mining operations joined:");
    if ($miningRunsJoined > 0) {
        $stats->addCol(number_format($joinUps, 0));
    } else {
        $stats->addCol("never joined.");
    }
    $stats->addRow();
    $stats->addCol("Total operations joinups:");
    if ($OpjoinUps > 0) {
        $stats->addCol(number_format($OpjoinUps, 0));
    } else {
        $stats->addCol("never joined.");
    }
    $stats->addRow();
    $stats->addCol("Hauling runs:");
    if ($haulingRuns > 0) {
        $stats->addCol(number_format($haulingRuns, 0));
    } else {
        $stats->addCol("never hauled.");
    }
    $stats->addRow();
    $stats->addCol("Time spent mining:");
    if ($timeMining > 0) {
        $stats->addCol(numberToString($timeMining));
    } else {
        $stats->addCol("never mined.");
    }
    $stats->addRow();
    $stats->addCol("Average TMEC:");
    $stats->addCol(number_format($tmec[0], 3));
    $stats->addRow();
    $stats->addCol("Average TMEC on Ops <b>with</b> " . $username . ":");
    $stats->addCol(number_format($tmecJoined[0], 3));
    $stats->addRow();
    $stats->addCol("Average TMEC on Ops <b>without</b> " . $username . ":");
    $stats->addCol(number_format($tmecNotJoined[0], 3));
    $stats->addRow();
    $stats->addCol("TMEC difference:");
    if ($tmecDiff >= 0) {
        $stats->addCol("<font color=\"#00ff00\">" . number_format($tmecDiff, 3), true . "</font>");
    } else {
        $stats->addCol("<font color=\"#ff0000\">" . number_format($tmecDiff, 3), true . "</font>");
    }
    $stats->addRow();
    $stats->addCol("Times removed from OP:");
    $stats->addCol(number_format($timesRemoved, 0));
    $stats->addRow();
    $stats->addCol("Times kicked from OP:");
    $stats->addCol(number_format($timesKicked, 0));
    $stats->addRow();
    $stats->addCol("Times banned from OP:");
    $stats->addCol(number_format($timesBanned, 0));
    $stats->addRow();
    $stats->addCol("Times declared charity:");
    $stats->addCol(number_format($timesCharity, 0));
    /*
     * Assemble the heavy-duty SQL query.
     * It is dynamic because this way we can easily add ores from 
     * config-system.php to the system without code rewrite.
     */
    /*
    	global $DBORE;
    	global $ORENAMES;
    	foreach ($DBORE as $ORE) {
    		$new = $ORE;
    		if ($last) {
    			$SQLADD .= "SUM(" . $last . ") AS total" . $last . ", ";
    		}
    		$last = $new;
    	}
    	$SQLADD .= "SUM(" . $last . ") AS total" . $last . " ";
    	$SQL = "SELECT " . $SQLADD . " FROM hauled WHERE hauler='" . $ID . "'";
    
    	// Now query it.
    	$totalOREDB = $DB->query("$SQL");
    	
    
    if (DB::isError($totalOREDB)) {
        *
         * This is not what you would really want to do in
         * your program.  It merely demonstrates what kinds
         * of data you can get back from error objects.
         *
        echo 'Standard Message: ' . $totalOREDB->getMessage() . "\n";
        echo '\n ';
        echo 'Standard Code: ' . $totalOREDB->getCode() . "\n";
        echo '\n ';
        echo 'DBMS/User Message: ' . $totalOREDB->getUserInfo() . "\n";
        echo '\n ';
        echo 'DBMS/Debug Message: ' . $totalOREDB->getDebugInfo() . "\n";
        echo '\n ';
        exit;
    }
    
    	// Create table.
    	$totalOre_table = new table(2, true);
    	$totalOre_table->addHeader(">> Total ore hauled");
    
    	// Loop through the result (single result!)
    	if ($totalOREDB->numRows() > 0) {
    		while ($totalORE = $totalOREDB->fetchRow()) {
    			// Now check each ore type.
    			foreach ($ORENAMES as $ORE) {
    				// And ignore never-hauled ore
    				if ($totalORE[total . $ORE] > 0) {
    					// We got some ore!
    					$totalOre_table->addRow();
    					$totalOre_table->addCol("<img width=\"20\" height=\"20\" src=\"./images/ores/" . $ORE . ".png\">Total " . $ORE . " hauled:");
    					$totalOre_table->addCol(number_format($totalORE[total . $ORE]));
    					$gotOre = true;
    				}
    			}
    		}
    		if ($gotOre) {
    			$oretable_r = "<br>" . $totalOre_table->flush();
    		}
    	}
    */
    // Image thingy.
    // We serve small images IGB.
    global $IGB;
    global $IGB_VISUAL;
    if ($IGB && $IGB_VISUAL) {
        $image = "<img src=\"portrait:" . $api->getCharacterID() . "\" SIZE=\"128\">";
    } else {
        $image = $profile->getImage("large");
    }
    $picTable = new table(true, 1);
    $picTable->addHeader(">> Picture of " . $username);
    $picTable->addRow();
    $picTable->addCol($image);
    $imageTable = $picTable->flush();
    // About
    if ($profile->GetAbout() && !$profile->isOwn()) {
        $aboutTable = new table(1, true);
        $aboutTable->addHeader(">> " . $username . " says...");
        $aboutTable->addRow();
        $aboutTable->addCol(nl2br($profile->GetAbout()));
        $aboutTable = "<br>" . $aboutTable->flush();
    }
    if ($profile->isOwn()) {
        $aboutTable = new table(1, true);
        $aboutTable->addHeader(">> Enter a public viewable text here");
        $aboutTable->addRow();
        $form = "<form action=\"index.php\" method=\"POST\">";
        $form .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
        $form .= "<input type=\"hidden\" name=\"action\" value=\"modprofile\">";
        $form .= "<input type=\"hidden\" name=\"id\" value=\"" . $ID . "\">";
        $aboutTable->addCol("<textarea rows=\"18\" cols=\"80\" name=\"about\">" . $profile->GetAbout() . "</textarea>");
        $aboutTable->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Update about\">");
        $aboutTable = "<br>" . $form . $aboutTable->flush() . "</form>";
    }
    // quick "jump to" -thingy.
    $peeps = $DB->query("SELECT DISTINCT username,id FROM users WHERE deleted = 0 AND canLogin = 1 ORDER BY username ASC");
    if ($peeps->numRows() > 0) {
        while ($p = $peeps->fetchRow()) {
            if ($ID == $p[id]) {
                $pdm .= "<option SELECTED value=\"" . $p[id] . "\">" . ucfirst($p[username]) . " (current)</option>";
            } else {
                $pdm .= "<option value=\"" . $p[id] . "\">" . ucfirst($p[username]) . "</option>";
            }
        }
        $pdm = "<select name=\"id\">" . $pdm . "</select></form>";
        $quickChooser = new table(1, true);
        $quickChooser->addHeader(">> Quick jump to profile");
        $quickChooser->addRow();
        $quickChooser->addCol($pdm);
        $quickChooser->addHeaderCentered("<input type=\"submit\" name=\"submit\" value=\"Switch\">");
        $quickChooser = "<form action=\"index.php\" method=\"GET\"><input type=\"hidden\" name=\"action\" value=\"profile\">" . $quickChooser->flush() . "</form>";
    }
    $page = "<h2>View profile</h2>" . $quickChooser . $imageTable . "<br>" . $table->flush() . "<br>" . $stats->flush() . $oretable_r . $aboutTable;
    return $page;
}
Exemplo n.º 8
0
/**
 *  生成searchtitle,keyword,description等信息.
 *
 * @access    private
 * @return    array
 */
function getSearchTitle($info, $rankid, $priceid, $attrid)
{
    global $searchkey, $dest_id;
    $arr = array();
    $rankname = getRank($rankid);
    $searchtitle = "{$info['seotitle']}|";
    if ($priceid != 0) {
        $pricearr = getMinMaxprice($priceid);
        if ($pricearr['min'] != "" && $pricearr['max'] == "") {
            $price .= "价格在{$pricearr['min']}以上";
        } else {
            $price .= "价格范围在{$pricearr['min']}-{$pricearr['max']}之间";
        }
        $searchtitle .= $price;
    }
    if ($rankname != "") {
        $searchtitle .= "{$rankname}|";
    }
    if (!empty($attrid)) {
        $searchtitle .= getHotelAttrName($attrid);
    }
    //$arr['searchtitle']=$searchtitle;
    // if(!empty($searchkey)) //如果针对的是名称搜索
    //{
    //$arr['searchtitle']="{$searchkey}酒店列表";
    // $arr['subtitle']="{$searchkey}酒店列表";
    //}
    //	return $arr;
    return $searchtitle;
}
Exemplo n.º 9
0
            <th>#</th>
            <th>{L:LADDERS_USER}</th>
            <th>{L:LADDERS_WINS}</th>
            <th>{L:LADDERS_TIES}</th>
            <th>{L:LADDERS_LOSSES}</th>
            <th>{L:LADDERS_RANK}</th>
        </tr>
        <?php 
while ($list = mysqli_fetch_object($this->ladder_list)) {
    echo '<tr>';
    echo '<td>' . ++Pagination::$start . '</td>';
    echo '<td>' . ($list->country ? '<img src="' . _SITEDIR_ . 'public/images/country/' . mb_strtolower($list->country) . '.png">' : '') . ' <a href="' . url($list->id) . '">' . $list->nickname . '</a></td>';
    echo '<td>' . $list->wins . '</td>';
    echo '<td>' . $list->ties . '</td>';
    echo '<td>' . $list->losses . '</td>';
    echo '<td>' . getRank($list->elo) . '</td>';
    echo '</tr>';
}
?>
    </table>
</div>
<div class="last-battles">
    <style scoped>
        .lastMatches{
            margin:0 0 25px 0;
            text-align: center;
        }
        .nicknames{
            font-size: 16px;
        }
    </style>
Exemplo n.º 10
0
<?php

if (!defined('IN_PHPBB')) {
    exit;
}
$query = "SELECT * FROM " . $TableNames['roster'] . " ORDER BY name";
$result = $db->sql_query($query);
while ($row = $db->sql_fetchrow($result)) {
    if ($row['active'] == 0) {
        $template->assign_block_vars('n_exMembers', array('NAME' => $row['name'], 'REALM' => $row['realm'], 'LEVEL' => $row['level'], 'ILEVEL' => $row['iLevel'], 'CLASS' => $row['class'], 'CLASSNAME' => getGermanClass(getClassById($row['class'])), 'RACE' => $row['race'], 'RACENAME' => getGermanRace(getRaceById($row['race'])), 'GENDER' => $row['gender'], 'LASTSEENTIMESTAMP' => strtotime($row['cache']), 'LASTSEEN' => $user->format_date(strtotime($row['cache']), false, true)));
    } else {
        $template->assign_block_vars('n_members', array('NAME' => $row['name'], 'RANK' => $row['rank'], 'RANKNAME' => getRank($row['rank'], $ranks), 'REALM' => $row['realm'], 'LEVEL' => $row['level'], 'ILEVEL' => $row['iLevel'], 'CLASS' => $row['class'], 'CLASSNAME' => getGermanClass(getClassById($row['class'])), 'RACE' => $row['race'], 'RACENAME' => getGermanRace(getRaceById($row['race'])), 'GENDER' => $row['gender'], 'ACHIEVEMENTPOINTS' => $row['achievementPoints']));
    }
}
$db->sql_freeresult($result);
Exemplo n.º 11
0
echo Request::getParam('countRequests') > 0 ? '(+' . Request::getParam('countRequests') . ')' : '';
?>
</a></li>
    <li><a href="{URL:friends/blacklist}">{L:BLACKLIST_TITLE}</a></li>
</ul>

<?php 
if (getCookie('error')) {
    echo getCookie('error');
}
echo '<div class="inbox clearfix">';
if (count($this->friends) > 0) {
    foreach ($this->friends as $friend) {
        $id = $friend->uid == Request::getParam('user')->id ? $friend->pid : $friend->uid;
        echo '<div class="tile">';
        echo '<div class="tileImg">';
        echo '<img src="' . getAvatar($id) . '">';
        echo '<a href="' . url($id) . '"></a>';
        echo '</div>';
        echo '<div class="tileInfo">';
        echo '<div><a class="tileName" href="' . url($id) . '">' . $friend->name . '</a></div>';
        echo '<div>' . getRank($friend->elo) . '</div>';
        echo '<a class="mailBtn" href="{URL:mail' . $id . '}" title="{L:INDEX_SEND_MAIL}"></a>';
        echo '<a class="challengeBtn" onclick="' . ajaxLoad(url('profile', 'challenge'), 'challenge', 'pid:' . $id) . '">{L:INDEX_CHALLENGE}</a>';
        echo '</div>';
        echo '<div id="challenge' . $id . '"></div>';
        echo '</div>';
    }
}
echo '</div>';
echo '<div class="pagin">' . Pagination::printPagination() . '</div>';
Exemplo n.º 12
0
<?php

header("Content-type: text/html; charset=utf-8");
include_once "db.php";
//单次处理直接查询请求
if (isset($_GET['num'])) {
    echo getRank($_GET['num']);
}
//处理带表单的查询请求
if (isset($_POST['hasData'])) {
    echo getData();
}
//获取排名函数
function getRank($num)
{
    $arr = array('data' => array());
    $sql = "SELECT `username`,`score` FROM `rb_rank` ORDER BY score desc LIMIT 0,{$num}";
    //按照积分大小顺序获取用户信息
    $rst = mysql_query($sql);
    if ($rst) {
        //查询成功
        $arr['error_code'] = 0;
        while ($res = mysql_fetch_row($rst)) {
            array_push($arr['data'], array('name' => $res[0], 'score' => $res[1]));
        }
    } else {
        //查询失败
        $arr['error_code'] = -1;
    }
    return json_encode($arr);
}
Exemplo n.º 13
0
//echo 'test';
if ($this->profile->dateLast >= time() - 300) {
    $online = '<div class="on"></div>';
} else {
    $online = '<div class="off"></div>';
}
echo '<div class="profile_left">';
echo '<div class="profile-details"><div class="avatar"><img src="' . getAvatar($this->profile->id) . '">' . $online . '</div>';
echo '<div class="profile_left_info">';
echo '<div class="nick-and-rate"><div class="nickname">';
echo $this->profile->nickname;
if (Request::getParam('user')->id && Request::getParam('user')->id == $this->profile->id) {
    echo ' <a class="red-text" href="' . url('settings', 'general') . '">Edit</a>';
}
echo '</div>';
echo '<div>' . getRank($this->profile->elo) . '</div></div>';
//{L:INDEX_RANK}:
echo '<div>';
echo '{L:INDEX_RATING}: <span id="rating">' . $this->profile->rating . '</span>';
echo ' <span onclick="' . ajaxLoad(url('profile', 'voice_plus'), 'voice_plus', 'pid:' . $this->profile->id . '|rat:' . $this->profile->rating) . '">+</span> ';
echo '</div>';
echo '<div>{L:INDEX_ELO}: ' . $this->profile->elo . '</div>';
echo '<div>{L:INDEX_WINS}: ' . $this->profile->wins . '</div>';
echo '<div>{L:INDEX_TIES}: ' . $this->profile->ties . '</div>';
echo '<div>{L:INDEX_LOSSES}: ' . $this->profile->losses . '</div>';
echo '</div></div>';
// Write message
if (Request::getParam('user')->id && Request::getParam('user')->id != $this->profile->id) {
    echo '<div class="profile-menu">';
    if ($this->challenge) {
        echo '<div id="challenge"><a onclick="' . ajaxLoad(url('profile', 'challenge'), 'challenge', 'pid:' . $this->profile->id) . '">' . Lang::translate('INDEX_CHALLENGE') . '</a></div>';
Exemplo n.º 14
0
<?php 
error_reporting(0);
include '../db_con.php';
$player = mysql_real_escape_string(addslashes($_GET['player']));
if (strlen($player) < 2) {
    return;
}
$sql = 'SELECT player,sum(kills) as tkills ,sum(death) as tdeath,sum(time) as ttime, sum(points) as total_points , sum(position) as tpos, sum(position = 1) as wins, count(*) as tgames FROM ' . $dbprefix . 'playerstats WHERE player LIKE \'%' . $player . '%\' GROUP BY player ORDER BY total_points desc LIMIT 500';
$result = mysql_query($sql);
echo mysql_error();
$index = $p * $per_page + 1;
echo '<center><table id="ldr_table"><tr class="lb_tb_hd" align="center"><td>Position</td><td>Player</td><td>Points</td><td>Wins</td><td>Avg Finish</td><td>Kills</td><td>Deaths</td><td>K/D</td><td>Games Played</td><td>Time Ingame</td></tr>';
while ($row = mysql_fetch_array($result)) {
    echo '<tr class="ldr_alt', $index % 2 + 1, '"><td>', getRank($row['player']), '</td>';
    echo '<td><a href="index.php?page=player&player=', $row['player'], '">', $row['player'], '</a></td>';
    echo '<td>', $row['total_points'], '</td>';
    echo '<td>', $row['wins'], '</td>';
    echo '<td>', round($row['tpos'] / $row['tgames'], 2), '</td>';
    echo '<td>', $row['tkills'], '</td>';
    echo '<td>', $row['tdeath'], '</td>';
    echo '<td>', round($row['tkills'] / $row['tdeath'], 2), '</td>';
    echo '<td>', $row['tgames'], '</td>';
    $hours = round($row['ttime'] / (1000 * 60 * 60), 0);
    $min = round($row['ttime'] % (1000 * 60 * 60) / (1000 * 60), 0);
    $sec = round($row['ttime'] % (1000 * 60 * 60) % (1000 * 60) / 1000, 0);
    echo '<td>', $hours, ':', $min, ':', $sec < 10 ? '0' : '', $sec, '</td>';
    echo '</tr>';
    $index++;
}
echo '</table>';
Exemplo n.º 15
0
?>
</a>
                    <?php 
echo $this->pid->country ? '<img src="' . _SITEDIR_ . 'public/images/country/' . mb_strtolower($this->pid->country) . '.png">' : '';
?>
                </div>
                <!--<div  class="rank"><?php 
echo getRank($this->pid->elo);
?>
</div>-->
            </div>

            <div class="rDataInfo">

                <div>{L:INDEX_RANK}: <?php 
echo getRank($this->pid->elo);
?>
</div>
                <div>{L:INDEX_ELO}: <?php 
echo $this->pid->elo;
?>
</div>

                <div>{L:LADDERS_WINS}: <?php 
echo $this->pid->wins;
?>
</div>
                <div>{L:LADDERS_TIES}: <?php 
echo $this->pid->ties;
?>
</div>
include 'getRank.php';
$user_id = $_GET['id_user'];
date_default_timezone_set("Asia/Kolkata");
$time = date('Y-m-d H:i:s', time());
//	echo $time;
$arr = array("Tag" => "Start");
$output[] = $arr;
$con = mysqli_connect($IP, $user, $pass, $db);
//	echo "select `idAuction`, `location`, `start_time`, `expctd_time`, `description` from `Auction` where `idUser`=\"$user_id\" and `end_time`>=\"$time\"";
//	echo "select Auction.*,Temp.Price,idBid,Temp.status  from ( (( SELECT * FROM `Bid` Natural Join `Placed`) as Temp), `Auction`) where Temp.`idAuction` = Auction.`idAuction` and Temp.`idUser`=\"$user_id\" and `end_time`>=\"$time\"";
$result = mysqli_query($con, "select Auction.*,Temp.Price,idBid,Temp.status  from ( (( SELECT * FROM `Bid` Natural Join `Placed`) as Temp), `Auction`) where Temp.`idAuction` = Auction.`idAuction` and Temp.`idUser`=\"{$user_id}\" and `expctd_time`>=\"{$time}\"") or die("Error: " . mysqli_error($con));
$num = mysqli_num_rows($result);
$tout = [];
while ($row = mysqli_fetch_assoc($result)) {
    $rating = getRating($row['idUser']);
    $rank = getRank($row['idAuction'], $row['Price'], $row['idBid']);
    //	print json_encode($rating);
    $row['rank'] = $rank;
    $row['rating'] = $rating[0]['rating'];
    $row['numRated'] = $rating[0]['numRated'];
    $tout[] = $row;
}
$arr = array("Participating" => $tout);
$output[] = $arr;
$tout = [];
//	echo "select * from Auction where `idAuction` not in (select Auction.`idAuction` from ( (( SELECT * FROM `Bid` Natural Join `Placed`) as Temp), `Auction`) where Temp.`idAuction` = Auction.`idAuction` and Temp.`idUser`=\"$user_id\" and `end_time`>=\"$time\") and `end_time`>=\"$time\"";
$result = mysqli_query($con, "select * from Auction where `idAuction` not in (select Auction.`idAuction` from ( (( SELECT * FROM `Bid` Natural Join `Placed`) as Temp), `Auction`) where Temp.`idAuction` = Auction.`idAuction` and Temp.`idUser`=\"{$user_id}\" and `expctd_time`>=\"{$time}\") and `expctd_time`>=\"{$time}\"") or die("Error: " . mysqli_error($con));
$num = mysqli_num_rows($result);
while ($row = mysqli_fetch_assoc($result)) {
    $rating = getRating($row['idUser']);
    //	print json_encode($rating);