-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlikepwof.php
99 lines (86 loc) · 2.78 KB
/
likepwof.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<title>
Page
</title>
<link rel="stylesheet" type="text/css" href="cardd.css">
<link rel="stylesheet" type="text/css" href="nav.css">
<link rel="stylesheet" type="text/css" href="edpwof.css">
<style type="text/css">
body
{
background-size: cover;
}
</style>
</head>
<body background="pwofb.jpg">
<header style="padding: 4px 0;opacity:0.7;"><center><h1>ROOM SHARE</h1></center></header>
<div class="topnav" id="myTopnav">
<a href="card.html">Home</a>
<a href="likepwof.php">Liked</a>
<a href="refer.html">Referals</a>
<a href="pwofed.php">Edit</a>
<a href="match.php">Matched Profiles</a>
<a href="logout.php" style="float: right;">Logout</a>
</div>
<?php
session_start();
$con=mysqli_connect('127.0.0.1','root','123456');
if(!$con)
{
echo 'Connection error';
}
if(!mysqli_select_db($con,'project'))
{
echo 'Database not selected';
}
$vemail=$_SESSION['lemail'];
//$vemail="q@g.c";
$sql="SELECT * FROM asso WHERE pwof_id=(SELECT pwofid FROM pwof WHERE email='$vemail')";
$result=mysqli_query($con,$sql);
if(mysqli_num_rows($result) > 0)
while($rowid=mysqli_fetch_assoc($result))
{
$vid=$rowid['pwf_id'];
$sql1="SELECT * from pwf join flat on pwfid='$vid' and fid=pwfflatid";
$result1=mysqli_query($con,$sql1);
$row=mysqli_fetch_assoc($result1);
$rc="SELECT count(*) FROM roommate WHERE rpwfid=$vid";
$row1=mysqli_query($con,$rc);
$row2=mysqli_fetch_assoc($row1);
$roommatecount=$row2['count(*)'];
$roommatecount=$roommatecount+2;
$rent=$row['rent']/$roommatecount;
?>
<form action="rf.php" method="post" target="_blank">
<div class="card" style="box-shadow: 0 12px 15px 0 rgba(1,1,1,0.8);background-color: #fff; transition: 0.3s; width:50%; align:center; margin: 2% 25% 0% 25%">
<div class="info">
<img id="im" src="flatuploads/<?php if($row['image1'])
echo $row['image1'];
else
echo "default.png"; ?>">
<img id="im" src="flatuploads/<?php if($row['image2'])
echo $row['image2'];
else
echo "default.png"; ?>"><br>
Rent:<?php echo ceil($rent) ?><br>
Current occupants:<?php echo $roommatecount-1 ?><br>
Area:<?php echo $row['area'] ?><br>
</div>
<div id="an">
<button type="submit" name="vmbtn" value=<?php echo $row['pwfid'] ?> style="border: none;background-color: #006600;color: white;padding: 14px 20px;cursor: pointer ;margin:3.5% 2% 20% 5%;" >View More</button>
</div>
</div>
</form>
<?php echo "<br><br>" ?>
<?php }
else
{
echo "<script>alert('No cards to display...');</script>";
header("refresh:0;url=card.html");
}?>
<?php mysqli_close($con);
?>
</body>
</html>