Пример #1
0
        }
        $number = '';
        if (isset($item['qtd']) && $item['qtd'] != '') {
            $number = '<div class="ui circular horizontal label">' . $item['qtd'] . $item['tipo'] . '</div>';
        }
        return '<a data-html="' . $popup . '" href="index.php?key=' . $key . '&item=' . urlencode($item['nome']) . '" class="item popup">' . $number . $item['nome'] . '</a>';
    }
    // Cria o container com o tipo e os itens de cada tipo
    function createContainer($container)
    {
        return '<div class="column"><div class="ui raised segment"><a class="ui ' . $container['color'] . ' ribbon label">' . $container['nome'] . '</a>
                                <div class="ui selection list">' . $container['itens'] . '<div class="ui divider"></div>' . $container['itensNull'] . '</div></div></div>';
    }
    // Cria o container com os itens separados por tipo
    $arrContainer = null;
    foreach ($tipo->loadTipos() as $itemTipo) {
        $arrItem = null;
        $arrItemNull = null;
        foreach ($listOrd as $item) {
            if ($item['tipo'] == strtolower($itemTipo['type']) && $item['qtd'] != '0') {
                $arrItem .= createItem($listKey, array('nome' => $item['item'], 'qtd' => $item['qtd'], 'tipo' => $itemTipo['type'], 'pessoas' => $item['pessoas']));
            } elseif ($item['tipo'] == strtolower($itemTipo['type']) && $item['qtd'] == '0') {
                $arrItemNull .= createItem($listKey, array('nome' => $item['item'], 'tipo' => $itemTipo['type']));
            }
        }
        $arrContainer .= createContainer(array('color' => 'red', 'nome' => $itemTipo['nome'], 'itens' => $arrItem, 'itensNull' => $arrItemNull));
    }
}
?>

            <div class="ui grid">
Пример #2
0
                </button>
            </form>
            <div class="ui message">
                <table class="ui blue striped table">
                    <thead>
                        <tr>
                            <th class="six wide center aligned">Nome</th>
                            <th class="six wide center aligned">Tipo</th>
                            <th class="six wide center aligned"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
include 'class/tipo.class.php';
$tipo = new Tipo();
$list = $tipo->loadTipos();
foreach ($list as $key => $value) {
    ?>
                            <tr>
                                <td class="center aligned"><?php 
    echo $value['nome'];
    ?>
</td>
                                <td class="center aligned"><?php 
    echo $value['type'];
    ?>
</td>
                                <td class="right aligned">
                                    <form action="action/action.tipo.php" method="POST">
                                        <input type="hidden" name="tipo" value="del">
                                        <input type="hidden" name="key" value="<?php