コード例 #1
0
ファイル: listing.php プロジェクト: bulini/booking-wp
"><?php 
        the_title();
        ?>
</a>
                     </h5>
                     <ul class="tags custom-list list-inline pull-left">
                       <li><a href="#"><?php 
        echo get_post_meta($post->ID, 'beds', true);
        ?>
 <i class="fa fa-bed"></i></a></li>
                       <li><a href="#"><?php 
        echo get_post_meta($post->ID, 'max_people', true);
        ?>
 <i class="fa fa-user"></i></a></li>
                       <li><a href="#"><?php 
        echo mytheme_get_option('city_name');
        ?>
</a></li>
                     </ul>
                   </div>
                   <div class="pull-right">

                     <span class="price">
                       <?php 
        //procedurizzare
        $range_id = get_post_meta($post->ID, 'type', true);
        $term = get_term($range_id[0], 'types');
        $checkin = isset($_GET['checkin']) ? $_GET['checkin'] : date('d/m/Y');
        $checkout = isset($_GET['checkout']) ? $_GET['checkout'] : date('d/m/Y');
        $people = isset($_GET['people']) ? $_GET['people'] : 2;
        $room_number = isset($_GET['room_number']) ? $_GET['room_number'] : 1;
コード例 #2
0
ファイル: header.php プロジェクト: bulini/booking-wp
</span></li>
	              <li><i class="fa fa-envelope"></i><span><?php 
echo mytheme_get_option('email');
?>
</span></li>
	            </ul>
	          </div>
	          <div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 text-right pull-right">
	            <div class="contact-right">
	              <ul class="social custom-list list-inline">
	                <li><a href="<?php 
echo mytheme_get_option('facebook_url');
?>
"><i class="fa fa-facebook-square"></i></a></li>
	                <li><a href="<?php 
echo mytheme_get_option('twitter_url');
?>
"><i class="fa fa-twitter-square"></i></a></li>
	                <!--<li><a href="#"><i class="fa fa-linkedin-square"></i></a></li>-->
	              </ul>
								<!--
								<div class="header-login">
	                <button class="login-toggle header-btn"><i class="fa fa-power-off"></i> Login</button>
	                <div class="header-form">
	                  <form action="index.html" class="default-form">
	                    <p class="alert-message warning"><i class="ico fa fa-exclamation-circle"></i> All fields are required! <i class="fa fa-times close"></i></p>
	                    <p class="form-row">
	                      <input class="required email" type="text" placeholder="Email">
	                    </p>
	                    <p class="form-row">
	                      <input class="required" type="password" placeholder="Password">
コード例 #3
0
ファイル: map-page.php プロジェクト: bulini/booking-wp
                  <div class="col-lg-6 col-md-12">
                    <ul class="location-details custom-list">
                      <li><?php 
    echo mytheme_get_option('place_address');
    ?>
</li>
                      <li><?php 
    echo mytheme_get_option('city');
    ?>
</li>
                    </ul>
                  </div>
                  <div class="col-lg-6 col-md-6">
                    <ul class="location-details custom-list">
                      <li>Phone 1: <?php 
    echo mytheme_get_option('phone');
    ?>
</li>
                    </ul>
                  </div>

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

        </div>
      </div>
    </div>
    <!-- End Locations-Bottom -->
