<?php
include ("../inc/config.php");
echo'<title>S&P Install</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">';


$cSQL="CREATE TABLE IF NOT EXISTS `tbl_stars` (
  `stars_id` int(11) NOT NULL,
  `AEK971_count` int(11) NOT NULL,
  `AEK971_time` int(11) NOT NULL,
  `XM8_count` int(11) NOT NULL,
  `XM8_time` int(11) NOT NULL,
  `F2000_count` int(11) NOT NULL,
  `F2000_time` int(11) NOT NULL,
  `AUG_count` int(11) NOT NULL,
  `AUG_time` int(11) NOT NULL,
  `AN94_count` int(11) NOT NULL,
  `AN94_time` int(11) NOT NULL,
  `M416_count` int(11) NOT NULL,
  `M416_time` int(11) NOT NULL,
  `M16_count` int(11) NOT NULL,
  `M16_time` int(11) NOT NULL,
  `M16K_count` int(11) NOT NULL,
  `M16K_time` int(11) NOT NULL,
  `9A91_count` int(11) NOT NULL,
  `9A91_time` int(11) NOT NULL,
  `SCAR_count` int(11) NOT NULL,
  `SCAR_time` int(11) NOT NULL,
  `XM8C_count` int(11) NOT NULL,
  `XM8C_time` int(11) NOT NULL,
  `AKS74U_count` int(11) NOT NULL,
  `AKS74U_time` int(11) NOT NULL,
  `UZI_count` int(11) NOT NULL,
  `UZI_time` int(11) NOT NULL,
  `PP2000_count` int(11) NOT NULL,
  `PP2000_time` int(11) NOT NULL,
  `UMP_count` int(11) NOT NULL,
  `UMP_time` int(11) NOT NULL,
  `UMPK_count` int(11) NOT NULL,
  `UMPK_time` int(11) NOT NULL,
  `PKM_count` int(11) NOT NULL,
  `PKM_time` int(11) NOT NULL,
  `M249_count` int(11) NOT NULL,
  `M249_time` int(11) NOT NULL,
  `QJU88_count` int(11) NOT NULL,
  `QJU88_time` int(11) NOT NULL,
  `M60_count` int(11) NOT NULL,
  `M60_time` int(11) NOT NULL,
  `XM8LMG_count` int(11) NOT NULL,
  `XM8LMG_time` int(11) NOT NULL,
  `MG36_count` int(11) NOT NULL,
  `MG36_time` int(11) NOT NULL,
  `MG3_count` int(11) NOT NULL,
  `MG3_time` int(11) NOT NULL,
  `MG3K_count` int(11) NOT NULL,
  `MG3K_time` int(11) NOT NULL,
  `M24_count` int(11) NOT NULL,
  `M24_time` int(11) NOT NULL,
  `QBU88_count` int(11) NOT NULL,
  `QBU88_time` int(11) NOT NULL,
  `SV98_count` int(11) NOT NULL,
  `SV98_time` int(11) NOT NULL,
  `SVU_count` int(11) NOT NULL,
  `SVU_time` int(11) NOT NULL,
  `GOL_count` int(11) NOT NULL,
  `GOL_time` int(11) NOT NULL,
  `VSS_count` int(11) NOT NULL,
  `VSS_time` int(11) NOT NULL,
  `M95_count` int(11) NOT NULL,
  `M95_time` int(11) NOT NULL,
  `M95K_count` int(11) NOT NULL,
  `M95K_time` int(11) NOT NULL,
  `M9_count` int(11) NOT NULL,
  `M9_time` int(11) NOT NULL,
  `M1911_count` int(11) NOT NULL,
  `M1911_time` int(11) NOT NULL,
  `MP443_count` int(11) NOT NULL,
  `MP443_time` int(11) NOT NULL,
  `MP412_count` int(11) NOT NULL,
  `MP412_time` int(11) NOT NULL,
  `M9-3_count` int(11) NOT NULL,
  `M9-3_time` int(11) NOT NULL,
  `870MCS_count` int(11) NOT NULL,
  `870MCS_time` int(11) NOT NULL,
  `NS2000_count` int(11) NOT NULL,
  `NS2000_time` int(11) NOT NULL,
  `SPAS12_count` int(11) NOT NULL,
  `SPAS12_time` int(11) NOT NULL,
  `S20K_count` int(11) NOT NULL,
  `S20K_time` int(11) NOT NULL,
  `USAS12_count` int(11) NOT NULL,
  `USAS12_time` int(11) NOT NULL,
  `M1A1THOMPSON_count` int(11) NOT NULL,
  `M1A1THOMPSON_time` int(11) NOT NULL,
  `MK14EBR_count` int(11) NOT NULL,
  `MK14EBR_time` int(11) NOT NULL,
  `GARAND_count` int(11) NOT NULL,
  `GARAND_time` int(11) NOT NULL,
  `MP7_count` int(11) NOT NULL,
  `MP7_time` int(11) NOT NULL,
  `M16A1V_count` int(11) NOT NULL,
  `M16A1V_time` int(11) NOT NULL,
  `AK47V_count` int(11) NOT NULL,
  `AK47V_time` int(11) NOT NULL,
  `M79V_count` int(11) NOT NULL,
  `M79V_time` int(11) NOT NULL,
  `M14V_count` int(11) NOT NULL,
  `M14V_time` int(11) NOT NULL,
  `M2V_count` int(11) NOT NULL,
  `M2V_time` int(11) NOT NULL,
  `MAC10V_count` int(11) NOT NULL,
  `MAC10V_time` int(11) NOT NULL,
  `UZIV_count` int(11) NOT NULL,
  `UZIV_time` int(11) NOT NULL,
  `M60V_count` int(11) NOT NULL,
  `M60V_time` int(11) NOT NULL,
  `RPKV_count` int(11) NOT NULL,
  `RPKV_time` int(11) NOT NULL,
  `XM22V_count` int(11) NOT NULL,
  `XM22V_time` int(11) NOT NULL,
  `M21V_count` int(11) NOT NULL,
  `M21V_time` int(11) NOT NULL,
  `SVDV_count` int(11) NOT NULL,
  `SVDV_time` int(11) NOT NULL,
  `M40V_count` int(11) NOT NULL,
  `M40V_time` int(11) NOT NULL,
  `TT33V_count` int(11) NOT NULL,
  `TT33V_time` int(11) NOT NULL,
  `FLAMETHROWER_count` int(11) NOT NULL,
  `FLAMETHROWER_time` int(11) NOT NULL,
  `KORN_count` int(11) NOT NULL,
  `KORN_time` int(11) NOT NULL,
  `TOW2_count` int(11) NOT NULL,
  `TOW2_time` int(11) NOT NULL,
  `X312_count` int(11) NOT NULL,
  `X312_time` int(11) NOT NULL,
  `KORD_count` int(11) NOT NULL,
  `KORD_time` int(11) NOT NULL,
  `VADS_count` int(11) NOT NULL,
  `VADS_time` int(11) NOT NULL,
  `X307_count` int(11) NOT NULL,
  `X307_time` int(11) NOT NULL,
  `QLZ8_count` int(11) NOT NULL,
  `QLZ8_time` int(11) NOT NULL,
  `CAVJ_count` int(11) NOT NULL,
  `CAVJ_time` int(11) NOT NULL,
  `MI28_count` int(11) NOT NULL,
  `MI28_time` int(11) NOT NULL,
  `MI24_count` int(11) NOT NULL,
  `MI24_time` int(11) NOT NULL,
  `UAV1_count` int(11) NOT NULL,
  `UAV1_time` int(11) NOT NULL,
  `AH60_count` int(11) NOT NULL,
  `AH60_time` int(11) NOT NULL,
  `AH64_count` int(11) NOT NULL,
  `AH64_time` int(11) NOT NULL,
  `KA52_count` int(11) NOT NULL,
  `KA52_time` int(11) NOT NULL,
  `COBR_count` int(11) NOT NULL,
  `COBR_time` int(11) NOT NULL,
  `HUMV_count` int(11) NOT NULL,
  `HUMV_time` int(11) NOT NULL,
  `VODN_count` int(11) NOT NULL,
  `VODN_time` int(11) NOT NULL,
  `T90R_count` int(11) NOT NULL,
  `T90R_time` int(11) NOT NULL,
  `M1A2_count` int(11) NOT NULL,
  `M1A2_time` int(11) NOT NULL,
  `BMD3_count` int(11) NOT NULL,
  `BMD3_time` int(11) NOT NULL,
  `M3A3_count` int(11) NOT NULL,
  `M3A3_time` int(11) NOT NULL,
  `BMDA_count` int(11) NOT NULL,
  `BMDA_time` int(11) NOT NULL,
  `PBLB_count` int(11) NOT NULL,
  `PBLB_time` int(11) NOT NULL,
  `PBRV_count` int(11) NOT NULL,
  `PBRV_time` int(11) NOT NULL,
  `HUEYV_count` int(11) NOT NULL,
  `HUEYV_time` int(11) NOT NULL,
  `T54V_count` int(11) NOT NULL,
  `T54V_time` int(11) NOT NULL,
  `M48V_count` int(11) NOT NULL,
  `M48V_time` int(11) NOT NULL,
  `G69V_count` int(11) NOT NULL,
  `G69V_time` int(11) NOT NULL,
  `ACV-S_count` int(11) NOT NULL,
  `ACV-S_time` int(11) NOT NULL,
  `40MMGL_count` int(11) NOT NULL,
  `40MMGL_time` int(11) NOT NULL,
  `40MMSG_count` int(11) NOT NULL,
  `40MMSG_time` int(11) NOT NULL,
  `40MMSMK_count` int(11) NOT NULL,
  `40MMSMK_time` int(11) NOT NULL,
  `PWR-700_count` int(11) NOT NULL,
  `PWR-700_time` int(11) NOT NULL,
  `RPG7_count` int(11) NOT NULL,
  `RPG7_time` int(11) NOT NULL,
  `M2CG_count` int(11) NOT NULL,
  `M2CG_time` int(11) NOT NULL,
  `M136_count` int(11) NOT NULL,
  `M136_time` int(11) NOT NULL,
  `ATM-00_count` int(11) NOT NULL,
  `ATM-00_time` int(11) NOT NULL,
  `DEFIB_count` int(11) NOT NULL,
  `DEFIB_time` int(11) NOT NULL,
  `MRTR-5_count` int(11) NOT NULL,
  `MRTR-5_time` int(11) NOT NULL,
  `DTN-4_count` int(11) NOT NULL,
  `DTN-4_time` int(11) NOT NULL,
  `HG-2_count` int(11) NOT NULL,
  `HG-2_time` int(11) NOT NULL,
  `KNV-1_count` int(11) NOT NULL,
  `KNV-1_time` int(11) NOT NULL,
  `COAXMG_count` int(11) NOT NULL,
  `COAXMG_time` int(11) NOT NULL,
  `SYRINGEV_count` int(11) NOT NULL,
  `SYRINGEV_time` int(11) NOT NULL,
  `TNTV_count` int(11) NOT NULL,
  `TNTV_time` int(11) NOT NULL,
  `MORTARV_count` int(11) NOT NULL,
  `MORTARV_time` int(11) NOT NULL,
  `ROADKILL_count` int(11) NOT NULL,
  `ROADKILL_time` int(11) NOT NULL,
  `D2.0_count` int(11) NOT NULL,
  `D2.0_time` int(11) NOT NULL,
  `TORCHV_count` int(11) NOT NULL,
  `TORCHV_time` int(11) NOT NULL,
  `UNKNOWN_count` int(11) NOT NULL,
  `UNKNOWN_time` int(11) NOT NULL,
  `smg_count` int(11) NOT NULL,
  `assault_count` int(11) NOT NULL,
  `recon_count` int(11) NOT NULL,
  `medic_count` int(11) NOT NULL,
  `pistol_count` int(11) NOT NULL,
  `shotgun_count` int(11) NOT NULL,
  `time1_count` int(11) NOT NULL,
  `time2_count` int(11) NOT NULL,
  `time3_count` int(11) NOT NULL,
  `head2_count` int(11) NOT NULL,
  `knife2_count` int(11) NOT NULL,
  `grenade2_count` int(11) NOT NULL,
  `vietnam_count` int(11) NOT NULL,
  `light_count` int(11) NOT NULL,
  `heavy_count` int(11) NOT NULL,
  `air_count` int(11) NOT NULL,
  `kills_count` int(11) NOT NULL,
  `flame_count` int(11) NOT NULL,
  `water_count` int(11) NOT NULL,
  `stat_count` int(11) NOT NULL,
  `grenade_count` int(11) NOT NULL,
  `head_count` int(11) NOT NULL,
  `knife_count` int(11) NOT NULL,
  `c4_count` int(11) NOT NULL,
  `smg_time` int(11) NOT NULL,
  `assault_time` int(11) NOT NULL,
  `recon_time` int(11) NOT NULL,
  `medic_time` int(11) NOT NULL,
  `pistol_time` int(11) NOT NULL,
  `shotgun_time` int(11) NOT NULL,
  `time1_time` int(11) NOT NULL,
  `time2_time` int(11) NOT NULL,
  `time3_time` int(11) NOT NULL,
  `head2_time` int(11) NOT NULL,
  `knife2_time` int(11) NOT NULL,
  `grenade2_time` int(11) NOT NULL,
  `vietnam_time` int(11) NOT NULL,
  `light_time` int(11) NOT NULL,
  `heavy_time` int(11) NOT NULL,
  `air_time` int(11) NOT NULL,
  `kills_time` int(11) NOT NULL,
  `flame_time` int(11) NOT NULL,
  `water_time` int(11) NOT NULL,
  `stat_time` int(11) NOT NULL,
  `grenade_time` int(11) NOT NULL,
  `head_time` int(11) NOT NULL,
  `knife_time` int(11) NOT NULL,
  `c4_time` int(11) NOT NULL,
  `last_count` int(11) NOT NULL,
  `last_weapon` varchar(255) NOT NULL,
  `last_time` int(11) NOT NULL,
  PRIMARY KEY (`stars_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;"; 

if(mysql_query($cSQL)){
$stars_created = 'Table tbl_stars created<img src="../img/tick.png" border="0" /><br>';
}else{
$stars_created = 'Table not created '.mysql_error().'<img src="../img/cross.png" border="0" /><br>';
}


$cSQL="ALTER TABLE tbl_playerdata ADD (
  `tUpdate` int(11) NOT NULL,
  `BonusPoints` int(11) NOT NULL
  )"; 

if(mysql_query($cSQL)){
$playerdata_update = 'Table tbl_playerdata Updated<img src="../img/tick.png" border="0" /><br>';
}else{
$playerdata_update = 'Table tbl_playerdata not Updated '.mysql_error().'<img src="../img/cross.png" border="0" /><br>';
}

$cSQL="CREATE TABLE IF NOT EXISTS `tbl_general` (
  `LastCleanup` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";

if(mysql_query($cSQL)){
$tbl_general_created = 'Table tbl_general created<img src="../img/tick.png" border="0" /><br>';
}else{
$tbl_general_created = 'Table tbl_general not created '.mysql_error().'<img src="../img/cross.png" border="0" /><br>';
}


$cSQL="INSERT INTO `tbl_general` (`LastCleanup`) VALUES ('2011-01-26 16:31:01');";
if(mysql_query($cSQL)){
	
$insert_g_created = 'Insert Into general<img src="../img/tick.png" border="0" /><br>';
}else{
$insert_g_created = 'Not Insert Into general '.mysql_error().'<img src="../img/cross.png" border="0" /><br>';
}

$cSQL="CREATE TABLE IF NOT EXISTS `tbl_bfbcs` (
  `bfbcsID` int(11) NOT NULL,
  `Rank` int(11) NOT NULL DEFAULT '0',
  `Kills` int(11) NOT NULL DEFAULT '0',
  `Deaths` int(11) NOT NULL DEFAULT '0',
  `Score` int(11) NOT NULL DEFAULT '0',
  `Elo` double NOT NULL DEFAULT '0',
  `Level` double NOT NULL DEFAULT '0',
  `Time` double NOT NULL DEFAULT '0',
  `LastUpdate` datetime DEFAULT NULL,
  PRIMARY KEY (`bfbcsID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";

if(mysql_query($cSQL)){
$tbl_bfbcs = 'Table tbl_bfbcs created<img src="../img/tick.png" border="0" /><br>';
}else{
$tbl_bfbcs = 'Table tbl_bfbcs exists on Database <img src="../img/cross.png" border="0" /><br>';
}

?>
	<html>
		<head>
			<title>SQL Table created</title>
		</head>
		<table class="default_h" cellspacing="0" cellpadding="0" style="background:#11151A;filter: alpha(opacity=80); opacity: 0.85; -moz-opacity: 0.85;margin:auto;">
			<tr>
				<td class="head" colspan="5">Tables createt</td>
			</tr>
			<tr>
				<td class="result">
					<span>
						<br /><br /><?php echo $stars_created; ?>
						<br /><?php echo $playerdata_update; ?>
						<br /><?php echo $tbl_general_created; ?>
						<br /><?php echo $insert_g_created; ?>
						<br /><?php echo $tbl_bfbcs; ?>
					</span>
				</td>
			</tr>
		</table>
	</html>
<?php	