MACHIN3

index.php

Aug 30th, 2021
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.94 KB | None | 0 0
  1. <?php
  2. //--------+ Load Config File #---------------+
  3.  
  4. require_once('config.php');
  5.  
  6. //--------# Load Style.css #----------------------+
  7.  
  8. echo '<link rel="stylesheet" href="style.css">';
  9.  
  10. //--------# Connect to Database #-----------------+
  11.  
  12. $db = mysqli_connect('localhost', $dbuser, $dbpassword) or die('Could not connect: ' . mysqli_error());
  13. mysqli_select_db($db, $dbname) or die('Could not select database');
  14.  
  15. //--------# Load Table From Database & Display Results #------------+
  16.        
  17.     echo("<title>Rust Kill Records</title>");
  18.     echo "<center><img src='images/Rust_logo.png' /></center><br>";
  19.     echo "<center><table style='width:800px' class=''>";
  20.  
  21.     echo "<center><table style='width:1000px' class=''>";
  22.     echo "<tr>";
  23.     echo "<td style='width:0%' class='forumheader4'></td>";
  24.     echo "<td style='width:10%' class='forumheader4'>Name</td>";
  25.     if($playerkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Player Kills</td>";}
  26.     if($chickenkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Chickens</td>";}
  27.     if($boarkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Boar</td>";}
  28.     if($stagkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Stag</td>";}
  29.     if($wolfkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Wolves</td>";}
  30.     if($bearkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Bears</td>";} 
  31.     if($scientistkills == 'true'){echo "<td style='width:5%' class='forumheader4'>Scientist</td>";}
  32.     if($tunneldweller == 'true'){echo "<td style='width:5%' class='forumheader4'>Tunnel Dweller</td>";}    
  33.     if($lootcontainers == 'true'){echo "<td style='width:5%' class='forumheader4'>Loot Container</td>";}       
  34.     if($animalcorpse == 'true'){echo "<td style='width:5%' class='forumheader4'>Animals Harvested</td>";}      
  35.     if($bodycorpse == 'true'){echo "<td style='width:5%' class='forumheader4'>Corpse Harvested</td>";}     
  36.     if($deaths == 'true'){echo "<td style='width:5%' class='forumheader4'>Deaths</td>";}
  37.     echo "</tr>";
  38.  
  39.     $i = '0';
  40.     $checkdb = "SELECT * FROM $tablename;";
  41.     $results = mysqli_query($db, $checkdb) or die('Player Data not Received: ' . mysqli_error($db));
  42.     while($row = $results->fetch_assoc()){
  43.     $i++;
  44.    
  45.     echo "<tr>";
  46.     echo "<td style='' class='forumheader3'>$i.</td>";
  47.     echo "<td style='' class='forumheader3'><a href='https://steamcommunity.com/profiles/".$row['steamid']."/' target='_blank'>".$row['Name']."</a></td>";
  48.     if($playerkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Player']."</td>";}
  49.     if($chickenkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Chicken']."</td>";}
  50.     if($boarkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Boar']."</td>";}
  51.     if($stagkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Stag']."</td>";}
  52.     if($wolfkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Wolf']."</td>";}
  53.     if($bearkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Bear']."</td>";}      
  54.     if($scientistkills == 'true'){echo "<td style='' class='forumheader3'>".$row['Scientist']."</td>";}
  55.     if($tunneldweller == 'true'){echo "<td style='' class='forumheader3'>".$row['TunnelDweller']."</td>";}     
  56.     if($lootcontainers == 'true'){echo "<td style='' class='forumheader3'>".$row['LootContainer']."</td>";}    
  57.     if($animalcorpse == 'true'){echo "<td style='' class='forumheader3'>".$row['Corpse']."</td>";}     
  58.     if($bodycorpse == 'true'){echo "<td style='' class='forumheader3'>".$row['Pcorpse']."</td>";}      
  59.     if($deaths == 'true'){echo "<td style='' class='forumheader3'>".$row['Deaths']."</td>";}
  60.     echo "</tr>";
  61.    
  62.     }
  63.        
  64.     echo "</table></center>";
  65.  
  66.  
  67. //--------------------------------------+
  68.     echo "<br><br><center><small>Rust KillRecords by MACHIN3 - <a href='http://www.skilledsoldiers.net' target='_blank'>www.skilledsoldiers.net</a> - <a href='http://discord.skilledsoldiers.net' target='_blank'>discord.skilledsoldiers.net</a></small></center>";
  69. //--------------------------------------+
  70.    
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment