<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>
<div class="main_auto martb10">
   <table class="table table-bordered table-hover mart10">
        <tbody>
			<tr>
				<th width="100" class="right">店铺名称：</th>
				<td><?php echo $shopData['shop_name'];?></td>
			</tr>
			<tr>
				<th class="right">配件数据：</th>
				<td>
					<form method="post" enctype="multipart/form-data">
						<input type="hidden" name="shopid" value="<?php echo $shopData['shop_id'];?>">
						<input type="file" name="excel">
						<button type="submit" class="btn btn-primary">导入并更新</button>
						<a href="https://pc.paojd.cn/static/pjl_pro_demo.xls" target="_blank">样例</a>
					</form>
				</td>
			</tr>
			<tr>
				<th class="right">清空配件：</th>
				<td><button onclick="clearAll(<?php echo $shopData['shop_id'];?>);return false;" class="btn btn-danger">清空</button></td>
			</tr>
        </tbody>
    </table>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script type="text/javascript">
	function clearAll(shopId){
		if(shopId==undefined)
			return;
		if(arguments[1]){
			$.get(ADMIN_URI+'pjlShop/clearPro?isAjax=1',{"shopId":shopId},function(res){
				if(res['sataus']){
					MESSAGE.alert('清空成功');
				}else{
					MESSAGE.alert(res['data']);
				}
			},'json')
		}else{
			MESSAGE.confirm('确定要清空该配件商的配件吗？','clearAll('+shopId+',true)');
		}
		
	}
	$(document).ready(function(){
		$('#clear').on('click',function(){
		})
	})
</script>