%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/var/www/html/buggydubrovnik.com/buggy-booking/
Upload File :
Create Path :
Current File : //proc/self/root/var/www/html/buggydubrovnik.com/buggy-booking/pregled.php

<?php 
include($_SERVER["DOCUMENT_ROOT"]."/buggy-booking/checkPromo.php");

 function formatMoney($number, $cents = 1) { // cents: 0=never, 1=if needed, 2=always
  if (is_numeric($number)) { // a number
    if (!$number) { // zero
      $money = ($cents == 2 ? '0.00' : '0'); // output zero
    } else { // value
      if (floor($number) == $number) { // whole number
        $money = number_format($number, ($cents == 2 ? 2 : 0)); // format
      } else { // cents
        $money = number_format(round($number, 2), ($cents == 0 ? 0 : 2)); // format
      } // integer or decimal
    } // value
	$money = str_replace(",","[]", $money);
	$money = str_replace(".",",", $money);
	$money = str_replace("[]",".", $money);
    return $money;
  } // numeric
} // formatMoney



if(!(isset($_POST["picktime"])&&isset($_POST["CustomerEmail"])))
{exit;}

$servername = "localhost";
$username="buggydubrovnik_app_production";
$password="appr-17";
$db="buggydubrovnik_app_production";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $db);
mysqli_query($conn,"set names 'utf8'");

$title = mysqli_real_escape_string($conn, $_POST["title"]);
$CustomerFirstname =mysqli_real_escape_string($conn,  $_POST["CustomerFirstname"]);
$CustomerSurname =mysqli_real_escape_string($conn,  $_POST["CustomerSurname"]);
$CustomerAddress =mysqli_real_escape_string($conn,  $_POST["CustomerAddress"]);
$CustomerCity =mysqli_real_escape_string($conn,  $_POST["CustomerCity"]);
$CustomerZIP = mysqli_real_escape_string($conn, $_POST["CustomerZIP"]);
$CustomerCountry =mysqli_real_escape_string($conn,  $_POST["CustomerCountry"]);
$CustomerPhone =mysqli_real_escape_string($conn,  "+".$_POST["CustomerCode"]."-".$_POST["CustomerPhone"]);
$CustomerEmail =mysqli_real_escape_string($conn,  $_POST["CustomerEmail"]);

//DRZAVA JE ID!!
$drzavaID=$CustomerCountry;
$drzava=$conn->query("SELECT * FROM drzava WHERE id_drzava=".$drzavaID)->fetch_assoc();
$CustomerCountry=$drzava["naziv"];


$promo =mysqli_real_escape_string($conn,  $_POST["promo"]);
$promo_id =mysqli_real_escape_string($conn,  $_POST["promo_id"]);

$odrasli =mysqli_real_escape_string($conn,  $_POST["odrasli"]);
$djeca =mysqli_real_escape_string($conn,  $_POST["djeca"]);
if ($djeca == '')
		$djeca = 0;
		
$djeca0 =mysqli_real_escape_string($conn,  $_POST["djeca0"]);
if ($djeca0 == '')
		$djeca0 = 0;
		

$komentar =mysqli_real_escape_string($conn,  $_POST["komentar"]);
$picktime =mysqli_real_escape_string($conn,  $_POST["picktime"]);
$mjeseci =mysqli_real_escape_string($conn,  $_POST["mjeseci"]);
$dani =mysqli_real_escape_string($conn,  $_POST["dani"]);

$TotalAmount=0.0;
$djecau=intval($djeca)+intval($djeca0);
$today = date("Y-m-d H:i:s");

$odkad = $today["year"].'-'.$mjeseci.'-'.$dani;
$odkadprikaz =$dani.'.'.$mjeseci.'.'.$today["year"] ;

$ShopId=20002857;
$SecretKey="d2)HS!cw6-Vi:X1GzG0M@Y_drU~QS*y2";

$price=250.00;
$discount=5;
if(checkPromo($promo)) {
    $discount=10;
}
$cijenaOdrasli=intval($odrasli)*$price;
$cijenaOdrasli=$cijenaOdrasli-($cijenaOdrasli*$discount/100);
$cijenaDjeca=intval($djeca)*($price/2);
$cijenaDjeca=$cijenaDjeca-($cijenaDjeca*$discount/100);
$TotalAmount= $cijenaOdrasli+$cijenaDjeca;


var_dump($TotalAmount);

//ovo dolje nisam dirao
// forma treba bacati na testni sustav : https://pgwtest.ht.hr/services/payment/api/authorize-form 
// uvijek mozes poci na https://pgwtest.ht.hr i logirati se preko user: buggy777 password: Buggy-412

//na index stranici omoguciti da vremena pocetka budu do:
/*3.4. - do 17 h
6.,7.,8. - do 19 h
5.,9. - do 18h
10. - do 17 h*/
//terms and conditions na index stranici cu ja napisati

//promo kodovi su:
/* Direct Booker - BUdb2

In Your Pocket - BUiP3*/

//za voucher Petar ima html kod



//




$TotalAmountV2=str_replace('.','',$TotalAmount);

$TotalAmountV2=str_replace(',','.',$TotalAmountV2);


$TotalAmountV2=$TotalAmountV2*100;

$conn->query("INSERT INTO rezervacija_temp VALUES (NULL, 'Buggy Tour', $vrijeme, '$promo', '$promo_id', $odrasli, $djeca, $djeca0, $cijenaOdrasli, $cijenaDjeca,
 NULL, '$title', '$CustomerFirstname', '$CustomerSurname', '$CustomerAddress', '$CustomerZIP', '$CustomerCity', $drzavaID, '$CustomerPhone', '$CustomerEmail',
 '$today', '$komentar', 0, '', 0, 1)");
$idtemprezervacija=$conn->insert_id;
echo $conn->error;
$conn->query("UPDATE rezervacija_temp SET broj_voucher=".$idtemprezervacija." WHERE id_rezervacija_temp=".$idtemprezervacija);
echo $conn->error;
$ShopId=20000339;
$ShoppingCartId=$idtemprezervacija;
$Signature="";
$SecretKey="bcb3@UHS3CfXvLJ~kR-z0OuI9rIp9";



//$Signature=openssl_digest("authorize-form".$SecretKey.$ShopId.$SecretKey.$ShoppingCartId.$SecretKey.$TotalAmountV2.$SecretKey."1".$SecretKey."en".$SecretKey."GET".$SecretKey."http://www.adriatic-explore.com/booking/thankyouv3.php?idtemprezervacija=".$idtemprezervacija.$SecretKey."http://www.adriatic-explore.com".$SecretKey,"SHA512");


$Signature = openssl_digest("authorize-form".$SecretKey.$ShopId.$SecretKey.$ShoppingCartId.$SecretKey.$TotalAmountV2.$SecretKey."1".$SecretKey."en".$SecretKey."GET".$SecretKey."https://www.adriatic-explore.com/booking/thankyouizlet.php".$SecretKey."https://www.adriatic-explore.com/".$SecretKey.$CustomerFirstname.$SecretKey.$CustomerSurname.$SecretKey.$CustomerAddress.$SecretKey.$CustomerCity.$SecretKey.$CustomerZIP.$SecretKey.$CustomerCountry.$SecretKey.$CustomerPhone.$SecretKey.$CustomerEmail.$SecretKey."1".$SecretKey, "SHA512");

//.$naziv." (".$odrasli." + ".$djecau." people)".$SecretKey.

?>
<!DOCTYPE html>


  
    
    
   
 
  <div id="wrapper">
	<div id="maincontentcontainer">
	  <div id="maincontent">
			<div class="section group">

		
            <div id="naslov1">	
             <h1 style="margin-bottom:25px; text-transform:uppercase">BOOKING PREVIEW | Buggy Safari Dubrovnik</h1>
		</div>
                </div>   
           <div class="section group" style="width:97%">
            
<img style="width:100%;" src="../images/booking2.jpg"  alt="buggy safari Dubrovnik" />
        </div>    
        <div class="section group" style="margin-bottom:25px; margin-top:5px; background-color:#003; height:2px;"></div>
        
          <div class="section group"  style="margin-bottom:25px;"> <b>PLEASE CHECK SUBMITTED DATA ONE MORE TIME:</b></div>
              <form name="f1" id="forma" style="font-weight:normal; text-align:left"   action="https://pgw.ht.hr/services/payment/api/authorize-form" method=POST>
              
              
