forked from sarahdoi/Oun-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewOffers.php
388 lines (310 loc) · 8.28 KB
/
ViewOffers.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<?php
session_start();
include("connection.php");
include("functions.php");
$user_data = check_loginParent($con);
$myID = $user_data['parent_id'];
?>
<!DOCTYPE html>
<html lang = "en">
<style>
body{
text-align: center;
}
.footer-distributed{top: 800px; }
.footer-distributed .footer-icons a{ margin-bottom: 2px;}
.card{
background-color:white;
border-radius: 12px;
overflow: hidden;
position: relative;
overflow: hidden;
text-align: center;
height:650px;
width:320px;
margin-top:150px ;
box-shadow:0 12px 13px rgba(0,0,0,0.16), 0 12px 13px rgba(0,0,0,0.16);
margin-left: 5%;
margin-right: 5%;
}
.card img {
border-radius:100%;
margin-top:60px;
width:132px;
height:128px;
}
.name{
color:#404040;
}
.reviews , .title{
font-size :1rem;
color: #707070;
}
/*more details*/
.desc{
font-size:20px;
/*margin-left:65px;*/
margin-right:65px;
margin-top:20px;
color:#404040;
}
/* button */
.desc .btn1 {
outline:none;
background :rgb(25, 148, 74);
/* 20px */
margin-top:5px;
border:none;
height:40px;
width:60%;
font-size:16px;
/* 30px */
border-radius:12px;
margin-left: 70px;
}
.desc .btn2{
outline:none;
background : rgb(152, 33, 33);
/* 20px */
margin-top:5px;
border:none;
height:40px;
width:60%;
color:white;
font-size:16px;
/* 30px */
border-radius:12px;
left: 40px;
margin-left: 70px;
}
/*more details*/
.card .desc
{
font-size: 19px;
}
a{
color: white; /*text button color*/
}
/* button hover*/
.card .desc .btn2 a:hover
{
color: rgb(133, 56, 56);
cursor: pointer;
}
.card .desc .btn1 a:hover
{
color:#3ca349;
cursor: pointer;
}
.desc .btn1
{
color: white;
}
.dts{
text-align: center;
}
.card .desc .info {
padding: 0 0 1rem;
display: flex;
}
.card .desc .info h2 {
text-align: center;
width: 50%;
margin: 0;
box-sizing: border-box;
padding: 0.8rem;
display: flex;
flex-direction: column;
border-radius: 0.8rem;
transition: background-color 100ms ease-in-out;
}
/*.card .desc .info h2 {
text-decoration: none;
padding: 0.8rem;
display: flex;
flex-direction: column;
border-radius: 0.8rem;
transition: background-color 100ms ease-in-out;
}*/
.card .desc .info h2 span {
color:#404040;;
font-weight: bold;
transform-origin: bottom;
transform: scaleY(1.3);
transition: color 100ms ease-in-out;
margin-left: 40px;
}
.card .desc .info h2 small {
color: #707070;
font-size: 1rem;
font-weight: normal;
margin-left: 40px;
}
.lin{
color:#404040;
font-size:20px;
margin-top: 15px;
padding-bottom: 10px;
text-decoration: underline;
margin-left: 50px;
margin-top: 10px;
}
.btn1:hover{
background :rgb(19, 113, 57);
cursor: pointer;
}
.btn2:hover{
background : rgb(124, 27, 27);
cursor: pointer;
}
</style>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="footer.css">
<link rel="stylesheet" href="styleB.css">
<link rel="stylesheet" href="stylePages.css">
<!--<link rel="stylesheet" href="offerpage.css">-->
<link rel="stylesheet" href="mytitels.css">
<meta name="viewport" content="width=device-width , initial-scale=1">
<link rel="icon" type="images/png" href="images/logo.png">
<meta name="viewport" content="width=device-width , intial-scale=1">
<title> Babysitter price offers</title>
</head>
<!--header-->
<body>
<header>
<a href="#" class="logo"><img src="images/logo.png" alt="logo icon"></a>
<nav class="navbar">
<ul>
<li> <a onclick="window.history.back()" style="pointer:cursor;"> < Back </a> </li>
<li><a href="mprofile.php"> Home </a></li>
<li> <a href="#"> Menu </a>
<ul class="inner"> <!-- your menu here\\\\\\-->
<li class="first"><a href="parentrequests.php"> My Pending Requests </a></li>
<li><a href="viewOffers.php"> Babysitter Offers </a></li></ul>
<li> <a href="#"> Settings </a>
<ul class="inner">
<li class="first"><a href="parentprofile.php"> view profile</a></li>
<li><a href="index.php"> Sign out </a></li>
</ul>
</li>
</ul>
</nav>
</header>
<!--header-->
<!-- body -->
<div><h1 class="mytitler" > <br> <br> <br> <br> Babysitter price offers:</h1> </div>
<?php
$query = "SELECT offer.*, babysitter.* , request.*
FROM offer
INNER JOIN babysitter ON babysitter.national_id = offer.babysitter_id
INNER JOIN request ON offer.request_id = request.request_id
WHERE request.parent_id = $myID; ";
$myOffers = mysqli_query( $con , $query);
$no=0;
if( mysqli_num_rows($myOffers) > 0)
{
$no=1;
while ($row = mysqli_fetch_assoc($myOffers))
if( $row['status'] == 'p')
{
$no=2;
?>
<?php //////////////// TIME
$ti= time()+(2+3)*3600;
$hour= date("H", $ti);
$dateN= date('Y-m-d');
$cleanTime=substr($row['start_time'],0,-6);
if($row['date']== $dateN && $hour> $cleanTime ){
$msg= "less than 3 hours & the offer will be deleted!";
if(!$con)
die();
if( ! mysqli_select_db($con , "oun"))
die();
$reqID=$row['request_id'];
$qu="UPDATE offer SET `status`='r' WHERE request_id='$reqID' ";
if(! $table=mysqli_query($con,$qu))
die("failed to cancel");
}else{
$msg="";
}
///////////////// ?>
<div class="card" style="display:inline-block;">
<?php echo "<p style='font-size:15px;color:red;'>".$msg."</p>"; ?>
<?php echo "<img src='images/".$row['sitter_image']."'alt='Baby Sitter's profile picture'>" ;?>
<?php echo "<h1 class='name' >". $row['name'] ."</h1> ";?>
<?php echo "<p class='title'>". $row['city']."</p>"; ?>
<div class="desc">
<div class="info">
<?php echo "<h2><span>".$row['price']."</span><small>SR per hour</small></h2>"; ?>
<?php echo "<h2><span>Time</span> <small>".$row['start_time']."-".$row['end_time']."</small></h2>"; ?>
</div>
<?php echo "<a class='lin' href='bsprofileP.php?babysitter_id=".$row['babysitter_id']."'>View Profile</a>"; ?>
<div class="btns">
<?php $_GET['request_id'] = $row['request_id'];
$_GET['offer_id'] = $row['offer_id'];
?>
<a href="Accept.php?request_id=<?php echo $_GET['request_id'];?>&offer_id=<?php echo $_GET['offer_id'];?>" onclick="return alert('Offer accepted, Babysitter is booked!');">
<input class="btn1" type="button" value="Accept" style = "text-align:center;"> </a>
<a href="Reject.php?request_id=<?php echo $_GET['request_id'];?>&offer_id=<?php echo $_GET['offer_id'];?>" onclick="return confirm('Are you sure you want to reject this offer?');">
<input class="btn2" type="button" value="Reject" style = "text-align:center;"> </a>
</div>
<br>
<?php echo
"<div>
<p>
<div><b>Offer Details:</b></div>
Date: ".$row['date']."</center><br>
Type of service: ".$row['service_type']." <br>
Kid's name: ".$row['kid_name']."<br>
".$msg."</p>
</div>";
?>
</div> <!-- dec card-->
<!-- -->
</div> <!-- end card-->
<?php
} }
else{
echo "<h2> You haven't recieved any offers </h2>";
}
if($no == 1){
echo "<h2> You haven't recieved any offers </h2>";
}
?>
<footer class="footer-distributed">
<div class="footer-left">
<div>
<img class="logo" src="./images/logo.png" alt="Ouun">
</div>
<p class="footer-links">
<a href="mprofile.php" class="link-1">Home</a>
<!-- <a href="#">About</a> -->
<a href="mailto:support@Ouun.com">Contact</a>
</p>
<p class="footer-company-name">Oun © 2022</p>
</div>
<div class="footer-center">
<div>
<i class="fa fa-map-marker"></i>
<p><span>12534 AlOlaya st.</span> Riyadh , Saudi Arabia</p>
</div>
<div>
<i class="fa fa-phone"></i>
<p>+9669200000834</p>
</div>
<div>
<i class="fa fa-envelope"></i>
<p><a href="mailto:support@Ouun.com">support@Oun.com</a></p>
</div>
</div>
<div class="footer-right">
<p class="footer-company-about">
<span>About us</span>
Oun is an online platform that helps mothers find babysitters anytime and anywhere.
</p>
</div>
</footer>
<!--Fotter-->
</body>
</html>