<?php
require('include/header.php');

mysql_connect("$host", "$username", "$password")or die("cannot connect to the database."); 
mysql_select_db("$db_name")or die("cannot select the database.");




if (isset($_GET['reset'])) {
?>	
<table class="table" width="100%" class="table">
	<tr class="table_header">
		<td>Reset the hits</td>
	</tr>
	<tr class="row1">
		<td>
		<span class="genmed">
<?php
$sql = "UPDATE ".$prefix."websites SET hits_in=NULL"; 
if (!mysql_query($sql))
   {
   die('Error: ' . mysql_error());
   }

$sql = "UPDATE ".$prefix."websites SET hits_out=NULL"; 
if (!mysql_query($sql))
   {
   die('Error: ' . mysql_error());
   }

echo "Your hits are set to 0.";



?>
		</span></td>
	</tr>
</table><br><br>
<?php
}







?>

<table class="table" width="100%" class="table">
	<tr class="table_header">
		<td colspan="3">Reset the hits</td>
	</tr>
	<tr class="row1">
		<td width="120">


			<form action="reset_hits.php?reset=yes" method="post">
				<p align="center">Are you sure you want to set all hits to 0?</p>
				<p align="center"><br>
				<input type="submit" value="Yes" />

					<script>
					function goBack()
					   {
					   window.history.back()
					   }
					</script>
				
				<input type="button" value="No" onclick="goBack()" />
 			</form>

		</td>
	</tr>
	</table>
</form>
<?php
//}







require('include/footer.php');



?>
