<?php
$arraypriceroom           = array();
$arraytaxroom             = array();
$arraytotalpriceroom      = array();
$arrayguests              = array();
$infoArray['itineraryID'] = $itinerary_id;
$infoArray['email']       = $email_client;
$itinerary                = mysqli_query($conn, "SELECT * FROM itineraries AS iti JOIN transactions AS tra ON iti.itinerary_id = tra.itinerario_id WHERE iti.itinerary_id = '$itinerary_id' AND iti.email_owner = '$email_client' ");
$itinerarytotal           = mysqli_num_rows($itinerary);
$itineraryData            = mysqli_fetch_array($itinerary);
$itinerary_id             = $itineraryData['itinerary_id'];
//Customer Information
$emailCustomer            = $itineraryData['email_owner'];
$firstnameCustomer        = $itineraryData['first_name_owner'];
$lastnameCustomer         = $itineraryData['last_name_owner'];
$homephoneCustomer        = $itineraryData['phone_owner'];
$workphoneCustomer        = '';
$addressCustomer          = $itineraryData['address'];
$cityCustomer             = $itineraryData['city'];
$stateCustomer            = $itineraryData['state'];
$countryCustomer          = $itineraryData['country'];
$postalcodeCustomer       = $itineraryData['zipcode'];
//Hotel General Data
$arrivalDate              = $itineraryData['check_in_date'];
$departureDate            = $itineraryData['check_out_date'];
$rooms_number             = $itineraryData['rooms_number'];
$total_amount             = $itineraryData['total_amount'];
$confirmationNumber       = $itineraryData['itinerary_id'];
$numberOfChildren         = $totalchildren;
//Data for more information
$RoomtypeId               = $itineraryData['room_type_id'];
$HotelId                  = $itineraryData['hotel_id'];
$RoomNumbers              = $itineraryData['rooms_number'];
//Room Information
$roominfo                 = mysqli_query($conn, "SELECT * FROM hotel_room_type WHERE room_type_id = '$RoomtypeId' AND hotel_id = '$HotelId' ");
$roominfototal            = mysqli_num_rows($roominfo);
$roominfoData             = mysqli_fetch_array($roominfo);
$roomnamedescription      = $roominfoData['room_type_name'];
//Hotel Information
$hotelinformation         = mysqli_query($conn, "SELECT hot.hotel_name, hot.hotel_address, ci.city_name, cou.country, hot.hotel_zipcode, hot.hotel_stars, hot.hotel_review_score, hot.longitud, hot.latitud, hot.policy_cancel FROM hotels AS hot JOIN cities AS ci ON hot.hotel_city = ci.city_id JOIN countries AS cou ON hot.hotel_country = cou.countrycode  WHERE hot.hotel_id = '$HotelId' ");
$hotelinformationtotal    = mysqli_num_rows($hotelinformation);
$hotelinformationData     = mysqli_fetch_array($hotelinformation);
$cancelpolicy = $hotelinformationData['policy_cancel'];
$preciohiroom             = '0.00';
$taxhiroom                = '0.00';
$totalpreciohiroom        = '0.00';
//Booking Information
$bookinginfo              = mysqli_query($conn, "SELECT * FROM booking_master WHERE itinerary_id = '$itinerary_id' ");
$bookinginfototal         = mysqli_num_rows($bookinginfo);

while ($bookinginfoData = mysqli_fetch_array($bookinginfo)) {
    $pricerooma       = $bookinginfoData['total_price'];
    $taxrooma         = $bookinginfoData['tax_night'];
    $allpricerooma    = $bookinginfoData['total_price'];
    $guestfirstname   = $bookinginfoData['first_name_owner'];
    $guestlastname    = $bookinginfoData['last_name_owner'];
    $camposroomsprice = array(
        'room_price_total' => $pricerooma,
        'taxfee' => $taxrooma,
        'allrooms_pricetotal' => $allpricerooma,
        'guest_firstname' => $guestfirstname,
        'guest_lastname' => $guestlastname
    );
    array_push($arraypriceroom, $camposroomsprice);
    $taxhiroom         = $taxhiroom + $taxrooma;
    $totalpreciohiroom = $totalpreciohiroom + $allpricerooma;
}

//Hotel Data
$hotelSize       = '1';
$hotelId         = $HotelId;
$hotelName       = $hotelinformationData['hotel_name'];
$hotelAddress    = $hotelinformationData['hotel_address'];
$hotelCity       = $hotelinformationData['city_name'];
$hotelCountry    = $hotelinformationData['country'];
$hotelPostalcode = $hotelinformationData['hotel_zipcode'];
$hotelRating     = $hotelinformationData['hotel_stars'];
$hotelTriprating = $hotelinformationData['hotel_review_score'];
$latitude        = $hotelinformationData['latitud'];
$longitude       = $hotelinformationData['longitud'];
?>