<?php
// INCLUDE HEADER IN PAGE
include('other_header.php');
// GET CURRENT DATE AND TIME
$date = date('Y-m-d H:i:s');
if(isset($_POST['success'])) {
	if($_POST['success'] == 'loggedin') {
	?>
	<div style="margin-top: -80px;" class="alert alert-success" role="alert">
		<strong>Well done!</strong> Successfully logged in.
	</div>
	<?php
	}
}
?>
  <div class="container">

    <div class="text-center">
      <h1><?php echo $title; ?> <small>/ Last 7 used IP addresses</small></h1>
    </div>

    <!-- BASE CSS   =========================================================== -->

    <!-- Tables -->

    <div class="row">
      <div class="col-md-8 col-md-offset-2">
		<div class="row">
			<div class="col-md-8 col-md-offset-2">
				<center>
			<table style="width:100%;max-width:100%" class="table table-bordered" data-effect="fade">
              <thead>
                <tr>
                  <th style="width:50%;max-width:50%">#</th>
                  <th style="width:50%;max-width:50%">IP</th>
                </tr>
              </thead>
              <tbody>
				  <?php
					$session_username = mysql_real_escape_string($_SESSION['username']);
					//LAST1IP
               $l1p = "SELECT `last1ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l1p = mysql_query($l1p) or die($l1p."<br/><br/>".mysql_error());
					$l1p = mysql_result($l1p, 0);
					//LAST1IP
               $l2p = "SELECT `last2ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l2p = mysql_query($l2p) or die($l2p."<br/><br/>".mysql_error());
					$l2p = mysql_result($l2p, 0);
					//LAST1IP
               $l3p = "SELECT `last3ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l3p = mysql_query($l3p) or die($l3p."<br/><br/>".mysql_error());
					$l3p = mysql_result($l3p, 0);
					//LAST1IP
               $l4p = "SELECT `last4ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l4p = mysql_query($l4p) or die($l4p."<br/><br/>".mysql_error());
					$l4p = mysql_result($l4p, 0);
					//LAST1IP
               $l5p = "SELECT `last5ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l5p = mysql_query($l5p) or die($l5p."<br/><br/>".mysql_error());
					$l5p = mysql_result($l5p, 0);
					//LAST1IP
               $l6p = "SELECT `last6ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l6p = mysql_query($l6p) or die($l6p."<br/><br/>".mysql_error());
					$l6p = mysql_result($l6p, 0);
					//LAST1IP
               $l7p = "SELECT `last7ip` FROM `Accounts_Classic_Publishers` WHERE `username` = '$session_username'";
					$l7p = mysql_query($l7p) or die($l7p."<br/><br/>".mysql_error());
					$l7p = mysql_result($l7p, 0);
					?>
							<tr style='color: #FFF; background-color: #DF691A;'>
								<td>
									1
								</td>
								<td>
									<b><?php echo $l1p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #2B3E50;'>
								<td>
									2
								</td>
								<td>
									<b><?php echo $l2p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #DF691A;'>
								<td>
									3
								</td>
								<td>
									<b><?php echo $l3p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #2B3E50;'>
								<td>
									4
								</td>
								<td>
									<b><?php echo $l4p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #DF691A;'>
								<td>
									5
								</td>
								<td>
									<b><?php echo $l5p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #2B3E50;'>
								<td>
									6
								</td>
								<td>
									<b><?php echo $l6p; ?></b>
								</td>
							</tr>
							<tr style='color: #FFF; background-color: #DF691A;'>
								<td>
									7
								</td>
								<td>
									<b><?php echo $l7p; ?></b>
								</td>
							</tr>
						</tbody>
					</table>
					</center>
					</div>
				</div>
			</div>
        </div>
      </div>

<?php
include('other_footer.php');
?>
