Jump to content

AngelSelmo

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by AngelSelmo

  1. This is my booking area 👇by the way this is not an assignment, it's for my capstone project , a requirement for me to graduate <?php include('connection.php'); session_start(); error_reporting(0); include('connection.php'); if(isset($_POST['submit'])) { $name=$_POST['name']; $email=$_POST['email']; $vaccinated=$_POST['vaccinated']; $vacid=$_POST['vacid']; $services=$_POST['services']; $specialist=$_POST['specialist']; $adate=$_POST['adate']; $atime=$_POST['atime']; $phone=$_POST['phone']; $userid=$_POST['userid']; $aptnumber = mt_rand(100000000, 999999999); $query=mysqli_query($con,"insert into tblappointment(Booking_Number,Name,Email,vaccinated_orNot,vax_id,PhoneNumber,Booking_Date,Booking_Time,Services,specialist,user_id) value('$aptnumber','$name','$email','$vaccinated','$vacid','$phone','$adate','$atime','$services','$specialist','$userid')"); if ($query) { $ret=mysqli_query($con,"select Booking_Number from tblappointment where Email='$email' and PhoneNumber='$phone'"); $result=mysqli_fetch_array($ret); $_SESSION['aptno']=$result['Booking_Number']; echo "<script>window.location.href='thankyou.php'</script>"; } else { $msg="Something Went Wrong. Please try again"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <title>Vaniza's Wellness||Booking Area</title> </head> <body style="background-image: url('img/bg.jpg');"> <?php include_once('header.php');?> <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> <script> $(document).ready(function(){ $(window).on('scroll', function(){ if ($(window).scrollTop()) { $("header").addClass('bgc'); }else{ $("header").removeClass('bgc'); } }); }); </script> <br> <div> <section style="margin-left: auto;margin-right: auto;width: 50%;"> <div class="container-fluid px-0" style="border:1px solid black;box-shadow: 5px 5px 5px gray;"> <div class="text"> <div class="overlay"></div> <div class="appointment-wrap"> <h3 class="mb-2">BOOKING</h3> <form action="#" method="post" class="appointment-form"> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <input type="text" class="form-control" id="name" placeholder="Name" name="name" required="true" style=""> </div> </div> <div class="col-sm-12"> <div class="form-group"> <input type="text" class="form-control" id="userid" placeholder="User ID" name="userid" required="true" style=""> </div> </div> <div class="col-sm-12"> <div class="form-group"> <input type="email" class="form-control" id="appointment_email" placeholder="Email" name="email" required="true"> </div> </div> <div class="col-sm-12"> <div class="form-group"> <div class="select-wrap"> <div class="icon"><span class="ion-ios-arrow-down"></span></div> <select name="services" id="services" required="true" class="form-control"> <option value="">Select Services</option> <?php $query=mysqli_query($con,"select * from tblservices"); while($row=mysqli_fetch_array($query)) { ?> <option value="<?php echo $row['ServiceName'];?>"><?php echo $row['ServiceName'];?></option> <?php } ?> </select> </div> </div> </div> <div class="col-sm-12"> <div class="form-group"> <div class="select-wrap" style=""> <div class="icon"><span class="ion-ios-arrow-down"></span></div> <select name="specialist" id="specialist" required="true" class="form-control"> <option value=""> Select Specialist</option> <?php $query=mysqli_query($con,"select * from employees"); while($row=mysqli_fetch_array($query)) { ?> <option value="<?php echo $row['employee_id'];?>"><?php echo $row['employee_name'];?></option> <?php } ?> </select> </div> </div> </div> <div class="col-sm-12"> <div class="form-group"> <input type="text" class="form-control appointment_date" placeholder="Date" name="adate" id='adate' required="true"> </div> </div> <div class="col-sm-12"> <div class="form-group"> <input type="text" class="form-control appointment_time" placeholder="Time" name="atime" id='atime' required="true"> </div> </div> <div class="col-sm-12"> <div class="form-group"> <input type="text" class="form-control" id="phone" name="phone" placeholder="Phone" required="true" maxlength="10" pattern="[0-9]+"> </div> </div> <div style="display: flex;"> <div style="width: 50%;border: 0px;"> <select name="vaccinated" class="form-control" id="vaccinated" required> <option value selected >Vaccinated or Not</option> <option value="vaccinated">Vaccinated</option> <option value="not">Not</option> </select> </div> <div style="width: 50%;"> <input name="vacid" type="text" id="vacid" class="form-control" required placeholder="Vaccination Id/Control NUmber"> </div> </div> <div class="form-group" style="margin-right: auto;margin-left: auto;margin-bottom: 10px;"> <input type="submit" name="submit" value="Make an Appointment" class="btn btn-primary"> </div> </form> </div> <div class="one-third"> <div class="img" style="background-image: url(images/bg-1.jpg);"></div> </div> </div> </div> </div> </section> </div> <br> </body> </html>
  2. Can you help me solve my code problem?I have no idea how to do it, can you give me sample code🥺
  3. My prof ask me to create a salon online booking system . My question is what is the code for preventing a double booking.. I have 1 table named tblappointment and inside that there is time, date and specialist .. Now I want my system to still record the data if the customer input time and date are already exist as long as the specialist is different.. and it will alert or give error message if customer input for time, date and specialist are already exist..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.