大神!大神!求指点

浏览:353 发布日期:2017/11/06 分类:求助交流
function TypeLists(){
//dump($_SESSION);
$f_m = M ('lanmu');
$item_m = M ('article');
$where['parentid'] = 0;

$list = $f_m -> where ($where) ->join('cft_lanmu_type on cft_lanmu_type.id=cft_lanmu.type')-> order ('sort asc,fid asc') -> select ();
$str = '';
foreach($list as $k => $vo){
if($vo['topshow']==1){
//$topshow='<img width="20" height="20" src="/public/admin/images/yes.png" onclick="changeTableVal(\'lanmu\',\'fid\','.$vo['fid'].',\'topshow\',this)"/>';
}else{
//$topshow='<img width="20" height="20" src="/public/admin/images/cancel.png" onclick="changeTableVal(\'lanmu\',\'fid\','.$vo['fid'].',\'topshow\',this)"/>';
}
$num = $f_m -> where ('parentid='.$vo['fid']) -> count();
$str = $str. '<tr class=""><td class="tdl1 cate"><input type="checkbox" name="lan_qx[]" value="'.$vo['fid'].'" />';
if($num == 0){//底层分类可以点击进入该分类商品管理
//底层分类
$count = $item_m -> where ('fid ='.$vo['fid']) -> count ();
$str = $str. '<a href="javascript:void(0)" onclick="javascript:news_list('.$vo['fid'].','.$vo['parentid'].','.$vo['type'].')" style="margin:0 10px;"><span style="color:green;"></span> '.$vo['fname'].' [ID:'.$vo['fid'].'] ('.$count.')</a>';
}else{
//非底层分类
$count = $item_m -> where ('fid ='.$vo['fid']) -> count ();
$str = $str. '<a href="javascript:void(0);" class="plusb" style="margin:0 10px;"><img src="/Public/admin/images/plus.gif" /></a><a href="javascript:void(0)" onclick="javascript:news_list('.$vo['fid'].','.$vo['parentid'].','.$vo['type'].')" style="margin-right:10px;"> '.$vo['fname'].' [ID:'.$vo['fid'].'] ('.$count.')</a>';
}
//底层分类
$str = $str.'</td><td>'.$topshow.'</td> <td class="tdr1" style="text-align:right;padding-right:30px;">';
$str = $str.'<a href="javascript:void(0)" onclick="javascript:addNews('.$vo['fid'].')"></a> ';
if($num == 0){
//底层分类可以尝试删除
$str = $str.' <a href="javascript:delcate('.$vo['fid'].')"></a> ';
}
$str = $str.'<a href="javascript:void(0)" onclick="javascript:editNews('.$vo['fid'].')"></a> </td> </tr>';
if($num != 0){
//非底层分类,递归
$str = $str. ' <tr class="zksq" style="display:none;"><td colspan=4> <table class="systable lanmut" style="margin:0px;width:100%;" cellspacing="0" cellpadding="0">';
$str = $str. SeedListTypes($vo['fid'],10);
$str = $str. '</table> </td> </tr>';
}
}
return $str;

}


判断复选框被选中,这是在common里创建的方法
最佳答案
评论( 相关
后面还有条评论,点击查看>>