-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhome.php
121 lines (102 loc) · 3.81 KB
/
home.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
session_start();
if (isset($_SESSION['id']) && isset($_SESSION['user_name']) && isset($_SESSION['wallet'])) {
$Role = $_SESSION['role'];
?>
<?php include 'components/header.php'?>
<script src='./assets/js/web3_check.js'></script>
<body>
<?php include './user_components/navbar.php' ?>
<?php include './includes/config.inc.php' ?>
<script src="./assets/js/web3.min.js"></script>
<script src="./assets/js/jquery.min.js"></script>
<?php
if ($Role==1) {
?>
<script src='./assets/js/land_contract.js'></script>
<h3 class='center'>Your properties</h3>
<span class="center">
<?php if (isset($_GET['error'])) { ?>
<p class="red-text"><?php echo $_GET['error']; ?></p>
<?php } ?>
<?php if (isset($_GET['success'])) { ?>
<p id="success" class="green-text"><?php echo $_GET['success']; ?></p>
<?php } ?>
</span>
<table style="table-layout: fixed; width: 100%">
<thead>
<tr>
<th>Verifier</th>
<th>Country</th>
<th>State</th>
<th>City</th>
<th>Address</th>
<th>Latitude</th>
<th>Longitude</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM property WHERE verified=1 LIMIT 1";
$result = mysqli_query($conn, $sql);
if(!$result) {
die("Error" . $conn->error);
}
while($row = $result -> fetch_assoc()){
if ($row['owner_wallet']==$_SESSION['wallet']) {
echo '<tr>
<th style="word-wrap: break-word" id="verifier">'. $row['verifier'] .'</th>
<th style="word-wrap: break-word" id="country">'. $row['country'] .'</th>
<th style="word-wrap: break-word" id="state">'. $row['state'] .'</th>
<th style="word-wrap: break-word" id="city">'. $row['city'] .'</th>
<th style="word-wrap: break-word" id="propertyaddress">'. $row['propertyaddress'] .'</th>
<th style="word-wrap: break-word" id="latitude">'. $row['latitude'] .'</th>
<th style="word-wrap: break-word" id="longitude">'. $row['longitude'] .'</th>
<th>
<button class="waves-effect waves-light btn" id="createContract">Register</button>
</th>
</tr>';
}
}
?>
</tbody>
</table>
<?php
}
?>
<?php
if ($Role==2) {
?>
<script src='./assets/js/land_view.js'></script>
<h3 class='center'>Search for property</h3>
<span class="center">
<?php if (isset($_GET['error'])) { ?>
<p class="red-text"><?php echo $_GET['error']; ?></p>
<?php } ?>
<?php if (isset($_GET['success'])) { ?>
<p id="success" class="green-text"><?php echo $_GET['success']; ?></p>
<?php } ?>
</span>
<div class="row center">
<div class="col s12 m8 l4 offset-m2 offset-l4">
<div class="form-field">
<input id="contractaddress" type="text" placeholder="Contract Hash" name="contractHash"
id="contractHash">
<button id="searchLand" class="waves-effect deep-purple waves-light btn"><i
class="material-icons right">search</i>Search</button>
<p class="red-text" id="errorResult"></p>
</div><br>
</div>
</div>
<?php
}
?>
</body>
</html>
</html>
<?php
}else{
header("Location: login.php");
exit();
}
?>