<?php
require ("config.php");
mysql_connect($conf['database_host'],$conf['database_login'],$conf['database_pass']);
mysql_select_db($conf['database_name']);
$remote = $_SERVER['REMOTE_ADDR'];
$entry = "INSERT INTO clicks VALUES ('','$remote')";
$clickcount = "SELECT * FROM clicks WHERE userip = '$remote'";
$cresult = mysql_query($clickcount);
$cesplode = mysql_fetch_array($cresult);
$howmany = $cesplode["clicks"];
$userip = $cesplode["userip"];
if ($cesplode["clicks"] <= 3){
mysql_query("UPDATE clicks set clicks = clicks + 1 WHERE ".$cesplode["userip"]." = ".$remote.");
}
else {
$namel = "<a href="javascript:self.close()">click here</a>";
$namer = "<a href="javascript:self.close()">click here</a>";
}
$query = "SELECT * FROM cuter";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
$numhalf =($numrows / 2);
$numhalfa = ($numhalf +1);
$picl = rand(1,$numhalf);
$picr = rand($numhalfa,$numrows);
$sql = "SELECT * FROM cuter WHERE pic ='$picl'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$picl = $myrow["pic"];
$picidl= $myrow["picid"];
$namel = $myrow["name"];
$imagel = $myrow["image"];
$sql = "SELECT * FROM cuter WHERE pic ='$picr'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$picr = $myrow["pic"];
$picidr= $myrow["picid"];
$namer = $myrow["name"];
$imager = $myrow["image"];
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Tell Us What You Think.</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Start(page)
{
OpenWin = this.open(page, "CtrlWindow","toolbar=No,menubar=No,location=No,scrollbars=Yes,resizable=Yes,status=No,width=250,height=500,left=150,top=150,");
}
//-->
</SCRIPT>
<link href="wpdyp.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="left"> </div>
<div align="left">
<table width="571" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="395" rowspan="2">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="386">
<tr>
<td width="16"><img src="images/index_layout_02.jpg" border="0"></td>
<td width="192">
<p align="center">
<img border="0" src="images/<?php echo $imagel ?>" width="158" height="201"></td>
<td width="193">
<p align="center">
<img border="0" src="images/<?php echo $imager ?>" width="160" height="200"></td>
<td width="16"><img src="images/index_layout_04.jpg" border="0"></td>
</tr>
<tr valign="top">
<td width="16"><img src="images/index_layout_05.jpg" border="0"></td>
<td width="192">
<p align="center"><font color="#0000FF"><b><a href="vote.php?picid=<?php echo $picidl ?>" class="munk">Vote for <?php echo $namel ?></a></b></font></td>
<td width="193">
<p align="center"><font color="#0000FF"><b><a href="vote.php?picid=<?php echo $picidr ?>"class="munk">Vote for <?php echo $namer ?></a></b></font></td>
<td width="16"><img src="images/index_layout_07.jpg" border="0"></td>
</tr>
<tr>
<td width="16"><img src="images/index_layout_08.jpg" border="0"></td>
<td colspan="2"><img src="images/index_layout_09.jpg" border="0"></td>
<td width="16"><img src="images/index_layout_10.jpg" border="0"></td>
</tr>
<tr>
<td width="16"><img src="images/index_layout_11.jpg" border="0"></td>
<td colspan="2" valign="middle" bgcolor="#608B92"><p align="center"><font class="headline"> Which Product Do You Prefer?</font></td>
<td width="16"><img src="images/index_layout_13.jpg" border="0"></td>
</tr>
<tr>
<td width="16"><img src="images/index_layout_14.jpg" border="0"></td>
<td colspan="2"><img src="images/index_layout_15.jpg" border="0"></td>
<td width="16"><img src="images/index_layout_16.jpg" border="0"></td>
</tr>
</table>
</center>
</div>
</td>
<td width="174" valign="top">
<p align="center">
<iframe name="I1" width="153" height="235" src="echovotes.php" marginwidth="2" marginheight="2" scrolling="no" border="0" frameborder="0">
Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></td>
</tr>
<tr>
<!--<td width="395">
<table border="0" cellpadding="0" cellspacing="0" width="389">
<tr>
<td width="417" height="75" valign="middle">
<p align="center"><font class="headline"> Which Product Do You Prefer?</font></td>
</tr>
</table></td>-->
<td width="174" valign="top">
<p align="center"><a href="javascript:void(0);" onclick="javascript:Start ('showall.php');">View All Entries</a></td>
</tr>
</table>
</div>
</body>
</html>