コード例 #4
0
ファイル: thank-you.php プロジェクト: bulini/booking-wp
    $reservation_details = booking_details($bid);
    $cancellation_policy = sprintf(pll_translate_string(booking_get_option('bookingwp_cancellation_policy'), $request_language), $name);
    $email_content = $intro_text;
    $email_content .= $reservation_details;
    $email_content .= "<hr/>" . PHP_EOL . PHP_EOL;
    $email_content .= "<h5>Cancellation Policy</h5><small>" . $cancellation_policy . "</small>";
    $msg = wordwrap($e_body, 70);
    $e_body = build_email($email_content);
    $headers[] = "From: {$from}" . PHP_EOL;
    $headers[] = "Bcc: {$email_bcc}" . PHP_EOL;
    //customer voucher
    wp_mail($address, $e_subject, $e_body, $headers);
    //admin card
    $owner_subject = __('Conferma Prenotazione #', 'wpbooking') . $bid;
    $owner_address = mytheme_get_option('email');
    $from = mytheme_get_option('place_name') . ' <' . $address . '>';
    $email_content_owner = "<b>Card:</b> {$encrypted}<br />";
    $email_content_owner .= "<b>Exp Card:</b>" . $_POST['cc-exp'] . '<br />';
    $email_content_owner .= "<b>CVV Card:</b>" . $_POST['cc-cvv'] . '<br />';
    $email_content_owner .= "<b>Name on card:</b> " . $_POST['name-oncard'] . "<br />";
    $email_content_owner .= $reservation_details;
    $e_body = build_email($email_content_owner);
    $headers[] = "From: {$from}" . PHP_EOL;
    $headers[] = "Bcc: {$email_bcc}" . PHP_EOL;
    //customer voucher
    wp_mail($owner_address, $owner_subject, $e_body, $headers);
    ?>

<div class="well">
	<div class="row">
			<div class="col-xs-6 col-sm-6 col-md-6">
