<?php $__env->startSection('css_page_level'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-content'); ?>
            <!-- CONTENT -->
            <div class="wrap-fluid" id="paper-bg">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box">
                            <div class="box-header">
                                <!-- tools box -->
                                <div class="pull-right box-tools">
                                </div>
                                <h3 class="box-title"><i class="fontello-doc"></i>
                                    <span>週邊商家</span>
                                </h3>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
								<!--尚未做查詢功能 by Ting
                                    <table class="table table-hover">
                                     <tbody>
										<form id="form1" name="form1" method="get" action="">
											<tr>
											     <td style="width:5%"><h4><div class="label label-info">優惠&nbsp;Search</div><h4></td>
											     <td style="width:85%"><input name="key" type="text" id="key" class="form-control" value="" /></td>
												 <td style="width:10%"><input type="submit" name="query2" class="btn bg-navy" value="查詢" /></td>
											</tr>
										</form>
									</table>
							            
										<form id="form2" name="form2" method="get" action="">
											<table class="table table-hover">
										     <tr>
												 <td style="width:5%"><h4><div class="label label-info">優惠&nbsp;Search</div><h4></td>
											   	 <td style="width:8%">&nbsp;開始時間：
												     <td style="width:27%"><input name="img_date_s" type="text" id="img_date_s" value="" class="form-control" onFocus="WdatePicker()"/></td>
													 <td style="width:1%">至</td>
													 <td style="width:27%"><input name="img_date_e" type="text" id="img_date_e" value="" class="form-control" onFocus="WdatePicker()"/></td>
													 <td style="width:22%" id="typeList"><input type="hidden" name="img_type" id="img_type" />
												         <h4><span class="label bg-yellow" onclick="setType('食',this)" style="cursor:pointer" />食</span>
												         <span class="label bg-yellow" onclick="setType('衣',this)" style="cursor:pointer" />衣</span>
												         <span class="label bg-yellow" onclick="setType('住',this)" style="cursor:pointer" />住</span>
												         <span class="label bg-yellow" onclick="setType('行',this)" style="cursor:pointer" />行</span>
												         <span class="label bg-yellow" onclick="setType('育',this)" style="cursor:pointer" />育</span>
												         <span class="label bg-yellow" onclick="setType('樂',this)" style="cursor:pointer" />樂</span><h4>
												     </td>
												<td style="width:30%"><input type="submit" name="query" class="btn bg-navy" value="查詢" /></td>
											 </tr>
											</table>
										</form>
										-->
										
							<div class="box-body">
                                <div class="table-responsive">
                                    <table class="table table-striped table-hover">
                                        <tbody>
                                            <?php foreach($sales as $one): ?>
                                            <tr>
                                                <td style="width:30%;">
													<?php if($one->cover_img != ''): ?>
														<a href="<?php echo e(route('website::sale_view',['id'=> $one->id])); ?>"><img alt="" src="<?php echo e($one->cover_img); ?>" width="100%"></a>
													<?php else: ?>
														<a href="<?php echo e(route('website::sale_view',['id'=> $one->id])); ?>"><img alt="" src="http://placehold.it/320x200" width="100%"></a>
													<?php endif; ?>
                                                </td>
                                                <td>
                                                    <p>
                                                        <strong style="font-size:20px;"><a href="<?php echo e(route('website::sale_view',['id'=> $one->id])); ?>"><?php echo e($one->title); ?></a></strong>
                                                        <p style="font-size:15px;">特惠優惠：<?php echo e($one->sale); ?></p>
                                                        <p style="font-size:15px;">簡介：<?php echo e(str_limit( strip_tags($one->content) , 30)); ?></p>
                                                    </p>
                                                </td>
                                                <td>
                                                    <div class="pull-right" width="20%" style="white-space: nowrap;">
                                                        <small class="pull-right"><?php echo e($one->created_at); ?>

                                                        </small>
                                                    </div>
                                                </td>
                                            </tr>

                                            <?php endforeach; ?>
                                            <?php if($sales->count() == 0): ?>
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <div class="alert alert-warning" style="margin:20px;">
                                                        <button data-dismiss="alert" class="close" type="button">×</button>
                                                        <span class="entypo-cancel-circled"></span>
                                                        <strong>很抱歉!</strong>&nbsp;&nbsp;目前尚未有週邊商家。
                                                    </div>
                                                </div>
                                            </div>
                                            <?php endif; ?>
                                        </tbody>
                                    </table>
                                    <?php echo $sales->render(); ?>

                                </div>
									
	<script>
		function setType(text,obj){
			$("#img_type").val(text);
			$(obj).toggleClass("bg-maroon");
		}
	</script>
    
                                <!-- /.box-body -->
                            </div>
                            <!-- /.box-body -->
                        <!-- /.box -->
                    </div>
                </div>
            </div>
            <!-- #/paper bg -->
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.front', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>