카테고리 표시 기능

1. 새로운 typelist.php 파일을 생성합니다.

디스플레이도 Infinitus 분류 작업을 수행했습니다.

<?php
header("Content-type:text/html;charset=utf-8");
    include 'include/mysqli.php';
?>
<!DOCTYPE html>
<html >
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            table td{padding: 5px 3px;}
            table tr{background: #33CCFF; height: 40px; line-height: 40px}
            /*table tr:nth-child(2n){background: #f0f0f0;}*/
        </style>
        <script>
            function delall(){
                var arrid="";
                obox=document.getElementsByName("box");
                for(i=0;i<obox.length;i++){
                    if(obox[i].checked){
                        arrid+=obox[i].value+",";
                    }
                }
                alert(arrid);
                window.location.href="typesave.php?action=delall&arrid="+arrid;
            }
        </script>
    </head>
    <body>
        <table width="100%">
            <tr><td><input type="checkbox">全选</td><td>编号</td><td>类别名称</td><td>排序</td></td><td>操作</td></tr>
            <?php
            function show($fid,$color,$i){
                $i++;
                $blank ="";
                for($n=0;$n<$i;$n++){
                    $blank.="---";
                }
                $rand=array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
                $color='#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
                global $mysqli;
            $sql="select *from type where fid=$fid order by orderid asc";
            $result=$mysqli->query($sql);
            while($row=$result->fetch_assoc()){
            ?>
            <tr ><td><input type="checkbox" name="box" value="<?php echo $row['id']?>"></td><td><?php echo $row['id']?></td><td><?php echo $blank.$row['typename'].$blank?></td><td><?php echo $row['orderid']?></td><td><a href="typeupdate.php?fid=<?php echo $row['fid']?>&id=<?php echo $row['id']?>">修改</a>
                    <a href="typesave.php?action=del&id=<?php echo $row['id']?>">删除</a>
                    <a href="typeadd.php?id=<?php echo $row['id']?>">添加子类</a>
                </td></tr>
                
            <?php
//                $rand=array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
//                $color=$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
                show($fid=$row['id'],$color,$i);
            }
                 }
            show(0,$color='#33CCFF',0);
            ?>
            <table width="100%" >
                <tr style="background: #ffffff">
                    <td  width="10%"></td>
                    <td width="10%"></td>
                    <td width="50%"></td><td width="10%"></td>
                    <td><a href="javascript:delall()">全部删除</a><a href="typeadd.php"> 添加类别</a></td>
                </tr>
        </table>
    </body>
</html>

2.

지속적인 학습
||
<?php echo "分类页面显示功能";
  • 코스 추천
  • 코스웨어 다운로드
현재 코스웨어를 다운로드할 수 없습니다. 현재 직원들이 정리하고 있습니다. 앞으로도 본 강좌에 많은 관심 부탁드립니다~