sexta-feira, 11 de janeiro de 2019

atributoListar.php

<?php
require_once("sistema.php");
$sql="SELECT * FROM v1_atributos";
$query=mysqli_query($ligar, $sql);
$total=mysqli_num_rows($query);
$fetch=mysqli_fetch_assoc($query);
?>
    <!DOCTYPE html>
    <html lang="pt">

    <head>
        <style>
            .ml-img {
                width: 80%;
            }

        </style>
        <meta charset="UTF-8">
        <title>Listar atributos</title>
    </head>


    <body>
        <table border="1" cellpadding="5">
            <tr>
                <th>Tipo de atributo</th>
                <th>Atributo</th>
                <th>Estado</th>
                <th>Apagar</th>
             
            </tr>
            <?php do { ?>
            <tr>
                <td>
                    <?php echo $fetch['tipoAtributo'];?>
                </td>
                <td>
                    <?php echo $fetch['atributo'];?>
                </td>
                <?php if($fetch['estado']==1) {?>

                <td><a href="atributosAlterarEstado.php?alterar&estado=0&idAtributo=<?php echo $fetch['idAtributo'];?>"><img src="imgs/ativo.jpg" title="Clique para Inativar" class="ml-img"></a></td><?php }?><?php $fetch['estado']; if($fetch['estado']==0) {?>
                <td><a href="atributosAlterarEstado.php?alterar&estado=1&idAtributo=<?php echo $fetch['idAtributo'];?>"><img src="imgs/inativo.jpg" title="Clique para Ativar" class="ml-img"></a></td><?php }?>
                <td><a href="atributosApagar.php?apagar&idAtributo=<?php echo $fetch['idAtributo']; ?>"><img src="imgs/delete.jpg" class="ml-img" title="Clicar para apagar"></a></td>
            </tr>
            <?php } while($fetch=mysqli_fetch_assoc($query));?>
        </table>
        <a href="index.php">Voltar</a>
    </body>

    </html>

Sem comentários:

Enviar um comentário