<?php $__env->startSection('css_page_level'); ?>
<link href="<?php echo e(asset('assets/global/plugins/jquery-fancybox/jquery.fancybox.css')); ?>" rel="stylesheet" type="text/css" media="screen"/>
<style type="text/css">
	#myDiv {
		overflow: hidden;
		width: 60%;
		margin: 0px auto;
	}
	#myDiv img {
		height: 200px;
	}
	p{
		font-size: 18px;
		color: inherit;
	}
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-content'); ?>
            <div class="wrap-fluid" id="paper-bg">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box">
                            <div class="box-header">
                                <div class="pull-right box-tools">
                                    <a href="<?php echo e(route('website::sale')); ?>">
                                    <span class="box-btn"><i class="fa fa-times"></i>
                                    </span>
                                    </a>
                                </div>
                                <h3 class="box-title"><i class="fontello-doc"></i>
                                    <span>週邊商家-<?php echo e($sale->title); ?></span>
                                </h3>
                            </div>
                            <div class="box-body">
								<div style="font-weight:bold;">
  								    <span style="float:right; font-weight:normal;">編號：<?php echo e($sale->id); ?></span>
 								</div>
                                <hr>
						
						<table class="table table-striped table-bordered" style="width:60%;" align="center">
							<tbody>
								<tr>
									<td colspan="2">
										<center>
											<?php if($sale->cover_img != ''): ?>
												<img src="<?php echo e($sale->cover_img); ?>" style="padding:3px; background-color:#fff; border:1px solid #d9d9d9;" width="100%" height="90%">
											<?php else: ?>
												<img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff; border:1px solid #d9d9d9;" width="100%" height="90%">
											<?php endif; ?>
										</center>
									</td>
								</tr>
								<?php if($sale->store_name != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>店家名稱：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->store_name); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->sale != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>特惠優惠：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->sale); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->address != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>店家地址：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->address); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->web_map != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>網路地圖：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->web_map); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->tel != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>連絡電話：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->tel); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->location != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>所屬縣市：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->location); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->goods != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>推薦商品：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->goods); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->web != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>官方網站：</strong></h4>
									</td>
									<td>
										<h4><a href="<?php echo e($sale->web); ?>"><?php echo e($sale->web); ?></a></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->time_start != '0000-00-00 00:00:00' || $sale->time_end != '0000-00-00 00:00:00'): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>限時期限：</strong></h4>
									</td>
									<td>
										<?php if($sale->time_start != '0000-00-00 00:00:00' and $sale->time_end == '0000-00-00 00:00:00'): ?>
											<h4>從&nbsp;<?php echo e($sale->time_start); ?>&nbsp;起</h4>
										<?php elseif($sale->time_end != '0000-00-00 00:00:00' and $sale->time_start == '0000-00-00 00:00:00'): ?>
											<h4>至&nbsp;<?php echo e($sale->time_end); ?>&nbsp;止</h4>
										<?php else: ?>
										<h4>從&nbsp;<?php echo e($sale->time_start); ?>&nbsp;起<br>至&nbsp;<?php echo e($sale->time_end); ?>&nbsp;止</h4>
										<?php endif; ?>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->opening != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>營業時間：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->opening); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->tag != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>分類標籤：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->tag); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->bus_area != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>營業項目：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->bus_area); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->safe_note != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>安全事項：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->safe_note); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->info != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>交通資訊：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($sale->info); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->file != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>下載附件：</strong></h4>
									</td>
									<td>
										<h4><a href="<?php echo e($sale->file); ?>"><?php echo e($original_filename); ?></a></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($sale->content != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>優惠簡介：</strong></h4>
									</td>
									<td>
										<?=$sale->content;?>
									</td>
								</tr>
								<?php endif; ?>
							</tbody>
						</table>

									<!--  相簿跑馬燈  -->
										<div id="myDiv" class="panel panel-default">
											<table>
												<tr>
													<td id="pic1">
											<table>
												<tr>
													<td>
														<?php if($sale->image1 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image1); ?>" title=""><img src="<?php echo e($sale->image1); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image1); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($sale->image2 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image2); ?>" title=""><img src="<?php echo e($sale->image2); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image2); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($sale->image3 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image3); ?>" title=""><img src="<?php echo e($sale->image3); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image3); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($sale->image4 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image4); ?>" title=""><img src="<?php echo e($sale->image4); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image4); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($sale->image5 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image5); ?>" title=""><img src="<?php echo e($sale->image5); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($sale->image5); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
												</tr>
											</table>
													</td>
													<td id="pic2"></td>
												</tr>
											</table>
										</div>
									<!--  相簿跑馬燈  -->
						
						<table class="table table-striped table-bordered" style="width:60%;" align="center">
							<tbody>
								<tr>
									<td>
										<h4><strong><center>Google Map</center></strong></h4></td>
								</tr>	
								<tr>
									<td><center><div style="border:1px solid #dcdcde; margin-top:10px; width:100%;height:400px;" id="map_canvas"></div></center>
									</td>
								</tr>
							</tbody>
						</table>
						
                        </div>
                    </div>
                            <div class="btn-group" role="group">
                                <a href="../sale" class="btn btn-primary">回上頁</a>
                            </div>
                    </div>
                </div>
            </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('plugins_page_level'); ?>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/jquery-fancybox/jquery.fancybox.pack.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js_page_level'); ?>
