-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewlabours.php
45 lines (37 loc) · 1017 Bytes
/
viewlabours.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
<?php
$db=mysqli_connect("localhost","root","","agricultural_project");
$get_details="SELECT * FROM labours_info";
$sql_get_details=mysqli_query($db,$get_details);
while($labours=$sql_get_details->fetch_array()){
$firstname=$labours['firstname'];
$job=$labours['job'];
$bid=$labours['bid'];
$rating=$labours['rating'];
$labour_fetch="SELECT * FROM users WHERE firstname='$firstname';";
$sql=mysqli_query($db,$labour_fetch);
$details=mysqli_fetch_assoc($sql);
$usr=$details['username'];
$bid=$labours['bid'];
$rating=$labours['rating'];
if($job==true){
$stat="hired";
}
if($job==false){
$stat="hire";
}
echo "
<span id='labourinfobox'>
<span class='firstname' name='usr'>Name</br>$usr</span>
<span class='job'>Job</br>$job</span>
<span class='bid'>Bid</br>$bid</span>
<span class='rating'>Rating</br>$rating</span>";
if($stat=="hire"){
echo "<button onclick='showalert()' id='rating'>$stat</button>";
}
if($stat=="hired"){
echo "<button id='rating'>$stat</button>";
}
"</span>
";
}
?>