EVOLUTION-NINJA
Edit File: Book_now.php
<?php echo view('includes/header');?> <div class="row"> <div class="col-sm-3"> <!-- <img src="assets/images/Bindu Travels_Logo 6.png" class="image-fluid"> --> </div> </div> <div class="container"> <div class="row mb-3 book-mob-top"> <div class="col-md-6 offset-md-3"> <div class="card" style="background-color: #ebebeb;"> <div class="card-body"> <h2 class="text-center">Book Now</h2> <!-- <form> --> <div class="form-group"> <label for="mobileNumber">Name</label> <input type="text" class="form-control" id="name" placeholder="Enter your Name" > </div> <div class="form-group"> <label for="mobileNumber">Mobile Number:</label> <input type="tel" class="form-control" id="mobileNumber" placeholder="Enter your mobile number" > </div> <div class="form-group"> <label for="gmail">Gmail:</label> <input type="email" class="form-control" id="gmail" placeholder="Enter your Gmail address" > </div> <div class="form-group"> <label for="selectPackage">Select Package:</label> <select class="form-control" id="selectPackage" > <option value="" selected disabled>Select a package</option> <option value="Mysore">Mysore</option> <option value="Mysore to Bangalore">Mysore to Bangalore</option> <option value="Mysore to Chikmagalur">Mysore to Chikmagalur</option> <option value="Mysore to Coorg">Mysore to Coorg</option> <option value="Mysore to Kodaikanal">Mysore to Kodaikanal</option> <option value="Mysore to Ooty">Mysore to Ooty</option> <option value="Mysore to Wayanad">Mysore to Wayanad</option> <option value="Others">Others</option> </select> </div> <div class="text-center"> <button type="submit" id="rzp-button1" class="btn btn-success">Book Now</button> </div> <!-- </form> --> </div> </div> </div> </div> </div> <script src="https://checkout.razorpay.com/v1/checkout.js"></script> <?php $merchant_order_id = "ABC-".date("YmdHis"); $amount = 100; ?> <script> document.getElementById('rzp-button1').onclick = function(e){ var amt = '<?php echo $amount; ?>'; var orderid = '<?php echo $merchant_order_id; ?>'; var options = { "key": "rzp_test_H3hrEq1lMYeOyg", // Enter the Key ID generated from the Dashboard "amount": "100", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise //"amount": "100", // Amount is in currency subunits. Default currency is INR. Hence, "currency": "INR", "name": "Bindu Travells", "description": "Bindu Travells payment", "image": "<?php echo base_url('public/assets/images/medusys.jpg');?>", "handler": function (response){ $.ajax({ type : "POST", url : '<?php echo base_url("booked-user")?>', data : {pay_id:orderid, amount:amt, transaction_id:response.razorpay_payment_id}, success:function(response){ response = jQuery.parseJSON(response); if(response.result==1){ swal({ title: "Welcome!", text: "Thank you for Payment.Confirmation email has been sent to you..", type: "success", confirmButtonText: "Okay" }, function(isConfirm){ if(isConfirm){ $(".sweet-alert").hide(); $(".sweet-overlay").hide(); alert('thankyou'); window.location = '<?php echo base_url("/")?>'; } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else toastr["error"](response.message); } }); }, "prefill": { "name": "balu", "email": "rbalu7432gmail.com", "contact": "9110631770" }, "notes": { soolegal_order_id: "<?php echo $merchant_order_id; ?>", }, "theme": { "color": "#3399cc" } }; var rzp1 = new Razorpay(options); var name=document.getElementById('name').value; var mobile=document.getElementById('mobileNumber').value; var email=document.getElementById('gmail').value; var package=document.getElementById('selectPackage').value; e.preventDefault(); // alert(mobile) if(mobile==''){ toastr.error('please enter mobile number'); return; }else if(name==''){ toastr.error('please enter name'); return; }else if(email==''){ toastr.error('please enter email'); return; }else if(package==''){ toastr.error('please select a package'); return; }else{ rzp1.open(); } } </script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <?php echo view('includes/footer');?>