forked from halo-battle/game
Version 0.9b
This commit is contained in:
parent
59fbc7104e
commit
73645ccc1f
25 changed files with 841 additions and 466 deletions
|
|
@ -1,13 +1,46 @@
|
|||
<?php
|
||||
echo"<html>
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
$race=$_SESSION['race'];
|
||||
if (isset($_SESSION['dernPage']) && $_SESSION['dernPage'] != '' && !isset($_GET['pas'])) {
|
||||
header('Location: '.$_SESSION['dernPage']);
|
||||
$_SESSION['dernPage'] = '';
|
||||
exit;
|
||||
}
|
||||
$_SESSION['dernPage'] = '';
|
||||
|
||||
include 'bdd.php';
|
||||
include 'ressourcetem.php';
|
||||
require('../connectBDD.php');
|
||||
|
||||
require('../template.php');
|
||||
$template = new Template('../templates/'.$templates);
|
||||
|
||||
$template->set_filenames(array('stat_body' => 'stat_body.tpl','stat_playertable'=>'stat_playertable.tpl', 'stat_playertable_header'=>'stat_playertable_header.tpl' ,'stat_playertable_footer'=>'stat_playertable_footer.tpl'));
|
||||
|
||||
// Nombre de joueur affiché par page de classement
|
||||
$nbppage = 100;
|
||||
|
||||
if (isset($_POST['type'])) $type = $_POST['type'];
|
||||
else $type = 'points';
|
||||
|
||||
$parse = $lang;
|
||||
$who = (isset($_POST["who"]))?$_POST["who"]:$_GET["who"];
|
||||
$numpage = $start = (isset($_POST["start"]))?(floor($_POST["start"])*$nbppage):0;
|
||||
|
||||
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
|
||||
<head>
|
||||
<title>Halo battle</title>
|
||||
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
|
||||
<meta http-equiv=pragma content=no-cache >
|
||||
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
|
||||
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=windows-1252" />
|
||||
<link rel="stylesheet" media="screen" type="text/css" title="design" href="descriptions/diz/base.css" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="content-type" content="text/html;charset=iso-8869-1" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||
|
||||
<style TYPE=text/css>
|
||||
<style type="text/css">
|
||||
table {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
|
@ -17,19 +50,47 @@ min-width: 15px;
|
|||
</style>
|
||||
</head>
|
||||
|
||||
<body>";
|
||||
<body>';
|
||||
|
||||
require('../connectBDD.php');
|
||||
$parse['who'] = '
|
||||
<option value="player"'.(($who == "player") ? " selected=\"selected\"" : "").'>Pseudo</option>
|
||||
<option value="ally"'.(($who == "ally") ? " selected=\"selected\"" : "").'>Alliance</option>';
|
||||
|
||||
echo "<table align=center><tr><td>Place</td><td>Race</td><td>Pseudo</td><td class=z>Points</td><td class=z>Flotte</td><td class=z>Recherches</td></tr>";
|
||||
$ee = mysql_query("SELECT * FROM classement ORDER BY points DESC");
|
||||
$i=1;
|
||||
while ( $data = mysql_fetch_array($ee) ){
|
||||
echo "<tr><td>".$i."</td><td>".$data['race']."</td><td>".$data['pseudo']."</td><td>".$data['points']."</td><td>".$data['flottes']."</td><td>".$data['recherches']."</td></tr>";
|
||||
$i++;
|
||||
if (!isset($type)) $type='pts';
|
||||
$parse['type'] = '
|
||||
<option value="points"'.(($type == "points") ? " selected=\"selected\"" : "").'>Points</option>
|
||||
<option value="batiments"'.(($type == "batiments") ? " selected=\"selected\"" : "").'>Batiment</option>
|
||||
<option value="flottes"'.(($type == "flottes") ? " selected=\"selected\"" : "").'>Flotte</option>
|
||||
<option value="recherches"'.(($type == "recherches") ? " selected=\"selected\"" : "").'>Recherches</option>';
|
||||
|
||||
if (!isset($start)) $start='0';
|
||||
|
||||
if($who == "ally"){
|
||||
}
|
||||
echo "</table>
|
||||
else {
|
||||
$test = mysql_query("SELECT * FROM classement");
|
||||
$nb = mysql_num_rows($test);
|
||||
$parse['start'] = '';
|
||||
for ($c=0; $c*$nbppage<$nb ; $c++) {
|
||||
$parse['start'] .= '<option value="'.$c.'"'.(($numpage/$nbppage == $c) ? " selected=\"selected\"" : "").'>'.($c*$nbppage+1).'-'.(($c+1)*$nbppage).'</option>';
|
||||
}
|
||||
$test = mysql_query("SELECT * FROM classement ORDER BY $type DESC LIMIT $numpage, $nbppage");
|
||||
$i=$numpage+1;
|
||||
|
||||
</body>
|
||||
</html>";
|
||||
$template->assign_vars( array('who' => $parse['who'],'type' => $parse['type'], 'start' => $parse['start']));
|
||||
$template->pparse('stat_body');
|
||||
$template->assign_vars( array('who' => $parse['who'],'type' => $parse['type'], 'start' => $parse['start'], 'body_table' => $parse['body_table']));
|
||||
$template->pparse('stat_playertable_header');
|
||||
|
||||
while ($row = mysql_fetch_assoc($test)){
|
||||
$table = $template->assign_vars( array('player_rank' => separerNombres($i), 'player_name' => $row['pseudo'], 'player_points' => separerNombres($row[$type]), 'player_mes'=> '<a href="envoyer_message.php?pseudo='.trouvNom($row['id']).'"><img src="descriptions/diz/m.gif" alt="" /></a>'));
|
||||
$parse['body_values'] .= $template->pparse('stat_playertable');
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$template->pparse('stat_playertable_footer');
|
||||
|
||||
echo '</table></body></html>';
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue