forked from Chaarunika/baas.lk
/
profileCustomer.php
183 lines (131 loc) · 4.8 KB
/
profileCustomer.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html >
<html>
<head>
<title>baas.lk</title>
<link href="Gallery/_css/Icomoon/style.css" rel="stylesheet" type="text/css" />
<link href="Gallery/_css/Icomoon/style.css" rel="stylesheet" type="text/css" />
<link href="Gallery/_css/main.css" rel="stylesheet" type="text/css"/>
<link href="Gallery/_css/pop-up-gallery3.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Gallery/_scripts/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="Gallery/_scripts/pop-up-gallery3.js"></script>
<link href="css/header.css" rel="stylesheet" />
<link href="css/profileCustomer.css" rel="stylesheet" />
</head>
<body>
<?php
include_once('header.php');
include_once('_database/database.php');
include_once('functions/functions.php');
?>
<?php
if(isset($_SESSION['userID'])){
$userID = $_SESSION['userID'];
}
if(isset($_GET['user']))
{
$userID = $_GET['user'];
}
$result = get_user_details($userID);
$user = mysqli_fetch_assoc($result);
$result2 = get_customer_details($userID);
$sp = mysqli_fetch_assoc($result2);
?>
<div id="fullscreen">
<div id="fullscreen-inner">
<div id="fullscreen-inner-left" class="fullscreen-inner-button"><span class="icon-caret-left"></span></div>
<div id="fullscreen-inner-right" class="fullscreen-inner-button"><span class="icon-caret-right"></span></div>
<div id="fullscreen-inner-close" class="fullscreen-inner-button"><span class="icon-close"></span></div>
<div id="fullscreen-image"></div>
</div>
</div>
<div id="apDivContainer">
<div id="apDivMainInfo">
<div id="apDivTitle">
<p style="font-size:30px">
<?php
if(isset($user['user_firstname'])){
echo $user['user_firstname']." ".$user['user_lastname'] ;
}?>
</p>
<p>member since : <?php if(isset($user['user_registration_datetime'])) { echo $user['user_registration_datetime'] ;} ?></p>
<p>Catagory : <?php if(isset($sp['catagory'])) { echo $sp['catagory'] ;} ?></p>
<p>Area : <?php if(isset($sp['area'])) { echo $sp['area'] ;} ?></p>
</div>
<!--
<div id="apDivProfPic2"><img class="img-circle2" src= " <?php //echo $_SESSION['url'] ?> " > </div>
-->
<div id="apDivProfPic2"><img class="img-circle2" src= <?php if(isset($user['user_avatar'])) { echo $user['user_avatar'] ;} ?> > </div>
</div>
<div id="apDivContactBox">
<div id="apDivContactInfo">
<p style="font-size:20px">Contact Details</p>
<p>Contact No : <?php if(isset($sp['contactNo'])) { echo $sp['contactNo'];} ?></p>
<p>Email : <?php if(isset($user['user_email'])) { echo $user['user_email'];} ?></p>
<p>Address : <?php if(isset($sp['address'])) { echo $sp['address'];} ?></p>
<p>Optional Contact No : <?php if(isset($sp['opContactNo'])) { echo $sp['opContactNo'];} ?></p>
<p>Optional Email : <?php if(isset($sp['opEmail'])) { echo $sp['opEmail'];} ?></p>
</div>
</div>
<div id="appointmentBox">
<div id="appointmentBody">
<p align='center' style='font-size:30px'>Your RecentAppointments</p>
<?php
$customer=$_SESSION['userID'];
$sql="select * from calendar where customer_id='".$customer."'";
$result = mysqli_query($database,$sql) or die(mysqli_error($database));
$noOfappointments=mysqli_num_rows($result);
if($noOfappointments==0)
{
echo "<br>You have no appointments to show<br>";
}
else
{
echo "
<table border='1'>
<tr>
<td align='center' width='100px'>Date</td>
<td align='center'width='100px'>Job</td>
<td align='center'width='100px'>Service Provider</td>
<td align='center'width='400px'>Status</td>
</tr>";
while($appointment = mysqli_fetch_assoc($result))
{
$timest=strtotime($appointment['jobDate']);
echo "
<tr>
<td align='center' width='100px'>".date('j/m/Y',$timest)."</td>
<td align='center'width='100px'>".$appointment['title']."</td>
<td align='center'width='100px'>";
$sqlname="select user_firstname,user_id from users where user_id='".$appointment['sp_id']."'";
$resultname = mysqli_query($database,$sqlname) or die(mysqli_error($database));
$fname = mysqli_fetch_assoc($resultname);
echo "<a href='
profile.php?user=".$fname['user_id']."'";
echo">";
echo $fname['user_firstname'];
echo "</a>";
echo "</td>";
echo "<td>";
if($appointment['accepted']==0)
{
echo "Pending";
}
else if($appointment['accepted']==1)
{
echo "Service provider agreed";
}
else if($appointment['accepted']==2)
{
echo "Canceled by Service provider";
}
echo "</td>
</tr>";
}
echo "</table>";
}
?>
</div>
</div>
</div>
</body>
</html>