{{HEAD}}
<div class="container">
	{{HEADER}}
	[[Shop?&get=`breadcrumbs`]]
	[!if?&is=`[*error*]:!=:` &then=`
		<div class="alert alert-danger alert-dismissable col-md-12">
			<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
			<strong>[*error*]</strong>
		</div>
	`!]
	<div class="row">
		<div class="col-md-6">
			<ul class="nav nav-tabs" id="myTab">
				[!if?&is=`[*u_internalKey*]:=:`&then=`
					<li class="active"><a href="#new-client" data-toggle="tab">New customer</a></li>
					<li><a href="#old-client" data-toggle="tab">Regular customer</a></li>
				`&else=`
					<li class="active"><a href="#new-client" data-toggle="tab">Regular customer</a></li>
				`!]
			</ul>
			
			<div class="tab-content">
				<div class="tab-pane active" id="new-client">
					<form action="" method="post">
						<table class="table">
							<tr>
								<th colspan="2">Contact info</th>
							</tr>
							<tr>
								<td>Your name</td>
								<td><input type="text" name="order[fullname]" value="[*u_fullname*]" class="form-control"></td>
							</tr>
							<tr>
								<td>Email <sup>*</sup></td>
								<td><input type="text" name="order[email]" value="[*u_email*]" class="form-control" required></td>
							</tr>
							<tr>
								<td>Phone <sup>*</sup></td>
								<td><input type="text" name="order[phone]" value="[*u_phone*]" class="form-control" required></td>
							</tr>
							<tr>
								<th colspan="2">Delivery</th>
							</tr>
							<tr>
								<td>Dlivery type</td>
								<td>
									<select name="order[delivery]" class="form-control" data-active="[*u_delivery*]">
										[[Shop?&get=`delivery_list`&tpl=`tpl_delivery`]]
									</select>
								</td>
							</tr>
							<tr class="hide newpost">
								<td>City</td>
								<td>
									<select name="order[addr][city]" id="newpost_city" class="form-control">
										[[Shop?&get=`newpost`&type=`city`&tpl=`tpl_option`]]
									</select>
								</td>
							</tr>
							<tr class="hide newpost">
								<td>Warehouse</td>
								<td>
									<select name="order[addr][warehouse]" id="newpost_warehouse" class="form-control">
									</select>
								</td>
							</tr>
							[!if?&is=`[*u_internalKey*]:!=:`&then=`
							<tr>
								<td>Delivery address</td>
								<td>
									<select name="order[addr]" class="form-control">
										[[Shop?&get=`newpost`&tpl=`tpl_user_addr_order`]]
									</select>
								</td>
							</tr>
							`&else=`
							<tr>
								<td>ZIP</td>
								<td><input type="text" name="order[addr][index]" value="" class="form-control"></td>
							</tr>
							<tr>
								<td>City</td>
								<td><input type="text" name="order[addr][city]" value="" class="form-control"></td>
							</tr>
							<tr>
								<td>Street</td>
								<td><input type="text" name="order[addr][ave]" value="" class="form-control"></td>
							</tr>
							<tr>
								<td>House</td>
								<td><input type="text" name="order[addr][house]" value="" class="form-control"></td>
							</tr>
							<tr>
								<td>Apartment</td>
								<td><input type="text" name="order[addr][room]" value="" class="form-control"></td>
							</tr>
							`!]
							<tr>
								<td>Order comment</td>
								<td>
									<textarea name="order[comment]" class="form-control"></textarea>
								</td>
							</tr>
							<tr>
								<td></td>
								<td><button class="btn btn-success btn-lg"><span class="glyphicon glyphicon-ok-sign"></span> Checkout</button></td>
							</tr>
						</table>
						
					</form>
				</div>
				[!if?&is=`[*u_internalKey*]:=:`&then=`
				<div class="tab-pane" id="old-client">
					<form action="" method="post">
						<table class="table table-condensed">
							<tr>
								<td>Email</td>
								<td><input type="text" name="auth[email]" id="" class="form-control"></td>
							</tr>
							<tr>
								<td>Password</td>
								<td><input type="password" name="auth[pass]" id="" class="form-control"></td>
							</tr>
							<tr>
								<td></td>
								<td>
									<button class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-share"></span> Sign in</button>
								</td>
							</tr>
						</table>
						<input type="hidden" name="auth[redirect]" value="[*id*]">
					</form>
				</div>
				`!]
			</div>
		</div>
		<div class="col-md-6 js_order_cart">
			<h4 class="text-muted pull-right">Ordered products</h4>
			<div class="clearfix"></div>
			[[Shop?&get=`cart`&tpl=`tpl_item_order`]]
			<hr>
			<h3 class="order_total text-muted">Delivery cost: <b><span class="js_delivery"></span> [(currency)]</b></h3>
			<h3 class="order_total text-primary">TOTAL: <b><span class="js_total"></span> [(currency)]</b></h3>
		</div>
	</div>
	
</div>
<script>
	$(document).ready(function(){
		calcOrder();
	})
</script>
{{FOOTER}}