<div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">Excursion: </div><div class="col span_3_of_4"><input readonly style="width:300px" class="inputtekst" name="nazivizlet" type="text" value="<?php echo $naziv; ?>" /></div></div>


  <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">Price per person:</div><div class="col span_3_of_4"><b><?php echo formatMoney($cijena,2); ?></b> HRK
      </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:5px;">
<img src="/images/infoicon.png" alt="info" style="vertical-align:middle" /><strong> PERSONAL DATA</strong> </div>
 <div class="section group" style="margin-bottom:15px; 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">
            	<input class="inputtekst" name="title"  type="text" readonly style="width:300px;"  value="<?php echo $title; ?>"/>
            </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 class="inputtekst" name="pgw_first_name" type="text" readonly style="width:300px;" value="<?php echo $CustomerFirstname; ?>" /></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 class="inputtekst" name="pgw_last_name" type="text" readonly style="width:300px;" value="<?php echo $CustomerSurname ; ?>" /></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 class="inputtekst" name="pgw_street" type="text" readonly style="width:300px;" value="<?php echo $CustomerAddress; ?>" /></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 class="inputtekst" name="pgw_city" type="text" readonly style="width:300px;" value="<?php echo $CustomerCity; ?>" /></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 class="inputtekst" name="pgw_post_code" type="text" readonly style="width:300px;" value="<?php echo $CustomerZIP; ?>" /></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"><input class="inputtekst" name="pgw_country" type="text" readonly style="width:300px;" value="<?php echo $CustomerCountry; ?>" /></div></div>
               
               
                 <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4"> Telephone : </div><div class="col span_3_of_4"><input class="inputtekst" name="pgw_telephone" type="text" readonly style="width:300px;" value="<?php echo $CustomerPhone; ?>" /></div></div>
               
               
                 <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4"> E-mail : </div><div class="col span_3_of_4"><input class="inputtekst" name="pgw_email" type="text" readonly style="width:300px;"value="<?php echo $CustomerEmail; ?>" /></div></div>



<input type="hidden" name="pgw_failure_url" value="https://www.adriatic-explore.com/">
<input type="hidden" name="pgw_success_url" value="https://www.adriatic-explore.com/booking/thankyouizlet.php">
 <input type="hidden" name="pgw_shop_id" value="<?=$ShopId?>">
 <input type="hidden" name="pgw_order_id" value="<?=$ShoppingCartId ?>">
 <input type="hidden" name="pgw_amount" value="<?php echo $TotalAmountV2 ?>">
 <input type="hidden" name="pgw_authorization_type" value="1">
 <input type="hidden" name="pgw_language" value="en">
 <input type="hidden" name="pgw_return_method" value="GET"> 
 <input type="hidden" name="pgw_signature" value="<?php echo $Signature ?>">
 <input type="hidden" name="pgw_disable_installments" value="1"> 
 <input type="hidden" name="DebugMode" value="on"> 
        
         
<!-- <input type="hidden" name="pgw_order_info" value="<?php echo $naziv.' ('.$odrasli.' + '.$djecau.' people)'; ?>">  -->




    
 <div class="section group" style="margin-bottom:5px; margin-top:15px; background-color:#003; height:2px;"></div>
     <div class="section group" style="margin-bottom:5px;">
<img src="/images/excursion.png" alt="excursion" style="vertical-align:middle" /><strong> Excursion data</strong> </div>


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

<div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   
Day &amp; Date :</div> <div class="col span_3_of_4">    <input class="inputtekst" style="width:300px;" name="odkad" type="text" readonly  value="<?php echo $odkadprikaz; ?>"/> 
            
			
	</div></div>
    
    
	<div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   Adults: </div><div class="col span_3_of_4">
		<input class="inputtekst" name="odrasli" type="text" readonly style="width:300px;" value="<?php echo $odrasli; ?>" />
	</div></div>
    
    
	<div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">  <?php if ($idizlet==102){ echo ' Children 2-13:'; } else { echo ' Children 6-12:';} ?></div><div class="col span_3_of_4">
		<input class="inputtekst" name="djeca" type="text" readonly style="width:300px;"value="<?php echo $djeca; ?>" />
	</div></div>
    
    
    <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   <?php if ($idizlet==102){ echo ' Children 0-2:'; } else { echo ' Children 0-6:';} ?></div><div class="col span_3_of_4">
		<input class="inputtekst" name="djeca0" type="text" readonly style="width:300px;"value="<?php echo $djeca0; ?>" />
	</div></div>
    
    
    

    

