Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
- <title>.: Anthology's Team | Webadmin - Shuffle Time :.</title>
- <link rel="stylesheet" media="screen" type="text/css" title="style" href="../style/matchmaker.css" />
- <!--
- <script language="JavaScript">
- window.resizeTo(500,500)
- </script>
- -->
- </head>
- <body>
- <p>
- <?php
- ############################################
- # Anthology's Webadmin #
- # Matchmaker #
- ############################################
- ## Page generant le formulaire qui listera tout les utilisateurs disponible du Mumble ##
- // Different include necessaire
- include('../inc/config.inc.php');
- // Connexion à la BDD
- mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
- mysql_select_db($db_bd) or die(mysql_error());
- // Include necessaire APRES la connexion à la BDD
- include('../inc/functions.php');
- if(!empty($_COOKIE["username_ant"]) OR !empty($_COOKIE["password_ant"])){
- $_SESSION['user'] = $_COOKIE['username_ant'];
- $_SESSION['password'] = $_COOKIE['password_ant'];
- // On recupere toutes les infos possibles sur l'utilisateur
- $query = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE username = '".$_SESSION['user']."' AND password = '".$_SESSION['password']."'"));
- if($query){ // Si on a bien un utilisateur pour ce pseudo et ce mot de passe
- // Liste des variables dont on pourrait avoir besoin dans cette page
- $_SESSION['level'] = $query['level'];
- $_SESSION['vip'] = $query['vip'];
- }
- }
- // On verifie que la Webadmin ne soit pas OFF
- $webadmin_status = WebadminStatus();
- if($webadmin_status == "1"){
- ////////////////////////////////////////////////////////////////////////////////////
- if($_SESSION['level'] <= '2' && !$_SESSION['vip']){
- echo'<table class="bordercolor" border="0">';
- foreach($_POST as $key => $value){
- $players[] = htmlspecialchars($key);
- }
- shuffle($players);
- $global = count($players);
- $count_team1 = (($global - ($global % '2')) / 2);
- $count_team2 = ($global - $count_team1);
- $team1 = '';
- $team2 = '';
- $i = 1;
- foreach($players as $key => $value) {
- if ($i <= $count_team1) {
- $team1[] = $value;
- } else {
- $team2[] = $value;
- }
- $i++;
- }
- $i = '0';
- echo '<tr>
- <td class="Cell_Couleur1" nowrap><b>Team 1</b></td>
- <td class="Cell_Couleur1" nowrap><b>Team 2</b></td>
- </tr>';
- while($i != $count_team2){
- echo '
- <tr>';
- if(isset($team1[$i])){
- echo '<td class="Cell_Couleur2" nowrap>'.htmlspecialchars($team1[$i]).'</td>';
- }else{
- echo '<td class="Cell_Couleur2" nowrap></td>';
- }
- if(isset($team2[$i])){
- echo '<td class="Cell_Couleur2" nowrap>'.htmlspecialchars($team2[$i]).'</td>';
- }else{
- echo '<td class="Cell_Couleur2" nowrap></td>';
- }
- echo '</tr>';
- $i++;
- }
- }else{
- echo '<br /><br /><span class="red">Sorry, mais visiblement tu na pas le droit d\'être ici!</span>';
- }
- ////////////////////////////////////////////////////////////////////////////////////
- // Parsage + Affichage du contenu
- }else{
- echo $webadmin_status;
- }
- ?>
- </p>
- </form>
- </body>
- </html>
- </p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement