function get_ranklist($param)
{
    global $redis;
    $size = isset($param['size']) ? $param['size'] : RANKLIST_SIZE;
    if (isset($param['user'])) {
        //get user's rank
        require_once 'get_rank.php';
        $my_rank = get_rank($param) - 1;
        //as in redis rank is start from 0
    }
    if (isset($my_rank)) {
        $upper = floor($size * 0.5);
        $from_rank = max($my_rank - $upper, 0);
    } else {
        //if $my_rank not exists, show fromrank to torank
        $from_rank = isset($param['from']) && $param['from'] > 0 ? $param['from'] - 1 : RANKLIST_FROM;
    }
    $to_rank = $from_rank + $size - 1;
    $ranking_data = $redis->zRevRange(REDIS_TABLE_RANKING, $from_rank, $to_rank, true);
    //get user names and reconstuct return data
    $return_data = array();
    $count = 1;
    foreach ($ranking_data as $key => $score) {
        $username = $redis->hGet(REDIS_TABLE_USERS, $key);
        $return_data[] = array('rank' => $from_rank + $count++, 'user' => $key, 'username' => $username, 'score' => $score);
    }
    return $return_data;
}
Beispiel #2
0
			
						<li>
							<ul class="score">
								<li>Score: <?php 
            echo $score;
            ?>
 out of <?php 
            echo $amount;
            ?>
</li>
								<li class="center">Percentage: <?php 
            echo get_percentage($score, $amount);
            ?>
</li>
								<li>Rank: #<?php 
            echo get_rank($username, $quizid);
            ?>
 in <?php 
            echo $people;
            ?>
</li>
								<div class="clear"></div>
							</ul>
						</li>
<?php 
        }
    }
    if ($status == 'grade') {
        foreach ($main['query']->result() as $row) {
            ?>
						<li>
Beispiel #3
0
            <table class="table orders_table"> 
                <thead> 
                    <tr> 
                        <th>#</th>   
                        <th></th>   
                        <th>Catg</th>                       
                        <th>Tops</th>                             
                        <th>Flashs</th>
                        <th>Σ Flashs</th>   
                        <th>Σ</th>                        
                    </tr>                         
                </thead>                     
                <tbody style="display: table-row-group;"> 
                    <?php 
//echo $start;
$score_m = get_rank($cat, $start, $qty);
//vd($score_m);
//die;
$pos = $start;
foreach ($score_m as $key => $position) {
    $pos++;
    if ($pos % 2 == 0) {
        ///$color="#2F4F4F";
        $color = "#333";
    } else {
        $color = "black";
    }
    $color_gender = "blue";
    if ($position["gender"] == "female") {
        $color_gender = "red";
    }
Beispiel #4
0
    	}*/
    $changed = PlayerDAO::saveDetails($char);
    redirect('/stats.php?changed=' . (int) $changed . ($profile_changed ? '&profile_changed=1' : ''));
}
/*
if(false && DEBUG){
	$description = 'This is a description here and all';
	$goals = 'Kill ninja of the ramen clan';
	$beliefs = 'I believe in a one true ninja god';
	$instincts = 'When I hear whistling, I duck';
	$traits = 'Hardy, nervous, meaty, silent';
}
*/
$player = self_info();
//$player['created_date']=$player['created_date']? date("c", strtotime($player['created_date'])) : null;
$class_theme = class_theme($char->class_identity());
$level_category = level_category($player['level']);
$status_list = get_status_list();
$gravatar_url = generate_gravatar_url($player['player_id']);
$gurl = $gravatar_url;
$rank_display = get_rank($char_id);
// rank display.
$profile_editable = $player['messages'];
$parts = get_certain_vars(get_defined_vars(), ['player', 'level_category', 'status_list', 'description', 'goals', 'beliefs', 'instincts', 'traits', 'dev', 'changed']);
// Set the parts array's player clan if any is found.
if ($parts['player_clan'] = get_clan_by_player_id($char_id)) {
    // Set the char clan name and id for later usage.
    $parts['clan_name'] = $parts['player_clan']->getName();
    $parts['clan_id'] = $parts['player_clan']->getID();
}
display_page('stats.tpl', 'Ninja Stats', $parts, array('quickstat' => 'player'));
Beispiel #5
0
      <?php //start if done empty not true
						if($signoff_empty != true) { ?>
      <table class="myTable" cellpadding="0" cellpadding="0" class="listing" width="100%">
      <tr>
        <th class="" width="5%">Priority</th>
        <th class="" width="50%">Title</th>
        <th class="" width="15%">Warrior</th>
        <th class="" width="15%">Sweat Points</th>
        <th class="" width="12%">Payout</th>
        <th class="" width="1%"></th>
      </tr>
      <?php $c = count($work_list_signoff); for($i = 0; $i < $c; $i++): ?>
      <tr class="story-title <?php if($i%2){ ?>odd-row<?php }else{?>even-row<?php } ?>">
        <td><?php echo $work_list_signoff[$i]['priority'] ?></td>
        <td><span class="type_<?php echo $work_list_signoff[$i]['type'] ?>"> <?php echo $work_list_signoff[$i]['title'] ?></a> </span></td>
        <td><?php echo get_rank($work_list_signoff[$i]['work_horse']);?></td>
        <td><div class="sweat-shirt-<?php echo points_size($work_list_signoff[$i]['points']) ?>">
          <?php echo $work_list_signoff[$i]['points'] ?></td>
    </div>
    <td style="text-align: right"> RM <?php echo number_format($work_list_signoff[$i]['cost']) ?></td>
    <td><div class="arrow"> </div></td>
    </tr>
    <tr>
      <td colspan="6" class="details"><p> <?php echo $work_list_signoff[$i]['description'] ?> </p>
        <br />
        <a href="/story/<?php echo $work_list_signoff[$i]['work_id'] ?>">More details</a></td>
    </tr>
    <?php endfor; ?>
    </table>
    <?php }
						//start else signoff empty not true
Beispiel #6
0
function get_info($gc)
{
    //	if($relocation_flg==1){
    //			$tesuryou[1] = 20000;
    //			$tesuryou[2] = 20000;
    //			$tesuryou[3] = 20000;
    //			$tesuryou[4] = 20000;
    //	}else{
    //
    //		if($gc->menseki < 30){
    //			$tesuryou[1] = 20000;
    //			$tesuryou[2] = 13000;
    //			$tesuryou[3] = 10000;
    //			$tesuryou[4] =  5000;
    //		}elseif($gc->menseki < 50){
    //			$tesuryou[1] = 26000;
    //			$tesuryou[2] = 19000;
    //			$tesuryou[3] = 16000;
    //			$tesuryou[4] =  7000;
    //		}elseif($gc->menseki < 70){
    //			$tesuryou[1] = 35000;
    //			$tesuryou[2] = 25000;
    //			$tesuryou[3] = 20000;
    //			$tesuryou[4] =  8000;
    //		}else{
    //			$tesuryou[1] = 52000;
    //			$tesuryou[2] = 43000;
    //			$tesuryou[3] = 32000;
    //			$tesuryou[4] = 10000;
    //		}
    //
    //	}
    $relocation_flg = f_bool_edit_db($_POST["relocation_flg"], "0");
    $rank = get_rank($gc);
    if ($relocation_flg == 1) {
        $tesuryou[1] = 15000;
        $tesuryou[2] = 15000;
        $tesuryou[3] = 15000;
        $tesuryou[4] = 15000;
    } else {
        $tesuryou[1] = 15000;
        $tesuryou[2] = 15000;
        $tesuryou[3] = 8000;
        $tesuryou[4] = 8000;
    }
    $info["rank"] = $rank;
    //ライトプランのとき 金額だけ知りたいとき
    if ($_POST["purpose_flg"] == 1) {
        $info["tesuryou"] = 2500;
    } else {
        $info["tesuryou"] = $tesuryou[$rank];
    }
    return $info;
}
Beispiel #7
0
        $cmdr_rank_explore_icon .= '</a>';
        $cmdr_rank_cqc = "";
        $cmdr_rank_cqc_icon = "";
        if ($settings["show_cqc_rank"] == "true") {
            $cmdr_rank_cqc = $api["commander"]->{"rank"}->{"cqc"};
            $cmdr_rank_cqc_icon = '<a href="#" title="CQC rank: ' . get_rank("cqc", $cmdr_rank_cqc, false) . '">';
            $cmdr_rank_cqc_icon .= '<img src="' . get_rank("cqc", $cmdr_rank_cqc + 1) . '" class="status_img" alt="cqc" style="margin-right:6px" />';
            $cmdr_rank_cqc_icon .= '</a>';
        }
        /**
         * additional info
         */
        $cmdr_rank_fed = $api["commander"]->{"rank"}->{"federation"};
        $fed_rank = get_rank("federation", $cmdr_rank_fed, false);
        $cmdr_rank_empire = $api["commander"]->{"rank"}->{"empire"};
        $empire_rank = get_rank("empire", $cmdr_rank_empire, false);
        $additional = '<div id="cmdr_status_mi" style="display:none">';
        $additional .= '<strong>Federation rank:</strong> ' . $fed_rank . '<br />';
        $additional .= '<strong>Empire rank:</strong> ' . $empire_rank;
        $additional .= '</div>';
        $data["cmdr_status"] = $cmdr_rank_combat_icon . $cmdr_rank_trade_icon . $cmdr_rank_explore_icon . $cmdr_rank_cqc_icon . $additional;
        $data["cmdr_balance_status"] = '<img src="/style/img/rare.png" class="balance_pic" alt="Cr" />' . $cmdr_credits . ' CR';
    }
}
/**
 * show ship status
 */
$data["ship_status"] = "false";
if (isset($api["ship"]) && $settings["show_ship_status"] == "true") {
    if ($api["ship"] == "no_data") {
        $data["ship_status"] = '<a href="/Admin/API_login.php">No data, reconnect API</a>';
Beispiel #8
0
           <?php if($show_bid == true) { ?>      
               <?php foreach($bid_data as $bid) { ?>
               <tr>
                 <td><?php echo get_rank($bid['user_id']);?></td>
                 <td>RM <?php echo $bid['bid_cost']; ?></td>
                 <td><?php echo $bid['days']; ?></td>
                 <td><?php if($bid['bid_status'] == "Bid") { ?>
                     <?php if(strtolower($bid['work_status'])=='open' || strtolower($bid['work_status'])=='reject') {?><a href="/story/bid_accept/<?php echo $bid["bid_id"]; ?>">Accept</a><?php }else{?>No action <?php }?>
                   <?php } else { echo $bid['bid_status']; } ?>
                 </td>
               </tr>
               <?php } ?>
           <?php }else{ ?>
             <?php foreach($bid_data as $bid) if($bid['user_id'] == $userid){ ?>
             <tr>
               <td><?php echo get_rank($bid['user_id']);?></td>
               <td>RM <?php echo $bid['bid_cost']; ?></td>
               <td><?php echo $bid['days']; ?></td>
               <td><?php if($bid['bid_status'] == "Bid") { ?>Bid
                 <?php } else { echo $bid['bid_status']; } ?>
               </td>
             </tr>
             <?php } ?>
           <?php } ?>
             </table>
         </div>
     </div>
   </div>
 </div>
 <!--end of bid-admin tools-->
 <?php }?>
Beispiel #9
0
 */
/** @require functions */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
/** @require configs */
require_once $_SERVER["DOCUMENT_ROOT"] . "/source/config.inc.php";
$info = "";
/**
 * commander data
 */
if (isset($_GET["cmdr"])) {
    $search = $_GET["cmdr"];
    if (isset($api["commander"])) {
        if ($search == "balance") {
            $info = number_format($api["commander"]->{"credits"});
        } elseif ($search == "rank" && isset($_GET["of"])) {
            $info = get_rank($_GET["of"], $api["commander"]->{"rank"}->{$_GET["of"]}, false);
        }
    }
}
/**
 * ship data
 */
if (isset($_GET["ship"])) {
    $search = $_GET["ship"];
    if (isset($api["ship"])) {
        switch ($search) {
            case "name":
                $info = ship_name($api["ship"]->{"name"});
                break;
            case "health":
                $info = number_format($api["ship"]->{"health"}->{"hull"} / 10000, 1);
Beispiel #10
0
 $searched = in('searched', null, 'no filter');
 // Don't filter the search setting.
 $list_by_rank = $searched && substr_compare($searched, '#', 0, 1) === 0;
 // Whether the search is by rank.
 $hide_setting = !$searched && SESSION::is_set('hide_dead') ? SESSION::get('hide_dead') : 'dead';
 // Defaults to hiding dead via session.
 $hide = $searched ? 'none' : in('hide', $hide_setting);
 // search override > get setting > session setting
 $alive_only = $hide == 'dead';
 $page = in('page', 1);
 // Page will get changed down below.
 $alive_count = 0;
 $record_limit = 20;
 // *** The number of players that gets shown per page.
 $view_type = in('view_type');
 $rank = get_rank($char_id);
 $dead_count = query_item("SELECT count(player_id) FROM rankings WHERE alive = false");
 $page = in('page');
 if (!$searched && $hide_setting != $hide) {
     SESSION::set('hide_dead', $hide);
 }
 // Save the toggled state for later.
 // Display the clear search and create the where clause for searching.
 // If a search was made, specify letter or word-based search.
 // If unless showing dead, check that health is > 0, or alive = true from the ranking.
 // Otherwise, no searching was done, so the score
 $where_clauses = array();
 // Array to add where clauses to.
 // Select some players from the ranking.
 $queryParams = array();
 if ($searched) {
Beispiel #11
0
function get_rank_info($ranks_id, $programs_id, $id)
{
    global $rank;
    get_rank($ranks_id);
    echo $rank;
}
Beispiel #12
0
$h = new headers();
$h->startheaders();
include "mysql.php";
global $c;
$is = mysql_query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid={$userid}", $c) or die(mysql_error());
$ir = mysql_fetch_array($is);
check_level();
$fm = money_formatter($ir['money']);
$cm = money_formatter($ir['crystals'], '');
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm, $cm);
$h->menuarea();
print "<h3>General Info:</h2>";
$exp = (int) ($ir['exp'] / $ir['exp_needed'] * 100);
print "<table><tr><td><b>Name:</b> {$ir['username']}</td><td><b>Crystals:</b> {$cm}</td></tr><tr>\n<td><b>Level:</b> {$ir['level']}</td>\n<td><b>Exp:</b> {$exp}%</td></tr><tr>\n<td><b>Money:</b> {$fm}</td>\n<td><b>HP:</b> {$ir['hp']}/{$ir['maxhp']}</td></tr>\n<tr><td><b>Property:</b> {$ir['hNAME']}</td></tr></table>";
print "<hr><h3>Stats Info:</h3>";
$ts = $ir['strength'] + $ir['agility'] + $ir['guard'] + $ir['labour'] + $ir['IQ'];
$ir['strank'] = get_rank($ir['strength'], 'strength');
$ir['agirank'] = get_rank($ir['agility'], 'agility');
$ir['guarank'] = get_rank($ir['guard'], 'guard');
$ir['labrank'] = get_rank($ir['labour'], 'labour');
$ir['IQrank'] = get_rank($ir['IQ'], 'IQ');
$tsrank = get_rank($ts, 'strength+agility+guard+labour+IQ');
$ir['strength'] = number_format($ir['strength']);
$ir['agility'] = number_format($ir['agility']);
$ir['guard'] = number_format($ir['guard']);
$ir['labour'] = number_format($ir['labour']);
$ir['IQ'] = number_format($ir['IQ']);
$ts = number_format($ts);
print "<table><tr><td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td><td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr>\n<tr><td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr>\n<tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: {$tsrank}]</td></tr></table>";
$h->endpage();
Beispiel #13
0
function build_table($course)
{
    global $CFG;
    // Pull an iterator for grades for that user
    $iter = pull_grade_iterator($course->userid, $course->id);
    // Start the table object
    $table = new stdClass();
    $table->head = array(get_string('itemname', 'grades'), get_string('category', 'grades'), get_string('overridden', 'grades'), get_string('excluded', 'grades'), get_string('range', 'grades'), get_string('rank', 'grades'), get_string('feedback', 'grades'), get_string('finalgrade', 'grades'));
    $table->data = array();
    $table->rowclass = array();
    // Function to get ranks of students in a specific grade item
    $context = get_context_instance(CONTEXT_COURSE, $course->id);
    $total_users = get_total_users($course->id);
    foreach ($iter as $grade) {
        $line = array();
        $cat = $grade->sql_grade_item->get_parent_category();
        $fullname = $cat->fullname;
        $itemtype = $grade->sql_grade_item->itemtype;
        $decimals = $grade->sql_grade_item->get_decimals();
        $rowclass = '';
        if ($itemtype == 'category') {
            $rowclass = $itemtype;
            $itemname = $fullname . ' Category Total';
        } elseif ($itemtype == 'course') {
            $itemname = 'Course Total';
        } else {
            $itemname = $grade->sql_grade_item->itemname;
        }
        // Output the necessary information
        $line[] = $itemname;
        $line[] = $fullname == '?' ? $course->fullname : $fullname;
        $line[] = $grade->is_overridden() ? 'Y' : 'N';
        $line[] = $grade->is_excluded() ? 'Y' : 'N';
        $line[] = format_float($grade->sql_grade_item->grademin, $decimals) . '-' . format_float($grade->sql_grade_item->grademax, $decimals);
        $line[] = get_rank($grade, $total_users, $context);
        $line[] = format_text($grade->feedback, $grade->feedbackformat);
        $line[] = '<span class="' . passing_grade($grade->sql_grade_item->gradepass, $grade->finalgrade) . '">' . simple_grade_format_gradevalue($grade->finalgrade, $grade->sql_grade_item, true) . '</span>';
        $table->data[] = $line;
        $table->rowclass[] = $rowclass;
    }
    print_table($table);
}
Beispiel #14
0
        if ($ir['jail']) {
            $gain /= 2;
        }
        $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + {$gain} WHERE `userid` = {$userid}");
        $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = {$userid}");
        $inc = $ir[$stat] + $gain;
        $inc2 = $ir['energy'] - $_POST['amnt'];
        if ($stat == "strength") {
            print "\n      <div id='mainOutput' style='text-align: center; color: green;  width: 600px; border: 1px solid #222222; height: 70px;\n                        margin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n                        \n                        \n      You start to lift some weights, You go heavier and heavier until You are out of energy.<br />\n      You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights.<br />\n      You now have {$inc} strength and {$inc2} energy left. \n      \n      </div></div>   \n      \n      \n      ";
        } elseif ($stat == "agility") {
            print "\n       <div id='mainOutput' style='text-align: center; color: green;  width: 600px; border: 1px solid #222222; height: 70px;\n                        margin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n      You Begin to run on the treadmill, You keep tapping the faster button till you fly off the damn thing!.<br />\n      You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running.<br />\n      You now have {$inc} agility and {$inc2} energy left.\n      </div></div> ";
        } elseif ($stat == "guard") {
            print "\n      <div id='mainOutput' style='text-align: center; color: green;  width: 600px; border: 1px solid #222222; height: 70px;\n                        margin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n      You jump into the pool and begin swimming, you keep flapping your arms in the water like Michael Felps, you get a cramp and almost drown.<br />\n      You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming.<br />\n      You now have {$inc} guard and {$inc2} energy left.\n      </div></div> ";
        } elseif ($stat == "labour") {
            print "\n       <div id='mainOutput' style='text-align: center; color: green;  width: 600px; border: 1px solid #222222; height: 70px;\n                        margin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n      You walk over to the front desk, and ask the manager If you can volunteer to help the gym out, He says unload the boxes In the back, You unload boxes until the gym closes<br />\n      You have gained {$gain} labour by unloading {$_POST['amnt']} boxes.<br />\n      You now have {$inc} labour and {$inc2} energy left.\n      </div></div> ";
        }
        $ir['energy'] -= $_POST['amnt'];
        $ir[$stat] += $gain;
    }
}
$ir['strank'] = get_rank($ir['strength'], 'strength');
$ir['agirank'] = get_rank($ir['agility'], 'agility');
$ir['guarank'] = get_rank($ir['guard'], 'guard');
$ir['labrank'] = get_rank($ir['labour'], 'labour');
if ($ir['energy'] == "0") {
    print "\n\n<table width='90%'><tr><td><p>\nYou dont have any energy for taining <a href='crystaltemple.php?spend=refill'><font color='green'>[Refill Energy]</font></a></p></td></tr></table>\n<br /> \n";
} else {
    print "\n\n<table width='90%'><tr><td><p>\nYou can train up to <prb> {$ir['energy']} </prb> times with your\ncurrent energy.</p></td></tr></table>\n<br />";
}
print " \n  \n<table width='90%' class='table'>\n<tr>\n   <form action='gym.php' method='post'>\n   <input type='hidden' name='stat' value='Strength'></input>\n   <th width='15%'><ph2>Strength:</ph2></th>\n   <td width='15%'>{$ir['strength']}</td>\n   <td width='10%'>Rank {$ir['strank']}</td>\n   <td width='40%'>Times to train: <input name='amnt' type='text' style='color: black;background-color: white;' value='{$ir['energy']}' > </input> </td>\n   <td width='20%'>  <input type=image name='submit' src='images/trainbtn.jpg' alt='Home' border='0''> </input> </td>\n   </form>\n</tr>\n<tr>\n   <form action='gym.php' method='post'>\n   <input type='hidden' name='stat' value='Agility'></input>\n   <th width='15%'><ph2>Agility:</ph2></th>\n   <td width='15%'>{$ir['agility']}</td>\n   <td width='10%'>Rank {$ir['agirank']}</td>\n   <td width='40%'>Times to train: <input type='text' style='color: black;  background-color: white;' name='amnt' value='{$ir['energy']}'></input></td>\n   <td width='20%'><input type=image name='submit' src='images/trainbtn.jpg' alt='Home' border='0''> </input> </td>   \n   </form>\n</tr>\n<tr>\n   <form action='gym.php' method='post'>\n   <input type='hidden' name='stat' value='Guard'></input>\n   <th width='15%'><ph2>Guard:</ph2></th>\n   <td width='15%'>{$ir['guard']}</td>\n   <td width='10%'>Rank {$ir['guarank']}</td>\n   <td width='40%'>Times to train: <input type='text' style='color: black;  background-color: white;' name='amnt' value='{$ir['energy']}'></input></td>\n   <td width='20%'><input type=image name='submit' src='images/trainbtn.jpg' alt='Home' border='0''> </input> </td>   \n   </form>\n</tr>\n<tr>\n   <form action='gym.php' method='post'>\n   <input type='hidden' name='stat' value='Labour'></input>\n   <th width='15%'><ph2>Labour:</ph2></th>\n   <td width='15%'>{$ir['labour']}</td>\n   <td width='10%'>Rank {$ir['labrank']}</td>\n   <td width='40%'>Times to train: <input type='text' style='color: black; background-color: white;' name='amnt' value='{$ir['energy']}'></input></td>\n   <td width='20%'><input type=image name='submit' src='images/trainbtn.jpg' alt='Home' border='0''> </input> </td>   \n   </form>\n</tr>\n</table><br />";
$h->endpage();
Beispiel #15
0
<?php

include_once 'inc/functions.php';
include_once 'inc/session.php';
$title = 'My Profile - DSSD Student Portal';
$bday = date_create($user_check['birth_date']);
//$user_check from session.php
$start = date_create($user_check['start_date']);
$ranks_id = $user_check['ranks_id'];
$programs_id = $user_check['programs_id'];
$user_id = $user_check['id'];
//var_dump($user_check);
$rank_name = get_rank($ranks_id);
$next_rank_name = get_next_rank($ranks_id);
$program_name = get_program($programs_id);
$technique_list = get_techniques($ranks_id);
$working_technique_list = get_techniques($ranks_id + 1);
$class = get_class_times($ranks_id);
$start_time = new DateTime($class['start_time']);
$end_time = new DateTime($class['end_time']);
$start = $start_time->format('g:ia');
$end = $end_time->format('g:ia');
?>

<?php 
include_once 'inc/head.html';
?>

<body>

<?php 
Beispiel #16
0
	<th width="30">Rank</th>
    <th>Guild</th>
    <th>Shard</th>
    <th width="50">Time</th>
</tr>
</thead>
<tbody>
<?php 
    foreach ($boss->encounters as &$encounter) {
        ?>
<tr class="<?php 
        echo $i % 2 == 0 ? 'even' : 'odd';
        ?>
">
	<td align="center"><?php 
        echo get_rank($i++);
        ?>
</td>
	<td><a href="<?php 
        echo base_url();
        ?>
report/view/<?php 
        echo $encounter->hash;
        ?>
/<?php 
        echo $encounter->start;
        ?>
/<?php 
        echo $encounter->end;
        ?>
/"><?php 
Beispiel #17
0
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/
require_once "" . $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
$info = "";
/*
*	commander data
*/
if (isset($_GET["cmdr"])) {
    $search = $_GET["cmdr"];
    if (isset($api["commander"])) {
        if ($search == "balance") {
            $info = number_format($api["commander"]["credits"]);
        } elseif ($search == "rank" && isset($_GET["of"])) {
            $info = get_rank($_GET["of"], $api["commander"]["rank"][$_GET["of"]], false);
        }
    }
}
/*
*	ship data
*/
if (isset($_GET["ship"])) {
    $search = $_GET["ship"];
    if (isset($api["ship"])) {
        if ($search == "name") {
            $info = $api["ship"]["name"];
        } elseif ($search == "health") {
            $info = number_format($api["ship"]["health"]["hull"] / 10000, 1);
        } elseif ($search == "fuel") {
            $info = number_format($api["ship"]["fuel"]["main"]["level"] / $api["ship"]["fuel"]["main"]["capacity"] * 100, 1);
Beispiel #18
0
function forum_get_activity($type, $id, $moderators = array())
{
    global $apx, $db, $set, $user;
    $userdata = array();
    //Anzahl auslesen
    list($userCount) = $db->first("\n\t\tSELECT count(*)\n\t\tFROM " . PRE . "_forum_activity AS a\n\t\tWHERE a.type='" . addslashes($type) . "' AND a.id='" . intval($id) . "' AND a.userid!=0 AND a.time>'" . (time() - 300) . "' " . ($user->is_admin() ? '' : "AND ( a.invisible=0 OR a.userid='" . $user->info['userid'] . "' )") . "\n\t");
    list($totalCount) = $db->first("\n\t\tSELECT count(*)\n\t\tFROM " . PRE . "_forum_activity AS a\n\t\tWHERE a.type='" . addslashes($type) . "' AND a.id='" . intval($id) . "' AND a.time>'" . (time() - 300) . "'\n\t");
    $guestCount = $totalCount - $userCount;
    //Aktive User auslesen
    $data = $db->fetch("\n\t\tSELECT u.userid, u.username, u.groupid, u.forum_posts, g.gtype, a.time, a.invisible\n\t\tFROM " . PRE . "_forum_activity AS a\n\t\tLEFT JOIN " . PRE . "_user AS u USING(userid)\n\t\tLEFT JOIN " . PRE . "_user_groups AS g USING(groupid)\n\t\tWHERE a.type='" . addslashes($type) . "' AND a.id='" . intval($id) . "' AND a.userid!=0 AND a.time>'" . (time() - 300) . "' " . ($user->is_admin() ? '' : "AND ( a.invisible=0 OR a.userid='" . $user->info['userid'] . "' )") . "\n\t\tORDER BY u.username ASC\n\t");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $rankinfo = get_rank($res);
            $userdata[$i]['USERNAME'] = replace($res['username']);
            $userdata[$i]['USERID'] = $res['userid'];
            $userdata[$i]['RANK_COLOR'] = '#' . $rankinfo['color'];
            $userdata[$i]['INVISIBLE'] = $res['invisible'];
            if ($res['gtype'] == 'admin') {
                $userdata[$i]['IS_ADMIN'] = 1;
            } elseif ($res['gtype'] == 'indiv') {
                $userdata[$i]['IS_TEAM'] = 1;
            } elseif (in_array($res['userid'], $moderators)) {
                $userdata[$i]['IS_MODERATOR'] = 1;
            }
        }
    }
    return array($userCount, $guestCount, $userdata);
}
Beispiel #19
0
        if ($deleteAccount == 2) {
            SESSION::set('delete_attempts', 1);
            $error = 'Deleting of account failed, please email ' . SUPPORT_EMAIL;
        } else {
            $confirm_delete = true;
        }
    }
} else {
    if ($changeprofile == 1) {
        // Limit the profile length.
        if ($newprofile != "") {
            $sql->Update("UPDATE players SET messages = '" . sql($newprofile) . "' WHERE uname = '" . sql($username) . "'");
            $affected_rows = $sql->a_rows;
            $profile_changed = true;
        } else {
            $error = "Can not enter a blank profile.";
        }
    }
}
$level_and_cat = render_level_and_category($player['level']);
$status_list = render_status_section();
$avatar_display = render_avatar_section($player['player_id']);
// include and render from player.php
$rank_display = get_rank($username, $sql);
// rank display.
$health_section = render_health_section($player['health']);
$profile_editable = $player['messages'];
$profile_display = out($profile_editable);
$parts = get_certain_vars(get_defined_vars(), array('player'));
echo render_template("stats.tpl", $parts);
include SERVER_ROOT . "interface/footer.php";
Beispiel #20
0
    list($count['guests']) = $db->first("SELECT count(*) FROM " . PRE . "_user_online WHERE userid=0");
} else {
    $count['guests'] = 0;
}
$count['total'] = $count['users'] + $count['guests'];
$apx->tmpl->assign('ONLINE_TOTAL', $count['total']);
$apx->tmpl->assign('ONLINE_USERS', $count['users']);
$apx->tmpl->assign('ONLINE_GUESTS', $count['guests']);
$apx->tmpl->assign('ONLINE_INVISIBLE', $count['inv']);
$userdata = array();
$mods = get_modlist();
$data = $db->fetch("SELECT b.userid,b.username,b.forum_posts,b.pub_invisible AS invisible,c.gtype FROM " . PRE . "_user b LEFT JOIN " . PRE . "_user_groups AS c USING(groupid) WHERE ( b.lastactive>=" . (time() - $set['user']['timeout'] * 60) . " " . ($user->is_admin() ? '' : "AND ( b.pub_invisible=0 OR b.userid='" . $user->info['userid'] . "' )") . " ) ORDER BY b.username ASC");
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        $rankinfo = get_rank($res);
        $userdata[$i]['USERID'] = $res['userid'];
        $userdata[$i]['USERNAME'] = replace($res['username']);
        $userdata[$i]['INVISIBLE'] = $res['invisible'];
        if ($res['gtype'] == 'admin') {
            $userdata[$i]['IS_ADMIN'] = 1;
        } elseif ($res['gtype'] == 'indiv') {
            $userdata[$i]['IS_TEAM'] = 1;
        } elseif (in_array($res['userid'], $mods)) {
            $userdata[$i]['IS_MODERATOR'] = 1;
        }
    }
}
$apx->tmpl->assign('ONLINE', $userdata);
////////////////////////////////////////////////////////////////////////////////////////////// STATISTIK
list($threads) = $db->first("SELECT count(threadid) FROM " . PRE . "_forum_threads WHERE del=0 AND moved=0");
Beispiel #21
0
         $p->value->SetColor($color);
         $p->SetLegend(iconv("UTF-8", "GB2312//IGNORE", $k));
     }
     $graph->Stroke();
     exit;
 } else {
     if ($_REQUEST['act'] == 'history_rank') {
         $student_code = empty($_SESSION['student_code']) ? '' : trim($_SESSION['student_code']);
         //学生学号
         $subject = empty($_REQUEST['subject']) ? '' : trim($_REQUEST['subject']);
         //考试编码
         $prjs = get_exam_prjs($class_code);
         $prj_rank = array();
         foreach ($prjs as $k => $e) {
             $list = get_scores_by_exam($class_code, "", $e["code"], "");
             $exam_rank[$e["prj_code"]][$e["subject"]][] = get_rank($student_code, $list);
         }
         if (count($exam_rank) < 1) {
             die("目前没有数据!");
         }
         // 	print_r($exam_rank);echo '<br>';
         $title = $student_code . "-" . $list[0]["student_name"] . "同学历次考试名次走势图";
         $X = array();
         //横轴
         $datas = array();
         foreach ($exam_rank as $k => $v) {
             $X[] = iconv("UTF-8", "GB2312//IGNORE", $k);
             foreach ($v as $sk => $sv) {
                 $datas[$sk][] = $sv[0];
             }
         }
Beispiel #22
0
        if ($att['thumbnail']) {
            $imgatttable[$ai]['THUMBNAIL'] = HTTPDIR . getpath('uploads') . $att['thumbnail'];
            $imgatttable[$ai]['ICON'] = $typeicon[strtolower($mm->getext($att['name']))];
            $imgatttable[$ai]['NAME'] = replace($att['name']);
            $imgatttable[$ai]['LINK'] = 'attachments.php?getid=' . $att['id'];
            $imgatttable[$ai]['SIZE'] = forum_getsize($att['size']);
        } else {
            $atttable[$ai]['ICON'] = $typeicon[strtolower($mm->getext($att['name']))];
            $atttable[$ai]['NAME'] = replace($att['name']);
            $atttable[$ai]['LINK'] = 'attachments.php?getid=' . $att['id'];
            $atttable[$ai]['SIZE'] = forum_getsize($att['size']);
        }
    }
}
//Rang
$rankinfo = get_rank($userdat);
$apx->tmpl->assign('ID', $postinfo['postid']);
$apx->tmpl->assign('TITLE', replace($postinfo['title']));
$apx->tmpl->assign('TEXT', $text);
$apx->tmpl->assign('TIME', $postinfo['time']);
$apx->tmpl->assign('USERNAME', replace($postinfo['username']));
$apx->tmpl->assign('USERID', $postinfo['userid']);
$apx->tmpl->assign('USER_POSTS', $userdat['forum_posts']);
$apx->tmpl->assign('USER_REGTIME', $userdat['reg_time']);
$apx->tmpl->assign('IP', $postinfo['ip']);
$apx->tmpl->assign('HOMEPAGE', replace($userdat['homepage']));
$apx->tmpl->assign('AVATAR', $avatar);
$apx->tmpl->assign('AVATAR_TITLE', $avatar_title);
$apx->tmpl->assign('SIGNATURE', $signature);
$apx->tmpl->assign('CITY', replace($userdat['city']));
$apx->tmpl->assign('NEW', iif($postinfo['time'] > $lastvisit, 1, 0));
Beispiel #23
0
function get_info($gc) {

	$relocation_flg = f_bool_edit_db($_POST["relocation_flg"], "0");

	$rank = get_rank($gc);

	if($relocation_flg==1){
		$tesuryou[1] = 15000;
		$tesuryou[2] = 15000;
		$tesuryou[3] = 15000;
		$tesuryou[4] = 15000;
	}else{
		$tesuryou[1] = 15000;
		$tesuryou[2] = 15000;
		$tesuryou[3] =  8000;
		$tesuryou[4] =  8000;
	}

	$info["rank"] = $rank;
	//ライトプランのとき 金額だけ知りたいとき
	if($_POST["purpose_flg"] == 1){
		$info["tesuryou"] = 2500;
	}else{
		$info["tesuryou"] = $tesuryou[$rank];

	}
	return $info;

}
if ($searched) {
    $view_type = 'searched';
    if (strlen($searched) == 1) {
        $where_clause = "WHERE (uname ilike '{$searched}%')";
    } else {
        $where_clause = "WHERE (uname ~* '{$searched}')";
    }
} else {
    $where_clause = "WHERE score >= {$rank_spot} ";
}
if ($hide == 'dead') {
    $where_clause .= "AND alive = true";
}
$query_count = "SELECT count(player_id) FROM rankings " . $where_clause;
$totalrows = $sql->QueryItem($query_count);
$rank = get_rank($username, $sql);
//$microtimes[4] = microtime();
// Determine the current page spot navigated to.
// If searching, use the page between
// If no specific rank was requested, use the viewer's rank
// If a certain rank was requested, use that rank spot.
// Determine the page, if the dead count is more than the rank spot, default to 1, otherwise use the input page.
// Number of pages = ceil($totalrows / $record_limit);
// limit value = ($page * $record_limit) - $record_limit;
if ($searched > 0) {
    $page = ceil($searched / $record_limit);
} else {
    if ($page == "searched") {
        $page = in('page', 1);
    } else {
        if (!$rank_spot) {