<?php $__env->startSection('styles'); ?>
	<link rel="stylesheet" href="<?php echo e(asset('/css/flags.css')); ?>">
	<link rel="stylesheet" href="<?php echo e(asset('/css/sweetalert.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('banner'); ?>
	<?php echo $__env->make('sections.banner-sm', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('contents'); ?>
	<section id="standard-content" class="event-details">
		<div class="container">

			<p id="breadcrumb">
			    <a href="<?php echo e(url('/page/shopping-cart')); ?>"><i class="fa fa-shopping-cart"></i></a>
			    <?php echo e($bread); ?>

			</p>

			<div class="container-wrapper">

				<?php if(session('payment_errors')): ?>
					<div class="alert alert-danger">
						<?php echo e(session('payment_errors')); ?>

					</div>
				<?php endif; ?>

				<?php if( $errors->count() > 0 ): ?>
				     <div class="alert alert-danger">
				     	<p>The following errors have occurred:</p>

				      	<ul>
				        	<?php foreach( $errors->all() as $message ): ?>
				          		<li><?php echo e($message); ?></li>
				        	<?php endforeach; ?>
				      	</ul>
				     </div>
			    <?php endif; ?>

				<?php echo Form::open(['id' => 'PayForm']); ?>

				<div class="col-md-4">
					<div class="event-contents well">
						<h1 class="amount">Total : &dollar; <span class="amount_val"><?php echo e(Cart::total()); ?></span></h1>
						<ul class="detail-list">
						</ul>
					</div>

					
					<div class="well">
						<h3>Product List</h3>
				
						<div class="list-group">
							<?php foreach(Cart::content() as $c): ?>
								<li class="list-group-item"><?php echo e($c->name); ?> (&dollar;<?php echo e($c->price); ?>/item)
									<span class="badge"><?php echo e($c->qty); ?></span>
								</li>
							<?php endforeach; ?>
						</div>
						<div class="clearfix"></div>
					</div>

					<div class="well">
						<h3 class="heading">Payment Details</h3>
						<div class="form-group">
							<div class="card-lists">
								<ul class="cards">
									<li data-type="paypal"><img src="<?php echo e(asset('/images/paypal.png')); ?>"></li>
									<li data-type="mastercard"><img src="<?php echo e(asset('/images/mastercard.png')); ?>"></li>
									<li data-type="visa"><img src="<?php echo e(asset('/images/visa.png')); ?>"></li>
								</ul>
							</div>
						</div>
						<div id="card-details" <?php if(session('cardtype') == ''): ?> hidden <?php endif; ?>>
							<h3 class="heading">Card Details</h3>
							<div class="form-group">
								<label class="control-label">Name on Card</label>
								<input name="name_on_card" type="text" class="form-control nameoncard cinput" value="<?php echo e(session('nameoncard')); ?>">
							</div>
							<div class="form-group">
								<label class="control-label">Card Number</label>
								<input name="card_number" type="text" class="form-control cardnumber cinput" id="card_number" value="<?php echo e(session('cardnumber')); ?>">
							</div>

							<div class="alert alert-danger" hidden id="expiryBox"></div>

							<div class="row">
								<div class="col-md-6">
									<div class="form-group">
										<label class="control-label">Expiry Date</label>
										<input name="expiry_date" type="text" class="form-control expirydate cinput" id="expiry_date" value="<?php echo e(session('expirydate')); ?>" placeholder="mm/yy">
									</div>
								</div>
								<div class="col-md-6">
									<div class="form-group">
										<label class="control-label">CCV</label>
										<input name="ccv" type="text" class="form-control ccv cinput" id="ccv" value="<?php echo e(session('ccv')); ?>">
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
					
					<div class="alert alert-danger error" hidden>
						<em>Select paymenet details above</em>
					</div>
						
						
				</div>
				<div class="col-md-8">
					<div class="col-md-6">

						<?php if(!Auth::user()): ?>
							<div class="well text-center">
								<a href="<?php echo e(url('/auth/login')); ?>" class="btn btn-default">Login</a>
								<br/>or<br/>
								<span>Manually enter your details below</span>
							</div>
						<?php endif; ?>

						<div class="well">
							<h3 class="heading">User Details</h3>
							<div class="form-group">
								<label class="control-label">Firstname</label>
								<input name="firstname" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->firstname)); ?><?php else: ?><?php echo e(session('firstname')); ?><?php endif; ?>">
							</div>
							<div class="form-group">
								<label class="control-label">Lastname</label>
								<input name="lastname" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->lastname)); ?><?php else: ?><?php echo e(session('lastname')); ?><?php endif; ?>">
							</div>
							<div class="form-group">
								<label class="control-label">Phone</label>
								<input name="mobile" type="text" class="form-control" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->phone)); ?><?php else: ?><?php echo e(session('mobile')); ?><?php endif; ?>">
							</div>
							<div class="form-group">
								<label class="control-label">Email</label>
								<input name="email" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->email)); ?><?php else: ?><?php echo e(session('email')); ?><?php endif; ?>">
							</div>
							
						</div>
							
					</div>
					<div class="col-md-6">
						<div class="well">
								<h3 class="heading">Delivery Details</h3>
								<div class="form-group">
									<label class="control-label">First Line Address</label>
									<input name="address1" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->email)); ?><?php else: ?><?php echo e(session('address1')); ?><?php endif; ?>">
								</div>
								<div class="form-group">
									<label class="control-label">Country</label>
									<div id="country"
										data-input-name="country"
										data-selected-country="US"
										data-btn-type="btn-block">
									</div>
								</div>
								<div class="form-group">
									<label class="control-label">City</label>
									<input name="city" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->city)); ?><?php else: ?><?php echo e(session('city')); ?><?php endif; ?>">
								</div>
								<div class="form-group">
									<label class="control-label">Postcode</label>
									<input name="postcode" type="text" class="form-control cinput" value="<?php if(Auth::user()): ?><?php echo e(ucfirst(Auth::user()->postcode)); ?><?php else: ?><?php echo e(session('postcode')); ?><?php endif; ?>">
								</div>
							</div>
						<button type="submit" class="btn btn-primary btn-block" id="proceedBtn">Proceed</button>
					</div>
					
				</div>
				
				<input name="card_type" value="<?php echo e(session('cardtype')); ?>" type="hidden">

				<?php echo Form::close(); ?>

				<div class="clearfix"></div>
			</div>
		</div>
	</section>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
	<script type="text/javascript" src="<?php echo e(asset('/js/sweetalert.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('/js/jquery.mask.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('/js/jquery.flagstrap.min.js')); ?>"></script>
	<script type="text/javascript" src="<?php echo e(asset('/js/min/checkout-min.js')); ?>"></script>

	<?php echo $__env->make('sweet::alert', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('masters.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>