-
Notifications
You must be signed in to change notification settings - Fork 0
/
reviewbox.php
425 lines (374 loc) · 18.1 KB
/
reviewbox.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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!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">
<meta name="description" content="Get Professional Service At Low Price On The GO">
<meta name="author" content="Nitish Shah,Prakarity Nandi,">
<title>Get Professional Services At Low Price On The GO!</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/shop-homepage.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function showresult(str) {
if (str.length<2) {
document.getElementById("livesearch").innerHTML="";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
document.getElementById("livesearch").innerHTML=this.responseText;
}
}
xmlhttp.open("GET","livesearch.php?q="+str,true);
xmlhttp.send();
}
</script>
<style>
.navbar-inverse .navbar-nav > li > a {
color: #ffffff;
}
.navbar-inverse {
background-color: #009688;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
border-color:#009688;
}
.h3, h3 {
font-size: 29px;
font-family: "Comic Sans MS";
}
#livesearch
{
position: absolute;
width: auto;
background: white;
max-height: 200px;
overflow-y: auto;
border: 1px solid gray;
padding-left: 10px;
/*This is relative to the navbar now*/
left: 0;
right: 0;
top: 33px;
}
.form-control{
font-size: 16px;
}
.navbar-brand {
padding-top:10px;
padding-bottom: 0px;
padding-left: 1px;
padding-right: 0px;
}
</style>
</head>
<body bgcolor="#b0bec5">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<a class="navbar-brand" href="#">
<img alt="Brand" src="favicon.ico">
<!-- for search bar-->
<li class="dropdown dropdown-lg">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Services <b class="caret"></b></a>
<ul class="dropdown-menu dropdown-menu-lg row">
<li class="col-sm-4">
<ul>
<li class="dropdown-header">Health & Fitness</li>
<li><a href="display_cat_pro.php?catid=1">Yoga Trainer At Home</a></li>
<li><a href="display_cat_pro.php?catid=2">Salon At Home</a></li>
<li><a href="display_cat_pro.php?catid=3">Fitness Trainer At Home</a></li>
<li><a href="#">Dietician</a></li>
<li><a href="display_cat_pro.php?catid=4">Physiotheraphy At Home</a></li>
<li><a href="display_cat_pro.php?catid=1">Yoga Classes At Studio</a></li>
<li class="divider"></li>
<li class="dropdown-header">Maintenance</li>
<li><a href="display_cat_pro.php?catid=5">AC Service And Repair</a></li>
<li><a href="display_cat_pro.php?catid=6">Laptop Repair</a></li>
<li><a href="display_cat_pro.php?catid=7">Mobile Repair</a></li>
<li><a href="display_cat_pro.php?catid=8">Doorstep Laundry</a></li>
<li><a href="display_cat_pro.php?catid=9">TV Repair</a></li>
<li><a href="display_cat_pro.php?catid=10">Water Purifier Repair</a></li>
</ul>
</li>
<li class="col-sm-4">
<ul>
<li class="dropdown-header">Wedding & Events</li>
<li><a href="display_cat_pro.php?catid=11">Wedding Photographer</a></li>
<li><a href="display_cat_pro.php?catid=12">Birthday Party planner</a></li>
<li><a href="display_cat_pro.php?catid=13">Bride Makeup Artist</a></li>
<li><a href="display_cat_pro.php?catid=14">Birthday Party Decorator</a></li>
<li><a href="display_cat_pro.php?catid=15">DJ</a></li>
<li><a href="display_cat_pro.php?catid=16">Bartender</a></li>
<li class="divider"></li>
<li class="dropdown-header">Home Care</li>
<li><a href="display_cat_pro.php?catid=17">Interior Designer</a></li>
<li><a href="display_cat_pro.php?catid=18">Carpenter</a></li>
<li><a href="display_cat_pro.php?catid=19">Plumber</a></li>
<li><a href="display_cat_pro.php?catid=20">Electrician</a></li>
<li><a href="display_cat_pro.php?catid=21">Pest Control</a></li>
<li><a href="display_cat_pro.php?catid=22">Construction & Renovation</a></li>
</ul>
</li>
<li class="col-sm-4">
<ul>
<li class="dropdown-header">Academic tutor</li>
<li><a href="display_cat_pro.php?catid=23">Class I-V</a></li>
<li><a href="display_cat_pro.php?catid=23">Class VI-VIII</a></li>
<li><a href="display_cat_pro.php?catid=23">Class IX-X</a></li>
<li class="divider"></li>
<li class="dropdown-header">Hobbies & Interest</li>
<li><a href="display_cat_pro.php?catid=24">Guitar Lesson at Home</a></li>
<li><a href="display_cat_pro.php?catid=25">Zumba Fitness Dance</a></li>
<li><a href="display_cat_pro.php?catid=26">Bollywood Dance Class</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="col-sm-6 col-md-6">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" onkeyup="showresult(this.value)" name="q" autocomplete='off'>
<ul id="livesearch"></ul>
<div class="input-group-btn"><button class="btn btn-default"><i class="glyphicon glyphicon-search"></i></button>
</div></div></form></div>
<ul class="nav navbar-nav navbar-right">
<?php
if(!isset($_SESSION['proid']))
{
echo "<li><a href='pro_login.html'><span class='glyphicon glyphicon-user'></span> Become a Professional</a></li><li><a href='kart.php'><span class='glyphicon glyphicon-shopping-cart'></span> Shopping Cart</a></li>";
}
else
{
$proid = $_SESSION['proid'];
$sql = "select first_name,last_name from professional_signup where proID = $proid" ;
$result = pg_query($session,$sql);
if($row=pg_fetch_row($result))
{
echo " <li> <div class='dropdown nav navbar-nav'>
<button class='btn btn-default navbar-btn' type='button' id='dropdownMenu1' data-toggle='dropdown' ><span class='glyphicon glyphicon-user'></span> ".$row[0]." ".$row[1]."</a>
<span class='caret'> </span>
</button>
<ul class='dropdown-menu' aria-labelledby='dropdownMenu1'>
<li><a href='profile_professional.php'><span class='glyphicon glyphicon-user'></span> Profile</a></li>
<li><a href='edit_profile_professionals.php'><span class='glyphicon glyphicon-edit'></span> Edit Profile</a></li>
<li role='separator' class='divider'></li>
<li><a href='logout.php'><span class='glyphicon glyphicon-log-out'></span> Logout</a></li>
</ul>
</div></li>";
}
}
?>
<?php
if(!isset($_SESSION['cusid']))
{
echo "<li><a href='cus_login.html'><span class='glyphicon glyphicon-log-in'></span> Login/signup</a></li>";
}
else
{
$cusid = $_SESSION['cusid'];
$sql = "select first_name,last_name from customer_signup where custID = $cusid" ;
$result = pg_query($session,$sql);
if($row=pg_fetch_row($result))
{
echo " <li> <div class='dropdown nav navbar-nav'>
<button class='btn btn-default navbar-btn' type='button' id='dropdownMenu1' data-toggle='dropdown' ><span class='glyphicon glyphicon-user'></span> ".$row[0]." ".$row[1]."</a>
<span class='caret'></span>
</button>
<ul class='dropdown-menu' aria-labelledby='dropdownMenu1'>
<li><a href='profile_customer.php'><span class='glyphicon glyphicon-user'></span> Profile</a></li>
<li><a href='edit_profile_customer.php'><span class='glyphicon glyphicon-edit'></span> Edit Profile</a></li>
<li role='separator' class='divider'></li>
<li><a href='logout.php'><span class='glyphicon glyphicon-log-out'></span> Logout</a></li>
</ul>
</div></li>";
}
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div class="row" style="margin-top:40px;">
<div class="col-md-12">
<?php include("errorlogic.php"); ?>
<div class="well well-sm">
<div class="text-right">
<a class="btn btn-success btn-green" href="#reviews-anchor" id="open-review-box">Leave a Review</a>
</div>
<div class="row" id="post-review-box" style="display:none;">
<div class="col-md-12">
<form accept-charset="UTF-8" action="reviews.php?prod=<?php echo $_REQUEST['prod'];?>" method="post">
<input id="ratings-hidden" name="rating" type="hidden">
<textarea class="form-control animated" cols="50" id="new-review" name="comment" placeholder="Enter your review here..." rows="8"></textarea>
<div class="text-right">
<div class="stars starrr" data-rating="0"></div>
<a class="btn btn-danger btn-sm" href="#" id="close-review-box" style="display:none; margin-right: 10px;">
<span class="glyphicon glyphicon-remove"></span>Cancel</a>
<button class="btn btn-success btn-lg" type="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.container -->
<div class="container">
<hr>
<!-- Footer -->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © ServiceKart 2016</p>
<p align="right"><a href="#">About</a> <a href="#">Contact Us</a></p>
</div>
</div>
</footer>
</div>
<!-- /.container -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<script>(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(u,null),o=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=u,s.className=i.className,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);
var __slice=[].slice;(function(e,t){var n;n=function(){function t(t,n){var r,i,s,o=this;this.options=e.extend({},this.defaults,n);this.$el=t;s=this.defaults;for(r in s){i=s[r];if(this.$el.data(r)!=null){this.options[r]=this.$el.data(r)}}this.createStars();this.syncRating();this.$el.on("mouseover.starrr","span",function(e){return o.syncRating(o.$el.find("span").index(e.currentTarget)+1)});this.$el.on("mouseout.starrr",function(){return o.syncRating()});this.$el.on("click.starrr","span",function(e){return o.setRating(o.$el.find("span").index(e.currentTarget)+1)});this.$el.on("starrr:change",this.options.change)}t.prototype.defaults={rating:void 0,numStars:5,change:function(e,t){}};t.prototype.createStars=function(){var e,t,n;n=[];for(e=1,t=this.options.numStars;1<=t?e<=t:e>=t;1<=t?e++:e--){n.push(this.$el.append("<span class='glyphicon .glyphicon-star-empty'></span>"))}return n};t.prototype.setRating=function(e){if(this.options.rating===e){e=void 0}this.options.rating=e;this.syncRating();return this.$el.trigger("starrr:change",e)};t.prototype.syncRating=function(e){var t,n,r,i;e||(e=this.options.rating);if(e){for(t=n=0,i=e-1;0<=i?n<=i:n>=i;t=0<=i?++n:--n){this.$el.find("span").eq(t).removeClass("glyphicon-star-empty").addClass("glyphicon-star")}}if(e&&e<5){for(t=r=e;e<=4?r<=4:r>=4;t=e<=4?++r:--r){this.$el.find("span").eq(t).removeClass("glyphicon-star").addClass("glyphicon-star-empty")}}if(!e){return this.$el.find("span").removeClass("glyphicon-star").addClass("glyphicon-star-empty")}};return t}();return e.fn.extend({starrr:function(){var t,r;r=arguments[0],t=2<=arguments.length?__slice.call(arguments,1):[];return this.each(function(){var i;i=e(this).data("star-rating");if(!i){e(this).data("star-rating",i=new n(e(this),r))}if(typeof r==="string"){return i[r].apply(i,t)}})}})})(window.jQuery,window);$(function(){return $(".starrr").starrr()})
$(function(){
$('#new-review').autosize({append: "\n"});
var reviewBox = $('#post-review-box');
var newReview = $('#new-review');
var openReviewBtn = $('#open-review-box');
var closeReviewBtn = $('#close-review-box');
var ratingsField = $('#ratings-hidden');
openReviewBtn.click(function(e)
{
reviewBox.slideDown(400, function()
{
$('#new-review').trigger('autosize.resize');
newReview.focus();
});
openReviewBtn.fadeOut(100);
closeReviewBtn.show();
});
closeReviewBtn.click(function(e)
{
e.preventDefault();
reviewBox.slideUp(300, function()
{
newReview.focus();
openReviewBtn.fadeIn(200);
});
closeReviewBtn.hide();
});
$('.starrr').on('starrr:change', function(e, value){
ratingsField.val(value);
});
});
</script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<style>
.dropdown-menu-lg {
width: 600px;
padding: 20px 0px;
}
.dropdown-menu-lg > li > ul {
padding: 0;
margin: 0;
}
.dropdown-menu-lg > li > ul > li {
list-style: none;
}
.dropdown-menu-lg > li > ul > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: normal;
}
.dropdown-menu-lg > li ul > li > a:hover,
.dropdown-menu-lg > li ul > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu-lg .disabled > a,
.dropdown-menu-lg .disabled > a:hover,
.dropdown-menu-lg .disabled > a:focus {
color: #999999;
}
.dropdown-menu-lg .disabled > a:hover,
.dropdown-menu-lg .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.dropdown-menu-lg .dropdown-header {
color: #428bca;
font-size: 18px;
}
@media (max-width: 768px) {
.dropdown-menu-lg {
margin-left: 0 ;
margin-right: 0 ;
}
.dropdown-menu-lg > li {
margin-bottom: 30px;
}
.dropdown-menu-lg > li:last-child {
margin-bottom: 0;
}
.dropdown-menu-lg .dropdown-header {
padding: 3px 15px !important;
}
}
.animated {
-webkit-transition: height 0.2s;
-moz-transition: height 0.2s;
transition: height 0.2s;
}
.stars
{
margin: 20px 0;
font-size: 24px;
color: #d17581;
}
.navbar-form .input-group .input-group-btn {
width:1%;}
</style>
</body>
</html>