<?php
$ADid = $_GET['id'];
include "dbconnection.php";
try{
$con = new PDO('mysql:host='.$servername.';dbname='.$dbname,$username,$password);
$con->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
die($e->getMessage());
}
if(isset($_GET['id'])){
$ad_id = $_GET['id'];
$sql = "UPDATE members SET visitsnumber = visitsnumber+1 WHERE id = $ad_id";
$con->query($sql);
$fa = $con->prepare('SELECT * FROM members WHERE ID=:a LIMIT 1');
$fa->execute(array('a'=>$ad_id));
if($fa->rowCount()){
$ad = $fa->fetch(PDO::FETCH_ASSOC);
}
if($result == 0)
{
// image not found, do stuff..
echo "Not Found Image:".$line;
}
$fd = $con->prepare('SELECT * FROM members');
$fd->execute();
//var_dump($fd->fetchAll(PDO::FETCH_ASSOC));die();
}
if($result == 0)
{
// image not found, do stuff..
echo "Not Found Image:".$line;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Main AD</title>
<style type="text/css">
#apDiv1 {
position: absolute;
width: 576px;
height: 356px;
z-index: 1;
left: 13px;
top: 13px;
background-color: #62A0FF;
visibility: visible;
}
</style>
</head>
<body>
<div id="apDiv1">
<table width="550" border="2" align="center" cellpadding="2" cellspacing="3">
<tr>
<td width="90" align="right">Name</td>
<td colspan="3"><p><?php echo isset($ad['fname']) ? $ad['fname']: '';?></p></td>
</tr>
<tr>
<td align="right">Gender</td>
<td colspan="3"><?php echo isset($ad['gender']) ? $ad['gender']: '';?></td>
</tr>
<tr>
<td align="right">Age</td>
<td colspan="3"><?php echo isset($ad['gender']) ? $ad['age']: '';?></td>
</tr>
<tr>
<td align="right">Merrital status</td>
<td colspan="3" nowrap="nowrap"><ul>
<li><?php echo isset($ad['yyyy']) ? $ad['yyyy']: '';?></li>
</ul></td>
</tr>
<tr>
<td align="right">Location</td>
<td colspan="3" nowrap="nowrap"><?php echo isset($ad['City']) ? $ad['City']: '';?></td>
</tr>
<tr>
<td align="right"> </td>
<td width="158" rowspan="4"><?php echo isset($ad['pic_0001']) ? '<img src="http://linkwaycanada.com/MembersImages/'.$ad['pic_0001'].'" style="height:135px;display:block;margin:0 auto;">': '';?></td>
<td colspan="2"> </td>
</tr>
<tr>
<td align="right"> </td>
<td width="90" align="center">VISITS #</td>
<td width="195"><?php echo isset($ad['visitsnumber']) ? $ad['visitsnumber']: '';?></td>
</tr>
<tr>
<td align="center">Main Picture</td>
<td colspan="2">New PublicAD.php (working)</td>
</tr>
<tr>
<td align="right"><input type="button" name="contact" id="contact" value="CONTACT" /></td>
<td colspan="2"><td colspan="2" nowrap="nowrap">Record not found</td>
</tr>
</table>
</div>
</body>
</html>