<?
	$this->title = $this->restaurant->name;
	$this->titleicon = 'food';
	$this->titleLink = '/restaurants/'.$this->restaurant->id_restaurant;

	$this->title2 = 'Image';
	$this->title2icon = 'picture';
?>

<!-- restaurants page -->
<div class="container-fluid padded">
	<div class="row-fluid">
		<div class="box">

			<form id="restaurant-image" action="" method="post" enctype="multipart/form-data">
				<table class="admin-restaurant-pay-form">
					<tr>
						<td>
							<img src="<?=$this->restaurant->images->thumb?>?<?php echo date('YmdHis');?>" style="max-width: 600px;">
						</td>
					</tr>
					<tr>
						<td>
							<input type="file" name="image">
						</td>
					</tr>

					<tr>
						<td>
							<br />
							<button type="button" class="btn btn-blue admin-order-search restaurant-image-button"><i class="icon-upload-alt"></i>&nbsp;&nbsp;&nbsp; Upload </button>
						</td>
					</tr>
				</table>
			</form>
			</div>
		</div>

	</div>
</div>

<script>
	$(function() {
		$('.restaurant-image-button').click(function() {
			if( $('[name=image]').val() == '' ){
				alert( 'Please select an image.' );
				return;
			} else {
				var form = $(this).closest('form');
				form.get(0).submit();
			}

		});
	});
</script>