<script type="text/javascript">
	//變數Speed為設定捲軸的速度用 越小越快
	var Speed=20;
	//接受setInterval所回傳的值
	var timer;
	//取得myDiv的參考用的變數
	var myDiv = document.getElementById("myDiv");
	//取得pic2的參考用的變數
	var pic2= document.getElementById("pic2");
	//讓pic2的innerHTML等於pic1的innerHTML
	pic2.innerHTML=document.getElementById("pic1").innerHTML;
	//用來捲動myDiv捲軸用的主程式
	function picMarquee(){
		//若pic2的寬小於myDiv的scrollLeft，表示捲軸已經過了第一行
		//所以讓Div的scrollLeft再回到原來的位置；反之 則繼續往右跑
		if(pic2.offsetWidth - myDiv.scrollLeft <= 0){
			myDiv.scrollLeft = 0;
		}else{
			myDiv.scrollLeft++;
		}
	}
	//每Speed毫秒就執行一次pciMarquee()
	timer=setInterval(picMarquee,Speed);
	//當滑鼠在myDiv上時 就停止捲動
	myDiv.onmouseover=function(){
		clearInterval(timer);
	}
	//當滑鼠離開myDiv上時 就繼續往右捲動
	myDiv.onmouseout=function(){
		timer=setInterval(picMarquee,Speed);
	}
</script>


</script><script src="http://ditu.google.com/maps?file=api&amp;v=2.x&amp;key=AIzaSyBwO048p23eWOsmHbPU4H0uUEIm2TEXaCU" type="text/javascript"></script>
<script type="text/javascript">
	var cm_baseIcon = new GIcon();
	cm_baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	cm_baseIcon.iconSize = new GSize(34, 34);
	cm_baseIcon.shadowSize = new GSize(37, 34);
	cm_baseIcon.iconAnchor = new GPoint(9, 34);
	cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
	cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);
 
    var map = null;
    var geocoder = null;
 
    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
		map.setMapType(G_NORMAL_MAP);
    	map.addControl(new GSmallZoomControl());
    	map.addControl(new GMenuMapTypeControl());
		
        map.setCenter(new GLatLng(121.6,24.9), 15);
        geocoder = new GClientGeocoder();
      }
    }
 
    function showAddress(address) {
		var markerOpts = {};
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert("很抱歉！"+"您輸入的「"+address+"」這個位置無法成功定位！");
            } else {
				/*var nIcon = new GIcon(cm_baseIcon);
				nIcon.image ="images/home.png";
				markerOpts.icon = nIcon;*/
				markerOpts.title=address;
				
              map.setCenter(point);
              var marker = new GMarker(point,markerOpts);
			  marker.openInfoWindowHtml("<strong><?=mb_substr($sale->title,0,8,"utf-8")?>...</strong><br />"+address);
			  GEvent.addListener(marker, "click", function() {
							   marker.openInfoWindowHtml("<strong><?=mb_substr($sale->title,0,8,"utf-8")?></strong>...<br />"+address);
							  });
              map.addOverlay(marker);

              
            }
          }
        );
      }
    }
		window.onload=function(){
		   initialize();
		   showAddress("<?=$sale->map ?>");
		   }

</script>
<?php $__env->stopSection(); ?>


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