Salon Mybookigs

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

<?

php

session_start();

error_reporting(0);

include('includes/config.php');

if(strlen($_SESSION['login'])==0)

header('location:index.php');

else{

?>

<?php

if(isset($_POST['submit']))

$useremail=$_SESSION['login'];

$vid = $_POST['vid'];

$message=$_POST['message'];

$sql="INSERT INTO tblreview(userEmail,SalonId,message) VALUES(:useremail,:vid,:message)";

$query = $dbh->prepare($sql);

$query->bindParam(':useremail',$useremail,PDO::PARAM_STR);

$query->bindParam(':vid',$vid,PDO::PARAM_STR);

$query->bindParam(':message',$message,PDO::PARAM_STR);

$query->execute();

$lastInsertId = $dbh->lastInsertId();

if($lastInsertId)

echo "<script>alert('Review post successfull.');</script>";


}

else

echo "<script>alert('Something went wrong. Please try again');</script>";

?>

<!DOCTYPE HTML>

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width,initial-scale=1">

<meta name="keywords" content="">

<meta name="description" content="">

<title>Search for Salon | Booking</title>

<!--Bootstrap -->

<link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css">

<!--Custome Style -->

<link rel="stylesheet" href="assets/css/style.css" type="text/css">

<!--OWL Carousel slider-->

<link rel="stylesheet" href="assets/css/owl.carousel.css" type="text/css">

<link rel="stylesheet" href="assets/css/owl.transitions.css" type="text/css">

<!--slick-slider -->

<link href="assets/css/slick.css" rel="stylesheet">

<!--bootstrap-slider -->
<link href="assets/css/bootstrap-slider.min.css" rel="stylesheet">

<!--FontAwesome Font Style -->

<link href="assets/css/font-awesome.min.css" rel="stylesheet">

<!-- SWITCHER -->

<link rel="stylesheet" id="switcher-css" type="text/css" href="assets/switcher/css/switcher.css"


media="all" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/red.css" title="red"


media="all" data-default-color="true" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/orange.css" title="orange"


media="all" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/blue.css" title="blue"


media="all" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/pink.css" title="pink"


media="all" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/green.css" title="green"


media="all" />

<link rel="alternate stylesheet" type="text/css" href="assets/switcher/css/purple.css" title="purple"


media="all" />

<!-- Google-Font-->

<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">

</head>

<body>

<!-- Start Switcher -->

<?php include('includes/colorswitcher.php');?>
<!-- /Switcher -->

<!--Header-->

<?php include('includes/header.php');?>

<!--Page Header-->

<!-- /Header -->

<!--Page Header-->

<section class="page-header profile_page">

<div class="container">

<div class="page-header_wrap">

<div class="page-heading">

<h1>My Booking</h1>

</div>

<ul class="coustom-breadcrumb">

<li><a href="#">Home</a></li>

<li>My Booking</li>

</ul>

</div>

</div>

<!-- Dark Overlay-->

<div class="dark-overlay"></div>

</section>

<!-- /Page Header-->

<?php

$useremail=$_SESSION['login'];

$sql = "SELECT * from tblusers where EmailId=:useremail";

$query = $dbh -> prepare($sql);


$query -> bindParam(':useremail',$useremail, PDO::PARAM_STR);

$query->execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

$cnt=1;

if($query->rowCount() > 0)

foreach($results as $result)

{ ?>

<section class="user_profile inner_pages">

<div class="container">

<div class="user_profile_info gray-bg padding_4x4_40">

<div class="upload_user_logo"> <img src="assets/images/test_user.png" alt="image">

</div>

<div class="dealer_info">

<h5><?php echo htmlentities($result->FullName);?></h5>

<p><?php echo htmlentities($result->Address);?><br>

<?php echo htmlentities($result->City);?>&nbsp;<?php echo htmlentities($result-


>Country); }}?></p>

</div>

</div>

<div class="row">

<div class="col-md-3 col-sm-3">

<?php include('includes/sidebar.php');?>

<div class="col-md-8 col-sm-4">

<div class="profile_wrap">

<h5 class="uppercase underline">My Booikngs </h5>

<div class="my_salons_list">
<ul class="salon_listing">

<?php

$useremail=$_SESSION['login'];

$sql = "SELECT tblsalons.Vimage1 as Vimage1,tblsalons.SalonsTitle,tblsalons.ServiceType,tblsalons.id as


vid,tbllocations.LocationName,tblbooking.BookingDate,tblbooking.BookingTime,tblbooking.message,tbl
booking.Status from tblbooking join tblsalons on tblbooking.SalonId=tblsalons.id join tbllocations on
tbllocations.id=tblsalons.Salonslocation where tblbooking.userEmail=:useremail";

$query = $dbh -> prepare($sql);

$query-> bindParam(':useremail', $useremail, PDO::PARAM_STR);

$query->execute();

$results=$query->fetchAll(PDO::FETCH_OBJ);

$cnt=1;

if($query->rowCount() > 0)

foreach($results as $result)

{ ?>

<li>

<div id="salon_img" style="float:left"> <a href="salon-details.php?vhid=<?php


echo htmlentities($result->vid);?>"><img src="admin/img/salonimages/<?php echo htmlentities($result-
>Vimage1);?>" alt="image" width="50%" height="50%">

</a>

<form method="post" style="float: inline-end;">

<input type="hidden" name="vid" value="<?php echo htmlentities($result-


>vid);?>">

<div class="form-group">
<textarea class="form-control white_bg" name="message" rows="2"
placeholder="Write a short review..." required="required"></textarea>

</div>

<div class="form-group">

<input type="submit" value="Submit Review" name="submit" id="submit"


class="btn btn-block">

</div>

</form>

</div>

<a>Salon ID

<?php echo htmlentities($result->vid);?></a>

<div class="salon_title">

<h6><a href="salon-details.php?vhid=<?php echo htmlentities($result->vid);?


>"> <?php echo htmlentities($result->SalonsTitle);?> , <?php echo htmlentities($result-
>LocationName);?></a></h6>

<div>

<p><b>My Address:</b> <?php echo htmlentities($result->message);?> </p>

<p><b>Booking Type:</b> <?php echo htmlentities($result->ServiceType);?>


</p>
</div>

<p><b>Booking Date:</b> <?php echo htmlentities($result->BookingDate);?


><br /> <b>Booking Time:</b> <?php echo htmlentities($result->BookingTime);?></p>

</div>

<?php if($result->Status==1)

{ ?>

<div class="salon_status"> <a href="#" class="btn outline btn-xs active-


btn">Confirmed</a>

<div class="clearfix"></div>

</div>

<?php } else if($result->Status==2) { ?>

<div class="salon_status"> <a href="#" class="btn outline btn-xs">Cancelled</a>

<div class="clearfix"></div>

</div>

<?php } else { ?>

<div class="salon_status"> <a href="#" class="btn outline btn-xs">Not Confirm


yet</a>

<div class="clearfix"></div>

</div>
<?php } ?>

</li>

<?php }} ?>

</ul>

</div>

</div>

</div>

</div>

</div>

</div>

</section>

<!--/my-salons-->

<?php include('includes/footer.php');?>

<!-- Scripts -->

<script src="assets/js/jquery.min.js"></script>

<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/js/interface.js"></script>

<!--Switcher-->

<script src="assets/switcher/js/switcher.js"></script>

<!--bootstrap-slider-JS-->
<script src="assets/js/bootstrap-slider.min.js"></script>

<!--Slider-JS-->

<script src="assets/js/slick.min.js"></script>

<script src="assets/js/owl.carousel.min.js"></script>

</body>

</html>

<?php } ?>

You might also like