Files
anpdf/app/views/checkout.phtml

105 lines
4.8 KiB
PHTML
Raw Normal View History

2021-06-21 17:55:53 +03:00
<script>
2021-06-21 22:31:49 +03:00
var product_price = <?=$price_id['offline_price']?>;
2021-06-21 17:55:53 +03:00
2021-06-19 23:26:37 +03:00
2021-06-21 17:55:53 +03:00
function devilery_check(myRadio){
var itog = product_price;
var itog_el = document.getElementById("span_itog");
if (myRadio.value == 2){
itog = product_price;
2021-07-06 20:30:30 +03:00
document.getElementById("form_adress").style.display='none';
document.getElementById("form_samo").style.display='block';
2021-06-21 17:55:53 +03:00
}
2021-06-21 22:31:49 +03:00
else if(myRadio.value == 3){
2021-06-21 17:55:53 +03:00
itog = product_price + 300;
2021-07-06 20:30:30 +03:00
document.getElementById("form_adress").style.display='block';
document.getElementById("form_samo").style.display='none';
2021-06-21 17:55:53 +03:00
}
itog_el.innerHTML = itog + ' руб.';
2021-06-19 23:26:37 +03:00
2021-06-21 17:55:53 +03:00
}
</script>
2021-06-19 23:26:37 +03:00
<form id="clientform" class="clientform" action="<?=$submit_link?>" method="POST">
2021-06-21 17:55:53 +03:00
<?if (isset($errors)):?>
<div id="errors">
<?foreach($errors as $err):?>
<p style="color: red;"><?=$err?></p>
<?endforeach?>
</div>
<?endif?>
2021-06-19 23:26:37 +03:00
2021-07-06 20:30:30 +03:00
<h1 style="text-align:left;"><label for="clientmail">Ваш электронный адрес*:</label></h1>
<p><em>*Куда придет информация о заказе</em></p>
2021-06-21 17:55:53 +03:00
2021-07-06 20:30:30 +03:00
<p><input style="border: solid 1px #ccc;border-radius:3px;" type="email" id="clientemail" name="clientmail" value="<?=post_value("clientmail")?>"></p>
2021-06-21 17:55:53 +03:00
<?if($delivery_id > 1):?>
2021-07-06 20:30:30 +03:00
<p style="font-weight: bold;font-size: 22px;"><label for="buy_adress">Ваше имя:</label><br></p>
<p><input id="buy_name" name="buy_name" value="<?=post_value("buy_name")?>" type="text"></p>
2021-06-21 17:55:53 +03:00
2021-07-06 20:30:30 +03:00
<p style="font-weight: bold;font-size: 22px;"><label for="buy_tel">Телефон для связи*:</label></p>
<p><em>*Для подтверждения заказа</em></p>
<p><input id="buy_tel" name="buy_tel" value="<?=post_value("buy_tel")?>" type="text"></textarea></p>
2021-06-21 17:55:53 +03:00
2021-07-06 20:30:30 +03:00
<p style="font-weight: bold;font-size: 22px;"><label for="devilery_id">Доставка:</label></p>
2021-06-21 17:55:53 +03:00
<?foreach($delivery as $ditem):?>
<?$dd++;
$checked = ($ditem['delivery_id'] == $delivery_id) ? ' checked': '';?>
<p><input name="delivery_id" type="radio" id="devilery_id<?=$dd?>" onclick="devilery_check(this);" value="<?=$ditem['delivery_id']?>"<?=$checked?>>
<?=$ditem['delivery']?>
<?if ($ditem['delivery_price'] > 0):?>
+ <?=$ditem['delivery_price']?> руб.
<?endif?>
</p>
<?endforeach?>
2021-07-06 20:30:30 +03:00
<div id="form_samo" class="adress_box" style="display: <?= ($delivery_id == 2) ? 'block' : 'none' ?>;">
<p style="margin:0px;">Адрес:</p>
2021-06-21 17:55:53 +03:00
<p>Москва, Авиационный переулок, д. 4А</p>
</div>
2021-07-06 20:30:30 +03:00
<div id="form_adress" class="adress_box" style="display: <?= ($delivery_id == 3 or $delivery_id == 4) ? 'block' : 'none' ?>;">
<p style="margin:0px;"><label for="buy_adress">Адрес:</label></p>
<p><textarea id="buy_adress" style="width:100%;height:70px;font-size:15px;" name="buy_adress" placeholder="Адрес в свободной форме" value="<?=post_value("buy_adress")?>"></textarea></p>
2021-06-21 17:55:53 +03:00
</div>
<div id="form_pay">
2021-07-06 20:30:30 +03:00
<p style="font-weight: bold;font-size: 22px;"><label for="buy_adress">Оплата:</label></p>
2021-06-21 17:55:53 +03:00
<?foreach($pay_ids as $pkey=>$pitem):?>
<?$p++;
$pchecked = ($pkey == $pay_id) ? ' checked': '';?>
<p><input name="pay_id" type="radio" value="<?=$pkey?>" id="pay_id<?=$p?>" <?=$pchecked?>><?=$pitem?></p>
<?endforeach?>
</div>
<div id="form_itog">
<strong>Общая сумма:</strong> <span id="span_itog"><?=$price?> руб.</span></p>
</div>
<?endif?>
<p><label>Нажимая кнопку «Купить», я соглашаюсь <a href="https://argumenti.ru/subscribe_condition">с условиями получения услуги</a></label></p>
2021-07-06 20:30:30 +03:00
<p><input style="background: #555555;color: white;width: 30%;cursor: pointer;padding: 0;font-weight: 700;font-size: 15px;border-radius: 3px;border: 0;line-height: 0;display: block;outline: none;height: 35px;" type="submit" id="submit" value="Купить"></p>
2021-06-19 23:26:37 +03:00
</form>