hotel.html 8.06 KB
{template 'common/header'}
{template 'common'}
<div class="main">
	<ul class="nav nav-tabs">
		<li class="active"><a href="{php echo $this->createWebUrl('storemanage',array('op'=>'list'));}">店铺管理</a></li>
		<li><a href="{php echo $this->createWebUrl('storemanage',array('op'=>'edit'));}">添加店铺</a></li>
	</ul>
	<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="get" class="form-horizontal" role="form">
				<input type="hidden" name="c" value="site" />
				<input type="hidden" name="a" value="entry" />
				<input type="hidden" name="m" value="wn_storex" />
				<input type="hidden" name="do" value="storemanage" />
				<div class="form-group">
					<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">店铺</label>
					<div class="col-xs-12 col-sm-8 col-lg-9">
						<input class="form-control" name="keywords" id="" type="title" value="{$_GPC['title']}">
					</div>
					<div class=" col-xs-12 col-sm-2 col-lg-2">
						<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
						<button class="btn btn-default" name="export" value="export"><i class="fa fa-download"></i> 导出数据</button>
					</div>
				</div>
				<div class="form-group">
				</div>
			</form>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-body table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
			<tr><th class='with-checkbox' style='width:30px;'>
				<input type="checkbox" class="check_all" /></th>
				<th style="width:120px;">店铺名称</th>
				<th style="width:100px;">店铺类型</th>
				<th style="width:100px;">店铺排序</th>
				<th style='width:120px;'>电话</th>
				<th style='width:100px;'>状态</th>
				<th style="width:100px;">入口</th>
				<th style="width:550px;">操作</th>
			</tr>
			</thead>
			<tbody>
			{loop $list $item}
			<tr>  <td class="with-checkbox">
				<input type="checkbox" name="check" value="{$item['id']}"></td>
				<td>{$item['title']}</td>
				<td>
					{if $item['store_type']==1}
					<span>酒店</span>
					{else}
					<span>非酒店</span>
					{/if}
				</td>
				<td>{$item['displayorder']}</td>
				<td>{$item['phone']}</td>
				<td>
					{if $item['status']==1}
					<span class='label label-success'>显示</span>
					{else}
					<span class='label label-default'>隐藏</span>
					{/if}
				</td>
				<td>
					<a href="javascript:;" class="js-entry-modal" data-id="{$item['id']}" data-store_entry="{$item['store_entry']}" data-mc_entry="{$item['mc_entry']}">查看入口</a>
				</td>
				<td>
					{if $item['store_type'] == 1}
					<a href="{php echo $this->createWebUrl('room_status',array('hotelid'=>$item['id']))}" class="btn  btn-default btn-small" data-toggle="tooltip" data-placement="bottom" title="维护房量/房态">维护房量/房态</a>
					<a href="{php echo $this->createWebUrl('room_price',array('hotelid'=>$item['id']))}" class="btn  btn-default btn-small" data-toggle="tooltip" data-placement="bottom" title="维护房价">维护房价</a>
					<a href="{php echo $this->createWebUrl('goodsmanage',array('store_type'=>1))}" class="btn  btn-default btn-small" data-toggle="tooltip" data-placement="bottom"  title="房型管理">房型管理</a>
					{/if}
					<a href="{php echo $this->createWebUrl('order',array('store_type'=>$item['store_type']))}" class="btn  btn-default btn-small" data-toggle="tooltip" data-placement="bottom"  title="订单查看">订单查看</a>
					<a class="btn  btn-default btn-sm" rel="tooltip" href="{php echo $this->createWebUrl('storemanage',array('op'=>'edit','id'=>$item['id']))}" title="编辑" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-edit"></i></a>
					{if $item['status'] == 0}
					<a class="btn btn-default btn-sm" title="显示" href="#" onclick="drop_confirm('您确定要显示此酒店吗?', '{php echo $this->createWebUrl('storemanage',array('op'=>'status','status'=>1, 'id'=>$item['id']))}');" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-play"></i></a>
					{elseif $item['status'] == 1}
					<a class="btn btn-default btn-sm" title="隐藏" href="#" onclick="drop_confirm('您确定要隐藏此酒店吗?', '{php echo $this->createWebUrl('storemanage',array('op'=>'status','status'=>0, 'id'=>$item['id']))}');" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-stop"></i></a>
					{/if}
					<a class="btn btn-default" href="#" onclick="drop_confirm('您确定要删除店铺所有的信息吗?', '{php echo $this->createWebUrl('storemanage',array('op'=>'delete', 'id'=>$item['id']))}');" title="删除" data-toggle="tooltip" data-placement="bottom"><i class="fa fa-times"></i></a>
				</td>
			</tr>
			{/loop}
			<tr>
				<td colspan="8">
					<input type="button" class="btn btn-primary" name="deleteall" value="删除选择的" />
					<input type="button" class="btn btn-primary edit_all" name="showall" value="批量显示" />
					<input type="button" class="btn btn-primary edit_all" name="hideall" value="批量隐藏" />
				</td>
			</tr>
			</tbody>
			<input name="token" type="hidden" value="{$_W['token']}" />
		</table>
	</div>
	</div>
	{$pager}