コード例 #5
0
ファイル: booking-handler.php プロジェクト: bulini/booking-wp
function build_email($message)
{
    $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- So that mobile will display zoomed in -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- enable media queries for windows phone 8 -->
  <meta name="format-detection" content="telephone=no"> <!-- disable auto telephone linking in iOS -->
  <title>Single Column</title>

  <style type="text/css">
body {
  margin: 0;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
table {
  border-spacing: 0;
}
table td {
  border-collapse: collapse;
}
.ExternalClass {
  width: 100%;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
  line-height: 100%;
}
.ReadMsgBody {
  width: 100%;
  background-color: #ebebeb;
}
table {
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
}
img {
  -ms-interpolation-mode: bicubic;
}
.yshortcuts a {
  border-bottom: none !important;
}
@media screen and (max-width: 599px) {
  .force-row,
  .container {
    width: 100% !important;
    max-width: 100% !important;
  }
}
@media screen and (max-width: 400px) {
  .container-padding {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
.ios-footer a {
  color: #aaaaaa !important;
  text-decoration: underline;
}
</style>
</head>

<body style="margin:0; padding:0;" bgcolor="#F0F0F0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- 100% background wrapper (grey background) -->
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="#F0F0F0">
  <tr>
    <td align="center" valign="top" bgcolor="#F0F0F0" style="background-color: #F0F0F0;">

      <br>

      <!-- 600px container (white background) -->
      <table border="0" width="600" cellpadding="0" cellspacing="0" class="container" style="width:600px;max-width:600px">
        <tr>
          <td class="container-padding header" align="left" style="font-family:Helvetica, Arial, sans-serif;font-size:24px;font-weight:bold;padding-bottom:12px;color:#DF4726;padding-left:24px;padding-right:24px">
            ' . mytheme_get_option('place_name') . '
          </td>
        </tr>
        <tr>
          <td class="container-padding content" align="left" style="padding-left:24px;padding-right:24px;padding-top:12px;padding-bottom:12px;background-color:#ffffff">
            <br>

<div class="title" style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:600;color:#374550">Booking</div>
<br>

      <div class="body-text" style="font-family:Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;text-align:left;color:#333333">';
    $html .= $message;
    $html .= '</div>

          </td>
        </tr>
        <tr>
          <td class="container-padding footer-text" align="left" style="font-family:Helvetica, Arial, sans-serif;font-size:12px;line-height:16px;color:#aaaaaa;padding-left:24px;padding-right:24px">
            <br><br>
            © 2015
            <strong>' . mytheme_get_option('place_name') . '</strong><br>
            <span class="ios-footer">
              ' . mytheme_get_option('place_address') . '<br>
            </span>
            <span class="ios-footer">
              ' . mytheme_get_option('phone') . '<br>
            </span>
            <a href="' . get_bloginfo('siteurl') . '" style="color:#aaaaaa">' . get_bloginfo('siteurl') . '</a><br>

            <br><br>

          </td>
        </tr>
      </table>
<!--/600px container -->


    </td>
  </tr>
</table>
<!--/100% background wrapper-->

</body>
</html>';
    return $html;
}
コード例 #6
0
             	<div class="col-sm-4"><?php 
        _e('Sorry, no posts matched your criteria.');
        ?>
</div>
            <?php 
    }
    wp_reset_query();
    ?>
            </div>
            </div>
          </div>
          <div class="sidebar col-md-3">


            <?php 
    $address = get_post_meta($post->ID, 'address', true) ? get_post_meta($post->ID, 'address', true) : mytheme_get_option('place_address');
    ?>
            <div id="map" data-address="<?php 
    echo $address;
    ?>
"></div>
            <?php 
    get_template_part('template-parts/calendar');
    ?>

            <?php 
    get_template_part('template-parts/single-reservation-form');
    ?>


コード例 #7
0
function service_list($lang)
{
    $service_list = mytheme_get_option('custom_services_list_' . $lang);
    $services = explode(",", $service_list);
    $i = 0;
    $html = '<table class="table table-striped mt30">
              <tbody>';
    foreach ($services as $service) {
        $html .= '<tr><td><i class="fa fa-check-circle"></i> ' . $service . '</td></tr>';
    }
    $html .= '</tbody>
		</table>';
    return $html;
}
コード例 #8
0
ファイル: ajax-handler.php プロジェクト: bulini/booking-wp
function home_booking()
{
    if (!$_POST) {
        if (!defined("PHP_EOL")) {
            define("PHP_EOL", "\r\n");
        }
    }
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $checkin = $_POST['checkin'];
    $checkout = $_POST['checkout'];
    $room_id = $_POST['room_id'];
    $room = $_POST['room'];
    $adults = $_POST['adults'];
    $children = $_POST['children'];
    $room_number = $_POST['room_number'];
    $message = $_POST['message'];
    $lang = $_POST['current_lang'];
    //if availability
    if (!is_available($room_id, $checkin, $checkout)) {
        echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>La camera richiesta risulta occupata nelle date richieste!</div>';
        exit;
    }
    if (trim($email) == '') {
        echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Attention! Please enter a valid email address.</div>';
        exit;
    } else {
        if (trim($room) == '') {
            echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Attention! Please enter what kind of room.</div>';
            exit;
        } else {
            if (trim($checkin) == '') {
                echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Attention! Please enter your check-in date.</div>';
                exit;
            } else {
                if (trim($checkout) == '') {
                    echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Attention! Please enter your check-out date.</div>';
                    exit;
                } else {
                    if (!isEmail($email)) {
                        echo '<div class="alert alert-danger alert-dismissable">
	  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>Attention! You have enter an invalid e-mail address, try again.</div>';
                        exit;
                    }
                }
            }
        }
    }
    if (get_magic_quotes_gpc()) {
        $comments = stripslashes($comments);
    }
    //titolo stanza composto da nome hotel + stanza x evitare duplicati...
    $main_name = 'booking ';
    $camera = get_the_title($room);
    // ADD THE FORM INPUT TO $new_post ARRAY
    $new_booking = array('post_title' => $main_name . ' - ' . $camera, 'post_type' => 'bookings', 'post_status' => 'waiting');
    //SAVE THE POST
    $bid = wp_insert_post($new_booking);
    $price = check_price($checkin, $checkout, $room, $room_number);
    $token = uniqid();
    $request_page = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
    $manager_url = get_bloginfo('siteurl') . '/reservations-system/?token=' . $token;
    update_post_meta($bid, 'name', $name);
    update_post_meta($bid, 'email', $email);
    update_post_meta($bid, 'phone', $phone);
    update_post_meta($bid, 'room', $room);
    update_post_meta($bid, 'room_id', $room_id);
    update_post_meta($bid, 'token', $token);
    update_post_meta($bid, 'manager_url', $manager_url);
    update_post_meta($bid, 'checkin', convert_date_to_timestamp($checkin));
    update_post_meta($bid, 'checkout', convert_date_to_timestamp($checkout));
    update_post_meta($bid, 'adults', $adults);
    update_post_meta($bid, 'children', $children);
    update_post_meta($bid, 'room_number', $room_number);
    update_post_meta($bid, 'message', $message);
    update_post_meta($bid, 'lang', $lang);
    if ($price) {
        update_post_meta($bid, 'price', $price);
    }
    $room_type = get_the_title($room);
    //$address = "*****@*****.**";
    $address = mytheme_get_option('email');
    $from = mytheme_get_option('place_name') . ' <' . $address . '>';
    $email_bcc = get_bloginfo('admin_email');
    // Configuration option.
    $e_subject = 'Booking n # ' . $bid . ' da ' . $email;
    $e_body = "Richiesta di prenotazione da <b>: {$name} {$email} tel. {$phone}</b>\n\n\t\tRichiesta prenotazione per le seguenti date<br />\n\t\tCheckin: <b>: {$checkin} </b><br />\n\t\tCheck-out <b>: {$checkout} </b><br />\n\t\tmessaggio <b>: {$message} </b><br />\n\n\t\tLa richiesta &egrave; di n, <b>{$room_number}</b>  <b>{$room_type}</b> per <b>{$adults} Adulti</b> e <b>{$children} bambini</b>.<br />\n\t\tIl prezzo proposto dal sistema in base alle tue impostazioni &egrave; di &euro; <b>{$price}</b> .<br />\n\t\tRicevuta da: {$request_page}.<br />\n\t\tin lingua: {$lang}.<br />\n\t\t<hr />\n\t\t<a href='{$manager_url}'>Gestisci</a>" . PHP_EOL . PHP_EOL;
    $e_reply = "<br />You can contact the customer via email, {$email} or hit 'reply' in your email browser to make the reservation complete.";
    $msg = wordwrap($e_body . $e_reply, 70);
    $headers[] = "From: {$from}" . PHP_EOL;
    $headers[] = "Bcc: {$email_bcc}" . PHP_EOL;
    //if(mail($address, $e_subject, $msg, $headers)) {
    if (wp_mail($address, $e_subject, $e_body, $headers)) {
        //email to customer
        // Reset content-type to avoid conflicts -- http://core.trac.wordpress.org/ticket/23578
        remove_filter('wp_mail_content_type', 'set_html_content_type');
        $price = check_price($checkin, $checkout, $room);
        // Email has sent successfully, echo a success page.
        //try to understand what kind of booking: instant on-request
        $booking_type = booking_get_option('booking_type');
        if ($booking_type == 'instant') {
            $confirmation_url = get_bloginfo('siteurl') . '/confirm-reservation?token=' . $token;
            //stop mostra prezzo per ora..
            echo '<div id="success_page" class="alert alert-warning"><h4><i class="fa fa-bolt"></i> ' . __('Secure instant booking', 'bookingwp') . '</h4></div>';
            echo '<h5>' . __('Price for your reservation is &euro;', 'bookingwp') . ' <b>' . $price . '</b></h5><br />';
            echo __('You can confirm now your reservation by clicking this link and leave your credit card as warranty or paying the entire fee of your booking with Paypal and instantly book the room!', 'bookingwp') . '<br /><hr />';
            echo '<a href="' . $confirmation_url . '" class="btn btn-success btn-block">Confirm reservation</a></p>';
        } else {
            echo '<div id="success_page" class="alert alert-success"><p>' . __('Your reservation has been submitted to us and well contact you as quickly as possible to complete your booking. Thank you', 'bookingwp') . '</p></div>';
        }
        exit;
    } else {
        echo 'ERROR!';
    }
}