-
Notifications
You must be signed in to change notification settings - Fork 1
/
inslikepwfvm.php
44 lines (39 loc) · 966 Bytes
/
inslikepwfvm.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
<?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';
}
$ipwofid=$_SESSION['invid'];
$ipwfemail=$_SESSION['lemail'];
$sql="SELECT pwfid FROM pwf WHERE email='$ipwfemail'";
$r=mysqli_query($con,$sql);
$row=mysqli_fetch_assoc($r);
$ipwfid=$row['pwfid'];
$sql="SELECT vacancy FROM flat WHERE fid=(SELECT pwfflatid FROM pwf WHERE pwfid='$ipwfid')";
$sqlquery=mysqli_query($con,$sql);
$vacancyrow=mysqli_fetch_assoc($sqlquery);
$vacancycount=$vacancyrow['vacancy'];
if($vacancycount==0)
{
echo "<script>
alert('NO vacancies remaining');
window.close();
</script>";
}
$i="INSERT INTO asso2 VALUES('$ipwofid','$ipwfid')";
if(mysqli_query($con,$i))
{
mysqli_close($con);
echo "2";
echo "<script>
alert('Profile LIKED');
window.close();
</script>";
}
?>