<?php require_once("header.php");?>

			<!-- page template area start -->
			<section id="about">
				<div class="container mt-10 pb-10 pt-0">
					<div class="row">
						<div class="col-md-7">
						    <h1 class="title mt-5 mb-10">Payment Details</h1>
							<form name="cardpayment" id="payment-form" class="" action="stripe_payment.php" method="post">
							<div class="row">
								<div class="col-sm-12">
									<div class="form-group">
										<input name="holdername" id="holdername" class="form-control" type="text" placeholder="Card Holder Name *">
									</div>
								</div>
								<div class="col-sm-12">
									<div class="form-group">
										<input name="email" id="email" class="form-control" type="text" placeholder="Email Address *">
									</div>
								</div>
							</div>
							<div class="form-group">
								<p>Card Number *</p>
								<input type="text" name="card_number" id="card_number" class="form-control" maxlength="16" data-stripe="number">
							</div>
							<div class="form-group">
								<div class="row">
									<div class="col-md-4">
										<p>Expiry Month *</p>
										<select name="card_exp_month" id="card_exp_month" class="form-control" data-stripe="exp_month">
                                            <option value="">Month</option>
                                            <option value="01">01</option>
                                            <option value="02">02</option>
                                            <option value="03">03</option>
                                            <option value="04">04</option>
                                            <option value="05">05</option>
                                            <option value="06">06</option>
                                            <option value="07">07</option>
                                            <option value="08">08</option>
                                            <option value="09">09</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
									</div>
									<div class="col-md-4">
										<p>Expiry Year *</p>
										<select name="card_exp_year" id="card_exp_year" class="form-control" data-stripe="exp_year">
                                            <option value="">Year</option>
                                            <option value="24">2024</option>
                                            <option value="25">2025</option>
                                            <option value="26">2026</option>
                                            <option value="27">2027</option>
                                            <option value="28">2028</option>
                                            <option value="29">2029</option>
                                            <option value="30">2030</option>
                                            <option value="31">2031</option>
                                            <option value="32">2032</option>
                                            <option value="33">2033</option>
                                            <option value="34">2034</option>
                                            <option value="35">2035</option>
                                        </select>
									</div>
									<div class="col-md-4">
										<p>CVC *</p>
										<input type="password" class="form-control" name="card_cvc" autocomplete="cc-csc" id="card_cvc" />
									</div>
								</div>
							</div>
                            <div class="row">
    							<div class="col-sm-12">
        							<div class="form-group">
        								<button type="submit" class="btn btn-flat btn-theme-colored border-left-theme-color-2-4px" name="payNow" id="payBtn">Pay Now</button>
        								<button type="reset" class="btn btn-flat btn-theme-colored2 border-left-theme-color-2-4px" onclick="window.location.href='ack.php'">Back</button>
        							</div>
        						</div>
        					</div>
						</form>
						</div>
    					<div class="col-md-5">
					        <div class="row">
					        <?php
							$sum_item = mysqli_fetch_array(mysqli_query($connection,"SELECT SUM(`quantity`) as `qtyy` FROM `og_temp_cart` WHERE `unique_id` = '".$session_id."'"));
							$grands_item = $sum_item['qtyy'];
							if($grands_item!="")
							{
								$grands_item = $grands_item;
							}
							else
							{
								$grands_item = 0;
							}
							
							$sum_total = mysqli_fetch_array(mysqli_query($connection,"SELECT SUM(`subtotal`) as `stot` FROM `og_temp_cart` WHERE `unique_id` = '".$session_id."'"));
							$total_price = $sum_total['stot'];

							$delivery_charge_display = $shipping_charge;
							
							$grand_total = $total_price+$delivery_charge_display;
							?>
							    <div class="col-xs-12 col-sm-12 col-md-12">
								    <div class="media-body" style="border:1px solid #ddd; padding:5px; background:#fff;">
									<h2 style="margin:5px;">Cart Summary</h2>
									<table width="100%" border="0" cellspacing="2" cellpadding="2">
										<tr>
											<td style="margin:5px; padding:5px;">Total Quantity : <?php echo $grands_item;?></td>
										</tr>
										<tr>
											<td style="margin:5px; padding:5px;">Total Amount : &pound;<?php echo $total_price;?></td>
										</tr>
										<tr>
											<td style="margin:5px; padding:5px;">Shipping Charge : &pound;<?php echo $delivery_charge_display;?></td>
										</tr>
										<tr>
											<td style="margin:5px; padding:5px;"><strong>Grand Total : &pound;<?php echo number_format($grand_total,2);?></strong></td>
										</tr>
									</table>
								    </div>
							    </div>
						    </div>
    					</div>
    				</div>
				</div>
			</section>
			<!-- page template area end -->

<?php require_once("footer.php");?>