{% extends 'default_frame.twig' %}
{% set body_class = 'front_page' %}
{% block stylesheet %}
<style>
input[type='date'],
input[type='datetime'],
input[type='datetime-local'],
input[type='month'],
input[type='time'],
input[type='week'] {
&::-webkit-inner-spin-button {
display: none;
}
}
::-webkit-datetime-edit-year-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field {
&:after {
content: "";
}
&:not([aria-valuenow]) {
color: transparent;
}
}
::-webkit-datetime-edit-text {
color: darkgray;
}
::-webkit-clear-button {
margin-left: 0;
margin-right: 5px;
}
::-webkit-calendar-picker-indicator {
color: transparent;
background: url("https://www.globaladvancedcomm.com/img/ico_calendar.png") no-repeat;
background-size: 30px;
padding: 10px;
}
</style>
{% endblock %}
{% block javascript %}
<script>
function CancelAllItem() {
result_inq = confirm("Clear shopping cart?");
if (result_inq == true) {
$.post('{{ url("homepage") }}', 'mode=set_cancel')
.done(function (data) {
console.log(data.form);
})
}
}
function getTotalPrice() {
var order_plan = $('input[name="order_plan"]:checked').val();
if (order_plan == null) {
return;
}
switch (order_plan) {
case '1':
case '208':
case '209':
case '210':
case '867':
case '868':
case '872':
product_code = "Basic";
break;
case '2':
product_code = "Premium";
break;
case '205':
case '206':
case '207':
product_code = "SIM";
break;
case '4':
product_code = "5G";
break;
default:
product_code = "super";
}
$.ajax({
url: "{{ path('getTotal') }}",
type: 'POST',
dataType: 'json',
data: {
product_code: product_code,
product_id: order_plan,
num: $('#num').val(),
insurance: $('#order_tappuri_0').prop('checked'),
charger: $('#order_tappuri_1').prop('checked'),
adapter: $('#order_tappuri_2').prop('checked'),
sparewifi: $('#order_tappuri_3').prop('checked'),
pocketalk: $('#order_tappuri_4').prop('checked'),
sparewifi3gb: $('#order_tappuri_5').prop('checked'),
},
success: function (data) {
var usd = data.usd;
$('#total').html(data.total.toLocaleString() + '<span class="txt">JPY</span><br><span class="txt">About</span><span class="txt2"> ' + usd.toFixed(2) + '</span><span class="txt">USD</span>');
},
error: function (xhr, status, error) {
// エラー時の処理
console.error(xhr.responseText);
}
});
}
</script>
<script>
$(document).ready(function () {
var min = new Date();
min.setDate(min.getDate() + 2);
// URLを取得
let url = new URL(window.location.href);
// URLSearchParamsオブジェクトを取得
let params = url.searchParams;
switch (params.get('plan')) {
case 'premium':
$('input[name=order_plan]:eq(0)').prop('checked', true);
break;
case 'super':
$('input[name=order_plan]:eq(1)').prop('checked', true);
break;
case '5g':
$('input[name=order_plan]:eq(2)').prop('checked', true);
break;
case 'prepaid-10gb':
$('input[name=order_plan]:eq(3)').prop('checked', true);
break;
case 'prepaid-50gb':
$('input[name=order_plan]:eq(4)').prop('checked', true);
break;
case 'prepaid-100gb':
$('input[name=order_plan]:eq(5)').prop('checked', true);
break;
case 'longplan90days':
$('input[name=order_plan]:eq(6)').prop('checked', true);
break;
case 'longplan180days':
$('input[name=order_plan]:eq(7)').prop('checked', true);
break;
case 'longplan360days':
$('input[name=order_plan]:eq(8)').prop('checked', true);
break;
case 'longplan120days':
$('input[name=order_plan]:eq(9)').prop('checked', true);
break;
case 'longplan150days':
$('input[name=order_plan]:eq(10)').prop('checked', true);
break;
case 'longplan300days':
$('input[name=order_plan]:eq(11)').prop('checked', true);
break;
default:
$('input[name=order_plan]:eq(0)').prop('checked', true);
break;
}
$('#shipping_delivery_date, #end_date').datepicker({
autoUpdateInput: false,
minDate: '+1d',
showWeek: false,
dateFormat: "yy/mm/dd",
firstDay: 0, /* 週の開始を日曜にする */
isRTL: false,
showMonthAfterYear: true,
showButtonPanel: true,
onClose: function (date) {
const startDate = $(this).attr('id') === 'shipping_delivery_date'
? date
: $('#shipping_delivery_date').val();
const fromDate = $(this).attr('id') === 'end_date'
? date
: $('#end_date').val();
const num = getDiff(startDate, fromDate);
if (isNaN(num) || num < 1) {
$('#days').text('');
$('#num').val('');
return;
}
$('#days').text(' ' + num + 'days');
$('#num').val(num);
getTotalPrice();
},
});
$('#sim_start_date').datepicker({
autoUpdateInput: false,
minDate: '+3d',
showWeek: false,
dateFormat: "mm/dd/yy",
firstDay: 0, /* 週の開始を日曜にする */
isRTL: false,
showMonthAfterYear: true,
showButtonPanel: true
});
$('#sim_start_date').on('change', function (e) {
var startArray = $(this).val().split('/');
var start_dt = new Date(startArray[2], startArray[0] - 1, startArray[1], 0, 0, 0);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var start_date = yyyy + '/' + mm + '/' + dd;
$('#shipping_delivery_date').val(start_date);
switch ($('input[name=order_plan]:checked').val()) {
case '208': start_dt.setMonth(start_dt.getMonth() + 3);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
case '209': start_dt.setFullYear(start_dt.getMonth() + 6);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
case '210': start_dt.setFullYear(start_dt.getFullYear() + 1);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
case '867': start_dt.setMonth(start_dt.getMonth() + 4);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
case '868': start_dt.setFullYear(start_dt.getMonth() + 5);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
case '872': start_dt.setFullYear(start_dt.getMonth() + 10);
var yyyy = start_dt.getFullYear();
var mm = start_dt.getMonth() + 1;
var dd = start_dt.getDate();
if (mm < 10) {
mm = '0' + mm;
}
if (dd < 10) {
dd = '0' + dd;
}
var end_date = yyyy + '/' + mm + '/' + dd;
$('#end_date').val(end_date);
break;
default:
$('#end_date').val('3000/01/01');
}
});
function getDiff(date1Str, date2Str) {
var date1 = new Date(date1Str);
var date2 = new Date(date2Str);
// getTimeメソッドで経過ミリ秒を取得し、2つの日付の差を求める
var msDiff = date2.getTime() - date1.getTime();
// 求めた差分(ミリ秒)を日付へ変換します(経過ミリ秒÷(1000ミリ秒×60秒×60分×24時間)。端数切り捨て)
var daysDiff = Math.floor(msDiff / (1000 * 60 * 60 * 24));
// 差分へ1日分加算して返却します
return ++ daysDiff;
}
$('input[name="order_plan"]').on('change', function (e) {
displayInitialize();
getTotalPrice();
});
$('#order_tappuri_0').on('click', function (e) {
getTotalPrice();
});
$('#order_tappuri_1').on('click', function (e) {
getTotalPrice();
});
$('#order_tappuri_2').on('click', function (e) {
getTotalPrice();
});
$('#order_tappuri_3').on('click', function (e) {
getTotalPrice();
});
$('#order_tappuri_4').on('click', function (e) {
getTotalPrice();
});
$('#order_tappuri_5').on('click', function (e) {
getTotalPrice();
});
let oldSimStartDate = '';
let oldShippingDeliveryDate = '';
let oldEndDate = '';
function displayInitialize() {
if ($('#sim_start_date').is(':visible')) {
oldSimStartDate = $('#sim_start_date').val();
}
if ($('#shipping_delivery_date').is(':visible')) {
oldShippingDeliveryDate = $('#shipping_delivery_date').val();
}
if ($('#end_date').is(':visible')) {
oldEndDate = $('#end_date').val();
}
switch ($('input[name="order_plan"]:checked').val()) {
case '205':
case '206':
case '207':
$('#period').html('❷ Delivery date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('');
break;
case '208':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('90');
break;
case '209':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('180');
break;
case '210':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('360');
break;
case '867':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('120');
break;
case '868':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('150');
break;
case '872':
$('#period').html('❷ Start date select');
$('#sim_start_date').show().val(oldSimStartDate);
$('#rental_period').hide();
$('#shipping_delivery_date').val('');
$('#end_date').val('');
$('#days').text('');
$('#num').val('300');
break;
default:
$('#period').html('❷ Rental period select');
$('#rental_period').show();
$('#shipping_delivery_date').val(oldShippingDeliveryDate);
$('#end_date').val(oldEndDate);
$('#sim_start_date').hide();
const num = getDiff(oldShippingDeliveryDate, oldEndDate);
if (!isNaN(num) && num > 0) {
$('#days').text(' ' + num + 'days');
$('#num').val(num);
}
}
getTotalPrice();
}
$('form').on('submit', function () {
$('#sim_start_date').remove();
return true;
});
displayInitialize();
})
</script>
{% endblock %}
{% block main %}
<div class="orderpage">
<div class="orderpage__h1">
Order your pocket Wi-Fi now
</div>
<div class="">
<form method="post" action="{{ url('homepage') }}">
{{ form_widget(form._token) }}
{{ form_widget(form.mode) }}
</div>
<!--<div class="orderpage__h2">New Order</div>2024.0117-->
<!--ベネフィット-->
<div class="orderpage__box">
<div class="orderpage__h2 orderpage__h2--blue">Benefit</div>
<div align="center"><img src="https://globaladvancedcomm.com/wp-content/uploads/2024/02/2024.0206-gac.jpg" alt="wifi-rental benefit" width="100%" height="100%"></div>
</div>
<div class="orderpage__h3">
<strong>Please select</strong><br> ❶WiFi Plan & ❷Rental period <br>→<strong>Prices are displayed.</strong>
</div>
<div class="orderpage__h3 orderpage__h3--green">
<a href="https://www.globaladvancedcomm.com/rental-agreement/" target="_blank"> <i class="fas fa-external-link-alt"></i> Please check "Rental Agreement" in advance.</a>
</div>
<!--①WiFi Plan select-->
<div class="orderpage__box">
<div class="orderpage__h2 orderpage__h2--blue">❶ WiFi Plan select</div>
<!--Wi-Fiプラン-->
<div id="order_plan">
<div class="radio">
<input type="radio" id="order_plan_2" name="order_plan" required="required" value="2">
<label class="required">
Standard Plan
<div><img src="https://www.globaladvancedcomm.com/images/orderpage/wifi-3gb-type.png"></div>
</label>
<a href="#period">Rental period select↓</a>
</div>
<div class="radio">
<input type="radio" id="order_plan_1" name="order_plan" required="required" value="3">
<label class="required">
Unlimited Plan
<div><img src="https://www.globaladvancedcomm.com/images/orderpage/wifi-unlimited-type.png"></div>
</label>
<a href="#period">Rental period select↓</a>
</div>
<div class="radio">
<input type="radio" id="order_plan_0" name="order_plan" required="required" value="4">
<label class="required">
5G Unlimited Plan
<div><img src="https://www.globaladvancedcomm.com/images/orderpage/wifi-5g-unlimited-type.png"></div>
</label>
<a href="#period">Rental period select↓</a>
</div>
<!--ロングプラン-->
<details>
<summary><div class="orderpage__h4"><font color="#224f86"><strong>▶︎Unlimited Long Plan 90days~</strong></font></div></summary>
<div class="radio"></div><!--ダミー-->
<div class="radio"></div><!-ダミー-->
<div class="radio">
<input type="radio" id="order_plan_6" name="order_plan" required="required" value="208">
<label for="order_plan_6">[90days]</label>
</div>
<div class="radio">
<input type="radio" id="order_plan_9" name="order_plan" required="required" value="867">
<label for="order_plan_9">[120days]</label>
</div>
<div class="radio">
<input type="radio" id="order_plan_10" name="order_plan" required="required" value="868">
<label for="order_plan_10">[150days]</label>
</div>
<div class="radio">
<input type="radio" id="order_plan_7" name="order_plan" required="required" value="209">
<label for="order_plan_7">[180days]</label>
</div>
<div class="radio">
<input type="radio" id="order_plan_11" name="order_plan" required="required" value="872">
<label for="order_plan_11">[300days]</label>
</div>
<div class="radio">
<input type="radio" id="order_plan_8" name="order_plan" required="required" value="210">
<label for="order_plan_8">[360days]</label>
</div>
</details>
<!--SIMカードプラン-->
</div
</div>
</div>
<div class="orderpage__box">
<div class="orderpage__h2 orderpage__h2--blue" id="period"></div>
<div class="orderpage__date">
{% if SD_Flg=="2" %}
<p style="color:#FF0000;">Arrangements can be made the next day with the hotel only.<br>*Delivery to the hotel/home will be made <strong>around 12:00 pm </strong> on the first day of the rental.
{{ err.shipping_delivery_date }}
{{ err.end_date }}
</p>
<input type="text" id="sim_start_date" autocomplete="off" name="sim_start_date" class="form-control" placeholder="mm/dd/yyyy" size="30"/>
<div id="rental_period">
<input type="text" id="shipping_delivery_date" autocomplete="off" name="shipping_delivery_date" class="form-control" placeholder="yyyy/mm/dd"/>
〜
<input type="text" id="end_date" autocomplete="off" name="end_date" class="form-control" placeholder="yyyy/mm/dd" />
<span id="days"></span>
</div>
<input type="hidden" id="num" name="num"/>
{% else %}
<input type="hidden" id="shipping_delivery_date" name="shipping_delivery_date" required="required" value="{{ SD_Flg }}"><span id="days"></span>
<button onclick="CancelAllItem();" class="btn_can_set">Clear shopping cart</button>
{% endif %}
</div>
<div class="orderpage__calc">
<div class="orderpage__calc--h1">Total
<span id="total" class="total"></span>
</div>
</div>
<div class="orderpage__h3"><font color="#ff0000"><strong>Please read the following before ordering !</strong></font></div>
<ul>
<li class="orderpage__except orderpage__except--1">Please order at least 2 days prior to the rental start date for<font color="#ff0000"><strong>airport arrangement.</strong></font>.<br>
(<font color="#ff0000"><strong>[Next day delivery is available!]</strong></font>
If the delivery destination is a <font color="#ff0000"><strong>hotel</strong></font>, next-day arrangements are possible!)</li>
<li class="orderpage__except orderpage__except--2">We do not ship on Sundays and holidays; orders placed after 1:00 p.m. will be shipped on the next business day at the earliest.</li>
<li class="orderpage__except orderpage__except--3">If you would like to pick up from one of the following delivery locations, please place your order at least <font color="#ff0000"><strong>3 days before</strong></font> your rental start date.<br/><br/>
[Airport Pickup] : Fukuoka, Shin-Chitose<br/>
[Hotel or Residence] :Hokkaido, Okinawa, Kyushu (Fukukoka pref., Saga pref., Nagasaki pref., Oita pref., Kumamoto pref., Miyazaki pref. and Kagoshima pref.), Kagawa pref.,Kochi pref., Okayama pref., Ehime pref., Tokushima pref., Hiroshima pref., Shimane pref.,Tottori pref., Yamaguchi pref.
</li>
<li class="orderpage__except orderpage__except--4">For rentals
<font color="#ff0000"><strong>longer than 60 days</strong></font>, please contact us.</br><a href="mailto:info@globaladvancedcomm.com">info@globaladvancedcomm.com</a></li>
</ul>
</div>
<div class="orderpage__box">
<div class="orderpage__h2 orderpage__h2--blue">❸ Option</div>
<div class="orderpage__h3">
Please put a check mark.
</div>
<div id="order_tappuri">
<div class="checkbox">
<input type="checkbox" id="order_tappuri_4" name="order_tappuri[]" value="pocketalk" data-gtm-form-interact-field-id="4">
<label for="order_tappuri_4">
<div>[POCKETALK]<br><font color="#ff0000"><del>880JPY</del>→440JPY/day(inc.tax)<br>or max 8,800JPY for long rental (inc.tax)</font><br><img src="https://www.globaladvancedcomm.com/reservation_english/html/upload/save_image/pocketalk.png" width="58%" height="58%" ></div>
Translating both by voice and text with over 74 languages to choose from!<br>Enjoy your time in Japan by translating Japanese with your native language!
</label>
</div>
<div>
<p>How to use POCKETALK
<iframe width="360" height="200" src="https://www.youtube.com/embed/sh9DDzVnqCA?si=LzoW9xV29DrisKO4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe><br>
<div class="orderpage__h3">Merit/Differences from smartphone apps</div>
<font color="#ff0000">[Long battery life]</font><br>
Pocket Talk W boasts a long battery life. Under normal usage conditions, it can be used throughout the day, making it ideal for extended periods of time on the go.<br>
<br>
<font color="#ff0000">[Real-time voice translation]</font><br>
Pocket Talk W provides real-time voice translation. This feature allows dialogues to proceed without delay and enables smooth communication. It features less delay compared to interpreter applications.<br>
</p>
</div>
<div class="checkbox">
<input type="checkbox" id="order_tappuri_1" name="order_tappuri[]" value="charger" data-gtm-form-interact-field-id="1">
<label for="order_tappuri_1">
<div>[Portable Charger]<br><font color="#ff0000">80JPY/day<br>or max 1,000JPY for long rental (inc.tax) </font><br><img src="https://globaladvancedcomm.com/gac_new/wp-content/uploads/images/mobile_battery.jpg" width="50%" height="50%" ></div>
Batteries Capacity : 10,000mAh<br>Output : USB&TypeC<br>Smartphones can be fully charged <br>more than twice!</label>
</div>
<div class="checkbox">
<input type="checkbox" id="order_tappuri_0" name="order_tappuri[]" value="insurance" data-gtm-form-interact-field-id="0">
<label for="order_tappuri_0">
<div>[Premium Insurance]<br><font color="#ff0000">110JPY/day<br>or max 10,000JPY for long rental (inc.tax)</font><br><img src="https://globaladvancedcomm.com/gac_new/wp-content/uploads/images/warranty.jpg" width="50%" height="50%" ></div>
Alternative equipment can be arranged immediately in case of trouble!<br>Same-day delivery is available in Tokyo's 23 wards if you contact us by 4:00 p.m!</label>
</div>
<div class="checkbox">
<input type="checkbox" id="order_tappuri_2" name="order_tappuri[]" value="393" data-gtm-form-interact-field-id="2">
<label for="order_tappuri_2">
<div>[Travel Adapter] <br><font color="#ff0000">500JPY(inc.tax)</font><br><img src="https://globaladvancedcomm.com/gac_new/wp-content/uploads/images/us-japan-trabel-adapter.jpg" width="50%" height="50%" ></div>
The adapter allows you to plug other electronics from your own country!<br><br></label>
</div>
<div class="checkbox">
<input type="checkbox" id="order_tappuri_5" name="order_tappuri[]" value="sparewifi3gb" data-gtm-form-interact-field-id="5">
<label for="order_tappuri_5">
<div>[Spare WiFi(3GB/day Type)]<br><font color="#ff0000">220JPY/day(inc.tax)</font><br><img src="https://www.globaladvancedcomm.com/reservation_english/html/upload/save_image/wifi-3gb-type.png" width="81%" height="81%" ></div>
Special price for Wi-Fi for standard plan!<br>Limited Time Campaign Option<br>Limited number of units per month<br><font color="#ff0000">21units</font></label>
</div>
</div>
<div class="grid-col2">
<div>
<div class="orderpage__h3">Premium Insurance</div>
<ul>
<li>The rental liability insurance will not be applicable without
<font color="#ff0000">a lost/theft police report.</font>
</li>
<li>For reparable breakdown or visible damage :
<strong>Free</strong>
</li>
<li>For non-repairable damage, water leakage :
<strong>30%</strong>
of the device (or accessory) price is charged to you (70% is paid by us)</li>
<li>For loss or theft :
<strong>30%</strong>
of the device (or accessory) price is charged to you (70% is paid by us)</li>
<li>
<font color="#ff0000">The rental liability insurance covers one rental device only. To get insurance for multiple devices, you will need to purchase one for each device.</font>
</li>
</ul>
</div>
<div>
<div class="orderpage__h3">Portable Charger</div>
<ul>
<li>Quick charging type – compact,
<strong>light and convenient for mobile use !</strong>
</li>
<li>You can go out without any worry about the remaining battery life of your Wi-Fi or mobile phone during your trip !<br>Price is
<font color="#ff0000">80JPY/day</font>
for rental no matter how long you rent.</li>
<li>The actual product may be slightly different from the picture due to availability.<br>Thank you for your understanding in advance.</li>
</ul>
</div>
</div>
<center>
<h6>To order more than 1 rental item, please specify the quantity on the next page(shopping cart).</h6>
</center>
<div id="list_box__button_menu" class="btn-default-original">
{{ form_widget(form.sel_order) }}
</div>
</form>
<form method="post" action="{{ url('homepage') }}" name="cancel">
{# 2つ目のフォームでは_tokenフィールドを出力しないようにします #}
<input type="hidden" name="_token" value="{{ csrf_token('cancel') }}">
<input type="hidden" id="mode" name="mode" value="set_cancel">
</form>
</div>
{% endblock %}