-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscheduleds.php
135 lines (109 loc) · 4.95 KB
/
scheduleds.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
include "database.php";
if (!isset($_SESSION['username']))
{
header("location:login.php");
}
//check for Admin login
if($_SESSION['user_type'] != 'C' ){
header("location:index.php");
}
$cid = $_SESSION['username'];
$sql="SELECT * FROM customer WHERE username = '$cid'";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result)){
$cid = $row['customerid'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Schedule Inspection Requests</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- CSS -->
<link href="css/styles.css" rel="stylesheet">
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php include "template/header.php"; ?>
<!-- Begin page content -->
<div class="container">
<div class="row">
<div class="col-md-3">
<?php include "customer_sidebar.php"; ?>
</div>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-heading">House Inspection Schedule Inquiries</div>
<div class="panel-body">
<table id="example" class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Customer</th>
<th>Property ID</th>
<th>Scheduled Time</th>
<th>Agent Reply</th>
<th>Time</th>
<th>View</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT c.firstname, c.agentid, cs.propertyid, cs.time,cs.timestamp,cs.agentreply FROM customer_scheduleinspection cs, agent c WHERE customerid='$cid' AND c.agentid=cs.agentid ORDER BY timestamp desc";
$result = mysqli_query($conn, $sql);
$no = 1;
while($row = mysqli_fetch_array($result)){
echo "<tr>" . PHP_EOL;
echo "<th scope='row'>".$no."</th>" . PHP_EOL;
echo "<td>".$row['firstname']."</td>" . PHP_EOL;
echo "<td>".$row['propertyid']."</td>" . PHP_EOL;
if(!isset($row['time'])){
echo "<td><span class='label label-primary'>Waitng</span></td>" . PHP_EOL;
} else {
echo "<td>".$row['time']."</td>" . PHP_EOL;
}
// echo "<td>".."</td>" . PHP_EOL;
if($row['agentreply'] == '0'){
echo "<td><span class='label label-primary'>Waitng</span></td>". PHP_EOL;
} else if($row['agentreply'] == '1'){
echo "<td><span class='label label-success'>Approved</span></td>". PHP_EOL;
} else{
echo "<td><span class='label label-danger'>Rejected</span></td>". PHP_EOL;
}
echo "<td>".$row['timestamp']."</td>" . PHP_EOL;
echo "<td>" . PHP_EOL; ?>
<a href='<?php echo $baseurl . 'scheduleinspection.php?id='. $row['propertyid'] . '&agid='.$row['agentid'] ?>' class='btn btn-primary btn-xs'><i class="fa fa-eye"></i></a>
<?php
echo "</td>" . PHP_EOL;
echo "</tr>" . PHP_EOL;
$no++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- End of container -->
</div>
<!-- footer -->
<?php include "template/footer.php"; ?>
</body>
</html>