<div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   Comment:</div><div class="col span_3_of_4"> 
    	<textarea class="inputtekst" style="width:300px; font-family:Arial, Helvetica, sans-serif; min-height:100px; text-align:left;" name="komentar"><?php echo $komentar; ?></textarea>
    </div></div>
    
    
    
   <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   <b>TOTAL AMOUNT<?php if($idizlet!=102 && $idizlet!=103 && $idizlet!=104 && $idizlet!=82 && $idizlet!=105 && $idizlet!=106 && $idizlet!=107 && $idizlet!=108 && $idizlet!=109 && $idizlet!=110 && $idizlet!=111)	{ echo ' WITHOUT DISCOUNT';} ?> </b></div><div class="col span_3_of_4">
    	<input class="inputtekst" type="text" readonly style="width:300px;  text-align:left; font-weight:bold;" name="iznostotal" value="<?php echo formatMoney($ukupnaCijena,2); ?> HRK (<?php echo formatMoney($ukupnaCijena/$tecajDanas,2) ?> EUR)" />
    </div></div>
    
    
    <?php if($idizlet==102 || $idizlet==103 || $idizlet==104  || $idizlet==82 || $idizlet==105 || $idizlet==106 || $idizlet==107 || $idizlet==108 || $idizlet==109 || $idizlet==110 || $idizlet==111)	{ echo '<!--';} ?>
     <div class="section group" style="margin-bottom:5px;">
<div class="col span_1_of_4">   <b>TOTAL AMOUNT (WITH DISCOUNT) </b></div><div class="col span_3_of_4">
    	<input class="inputtekst" type="text" readonly style="width:300px;  text-align:left; color:#F72A5D; font-weight:bold;" name="iznostotal" value="<?php echo formatMoney($TotalAmount1,2); ?> HRK (<?php echo formatMoney($TotalAmount1/$tecajDanas,2) ?> EUR)" />
   </div></div>
     <?php if($idizlet==102 || $idizlet==103 || $idizlet==104   || $idizlet==82  || $idizlet==105 || $idizlet==106 || $idizlet==107 || $idizlet==108 || $idizlet==109 || $idizlet==110 || $idizlet==111 )	{ echo '-->';} ?>
    
    
  <div class="section group" style="margin-bottom:5px;">
   <br /> <img src="../images/backicon.png" style="border:none; cursor:pointer;vertical-align:middle " onclick="history.go(-1)" /><a style="color:black; font-size:1.2em;" href="history.go(-1)">GO BACK AND CHANGE DETAILS</a><br /><br /></div>
   
   
	<div class="section group" style="margin-bottom:5px;"><b>NOTE</b>:<br />
	We recommend booking and paying online - Your place is then guaranteed!<br /> Due to restricted number of people on each tour/excursion it's best to reserve Your place as soon as possible.</div>
    
    
    <div class="section group" style="margin-bottom:5px; margin-top:15px; ">
   <input class="button" type="submit" value="CONTINUE TO SECURE PAY ONLINE"   onclick="return true;" style="font-size:0.9em; cursor:pointer; padding-top:10px; padding-bottom:10px; height:50px;"  /> </div>
   <div class="section group" style="margin-bottom:5px; text-align:center; margin-top:5px;"><br /><img src="../images/trust.png" /> <img src="../images/karticebig.png" /> <img src="../images/trcom.png" /></div>
    
              </form>


                
      </div>    
   
       
            
         
         
            
     
	  </div>
</div>
	
    
    

<script src="/buggy-booking/gen_validatorv4.js" type="text/javascript"></script>


Zerion Mini Shell 1.0