</div>
<div class="modal fade" id="entry-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel">入口查看</h4>
			</div>
			<div class="modal-body clearfix form-horizontal">
				<div class="form-group clip-store">
					<label class="col-xs-12 col-sm-4 col-md-2 control-label">店铺首页</label>
					<div class="col-sm-8 col-xs-12">
						<p class="form-control-static"> <a href="javascript:;" id="store_entry"></a></p>
					</div>
				</div>
				<div class="form-group clip-mc">
					<label class="col-xs-12 col-sm-4 col-md-2 control-label">个人中心</label>
					<div class="col-sm-8 col-xs-12">
						<p class="form-control-static"> <a href="javascript:;" id="mc_entry"></a></p>
					</div>
				</div>

			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
</div>
<script>
	$('#entry-modal').on('shown.bs.modal', function () {
		util.clip($('.clip-store p a'), $('.clip-store p a').text());
		util.clip($('.clip-mc p a'), $('.clip-mc p a').text());
	})
	$('.js-entry-modal').click(function() {
		store_entry = $(this).data('store_entry');
		mc_entry = $(this).data('mc_entry');
		$('#store_entry').text(store_entry);
		$('#mc_entry').text(mc_entry);
		$('#entry-modal').modal();
	});
	require(['bootstrap'],function($){
		$('.btn').tooltip();
	});
	$(function(){
		$(".check_all").click(function(){
			var checked = $(this).get(0).checked;
			$(':checkbox').each(function(){this.checked = checked});
		});
		$("input[name=deleteall]").click(function(){
			var check = $("input:checked");
			if(check.length<1){
				err('请选择要删除的记录!');
				return false;
			}
			if( confirm("确认要删除选择的记录?")){
				var id = new Array();
				check.each(function(i){
					id[i] = $(this).val();
				});
				$.post("{php echo $this->createWebUrl('storemanage',array('op'=>'deleteall'))}", {idArr:id},function(data){
					if (data.errno ==0)
					{
						location.reload();
					} else {
						alert(data.error);
					}
				},'json');
			}
		});

		$(".edit_all").click(function(){
			var name = $(this).attr('name');
			var check = $("input:checked");
			if(check.length<1){
				err('请选择要操作的记录!');
				return false;
			}

			var id = new Array();
			check.each(function(i){
				id[i] = $(this).val();
			});
			$.post("{php echo $this->createWebUrl('storemanage',array('op'=>'showall'))}", {idArr:id,show_name:name},function(data){
				if (data.errno ==0)
				{
					location.reload();
				} else {
					alert(data.error);
				}
			},'json');
		});
	});
</script>
<script>
	function drop_confirm(msg, url){
		if(confirm(msg)){
			window.location = url;
		}
	}
</script>

{template 'common/footer'}