Files
orico-official-website-old/app/admin/view/singlepage/childcat.html
2024-10-29 14:04:59 +08:00

50 lines
3.4 KiB
HTML
Executable File

<?php if(!empty($list)):?>
<table class="table table-hover table-bordered margin-bottom-none">
<tbody>
<?php foreach($list as $k=>$singlepage):?>
<tr>
<td class="tcell1"><input type="checkbox" name="ids[]" value="<?php echo $singlepage['id'];?>"></td>
<td class="tcell2"><?php echo $singlepage['id'];?></td>
<td class="tcell3">
<?php echo str_repeat('|---', $level); ?> <span class="fa fa-fw fa-plus-square" data-id="<?php echo $singlepage['id'];?>" data-level="<?php echo $level;?>" data-cod="getchild"></span> <a href="<?php echo url('/admin/singlepage/lists',['pid'=>$singlepage['id']]);?>"><?php echo $singlepage['name'];?></a>
</td>
<td class="tcell4"><input size="3" maxlength="7" value="<?php echo $singlepage['sort'];?>" type="text" data-id="<?php echo $singlepage['id'];?>" data-url="<?php echo url('/admin/singlepage/updatesort');?>" data-cod="sort"></td>
<td class="tcell5">
<span class="fa <?php if($singlepage['isshow']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $singlepage['id'];?>" data-url="<?php echo url('/admin/singlepage/toggleisshow');?>" data-cod="state"></span>
</td>
<td class="tcell6">
<span class="fa <?php if($singlepage['recommend']):?>fa-check<?php else:?>fa-remove<?php endif;?>" data-id="<?php echo $singlepage['id'];?>" data-url="<?php echo url('/admin/singlepage/togglerecommend');?>" data-cod="state"></span>
</td>
<td class="tcell7"><img src="<?php echo getImage($singlepage['picture'],110,110,1,'smallimg');?>" class="img-thumbnail" data-image="<?php echo $singlepage['picture'];?>" data-toggle="preview-image"></td>
<td class="tcell8">
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/singlepage/add',['pid'=>$singlepage['id']]);?>">添加子单页</a>
<a class="btn btn-xs btn-info" href="<?php echo url('/admin/singlepage/edit',['id'=>$singlepage['id']]);?>">编辑</a>
<a class="btn btn-xs btn-info" data-id="<?php echo $singlepage['id'];?>" data-url="<?php echo url('/admin/singlepage/delete');?>" data-cod="dowarn">删除</a>
</td>
</tr>
<tr><td id="catsun<?php echo $singlepage['id'];?>" colspan="8" class="table-responsive no-padding" style="display: none;"></td></tr>
<?php endforeach;?>
</tbody>
</table>
<script type="text/javascript">
$(function() {
$("[data-cod='sort']", "#catsun<?php echo $pid;?>").keyup(ajaxsort);
$("[data-cod='dowarn']", "#catsun<?php echo $pid;?>").click(ajaxdowarn);
$("[data-cod='state']", "#catsun<?php echo $pid;?>").click(togglestate);
$("[data-cod='getchild']", "#catsun<?php echo $pid;?>").click(ajaxgetchild);
$("[data-toggle='preview-image']", "#catsun<?php echo $pid;?>").each(function() {
var element = $(this);
element.popover({
content: function() {
return '<img src="' + element.attr('data-image') + '" style="max-width:200px;"/>';
},
placement: 'auto',
trigger: 'click',
html: true,
container: 'body',
delay: {show: 5, hide: 10}
});
});
});
</script>
<?php endif;?>