<?php

include 'config/config.php';

include 'common/header.php';

$error = "";

$page=1;//Default page

$limit=20;//Records per page

$next=2;

$prev=1;

//starts displaying records from 0

$data = mysql_query("SELECT id FROM stats where worth>0");

$rows = mysql_num_rows($data);

$last = ceil($rows/$limit);

if(isset($_GET['page']) && $_GET['page']!='' && ($_GET['page']>=1 && $_GET['page']<=$last))

{

$page=$_GET['page'];

if($page>1)

$prev=$page-1;

else

$prev=$page;

if($page<$last)

$next=$page+1;

else

$next=$page;

}

 ?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>Recently Checked Websites - <?php echo(get_title()) ?></title>
<center><a href="http://www.webstatisticshub.com"><img src="http://www.webstatisticshub.com/topbanner.png" align="middle">
</a></center>
<BODY BACKGROUND="http://www.webstatisticshub.com/1.png" bgproperties="fixed">

</head>

<body class="metrouicss" onload="prettyPrint()">

<div class="container" style="width:942px;margin: auto">

<div class="page">

<div class="nav-bar" style="background:<?php echo(retColor()); ?>">

    <div class="nav-bar-inner">

        <span class="pull-menu"></span>

        <a href="<?php echo(rootpath()) ?>"><span class="element brand">

            <img class="place-left" src="images/logo32.png" style="height: 20px"/>

            <?php echo(get_title()) ?>

        </span></a>

		<div class="divider"></div>

		<ul class="menu">

            <li><a href="<?php echo(rootpath()) ?>">Home</a></li>

              <li><a href="top.php">Top Websites</a></li>

			<li><a href="recent.php">Recent Websites</a></li>

			<li><a href="contact.php">Contact</a></li>

        </ul>

    </div>

</div>

<div class="main_div">

				<div class="left_div">

		<div class="top_check" style="padding-top:25px">

		<div class="index_stats_header" style="background:<?php echo(retColor()); ?>">

				<h2>Recently Checked Websites</h2>

				</div>

		<table class="striped">

<tbody>

  <?php

  $start_result = ($page-1)*20;

$match_recent = "select url,worth from stats where worth>0 order by id desc limit ".$start_result.",".$limit; 

$qry = mysql_query($match_recent);

$count = $start_result+1;

while($row = mysql_fetch_array($qry))

{

echo("<tr><td>" . $count . "<td><a href='" . $row['url'] . ".html'>http://www." . trim_string($row['url']) . "</a></td><td>&nbsp;&nbsp;" . number_format($row['worth']) . "$</td></tr>");

$count++;

}

?>

                    </tbody>

    </table>

						<div class="paginate">

				<?php 

echo("<a href='recent.php?page=" . $prev . "'><strong>Previous</strong></a> | <a href='recent.php?page=" . $next . "'><strong>Next</strong></a>"); 

?>

</div>

	</div>

		<div class="banner_ad" align="center">

				<?php echo(show_banner_ad()) ?>

				</div>

				</div>

				</div>

				<div class="sidebar_div">

	<div class="social_buttons">

	<div class="fb_button">

			<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2F<?php echo(get_facebook()) ?>&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>

			</div>

			<div class="twitter_button">

			<a href="https://twitter.com/<?php echo(get_twitter()) ?>" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

</div>

<div class="gplus_button">

<div class="g-follow" data-annotation="bubble" data-height="20" data-href="https://plus.google.com/<?php echo(get_google()) ?>" data-rel="publisher"></div>

<script type="text/javascript">

  (function() {

    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;

    po.src = 'https://apis.google.com/js/plusone.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);

  })();

</script>

</div>

		</div>

				<div class="top_ad">

	<?php echo(show_medrec_ad()) ?>

	</div>

<div class="top_ad2">

<?php echo(show_medrec2_ad()) ?>

</div>

<div class="social_buttons2">

<div class="like_button">

<iframe src="//www.facebook.com/plugins/like.php?href=<?php echo(rootpath()) ?>&amp;send=false&amp;layout=box_count&amp;width=450&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=65&amp;appId=490642984337841" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:65px;" allowTransparency="true"></iframe>

</div>

<div class="tweet_button">

<a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo(rootpath()) ?>" data-via="n" data-lang="en" data-related="anywhereTheJavascriptAPI" data-count="vertical">Tweet</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

</div>

<div class="gshare_button">

<div class="g-plus" data-action="share" data-annotation="vertical-bubble" data-height="60" data-href="<?php echo(rootpath()) ?>"></div>

<script type="text/javascript">

  (function() {

    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;

    po.src = 'https://apis.google.com/js/plusone.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);

  })();

</script>

</div>

<div class="linkedin_share">

<script src="//platform.linkedin.com/in.js" type="text/javascript">

 lang: en_US

</script>

<script type="IN/Share" data-url="<?php echo(rootpath()) ?>" data-counter="top"></script>

</div>

</div>

				</div>

				</div>

				</div>

				</div>

<?php include 'common/footer.php'; ?>