<?php

require_once $_SERVER["DOCUMENT_ROOT"] . '/core/core.php';
$_GET['p'] = empty($_GET['p']) ? 1 : $_GET['p'];
$categories = new Categories();
$c = $categories->_list(15, Pagination::getOffSet($_GET['p']));
$maximum = Pagination::getMaxPage('products_categories');
if (!empty($c)) {
    ?>
    <table class="table table-striped">
        <tbody data-link="row" class="rowlink">
            <tr>
                <th>#</th>
                <th>Nome</th>
            </tr>

            <?php 
    foreach ($c as $row) {
        ?>
            <tr id="category-<?php 
        echo $row['id'];
        ?>
">
                <td><a data-toggle="modal" data-target="#modalView" data-id="<?php 
        echo $row['id'];
        ?>
" data-type="<?php 
        echo $row['id'];
        ?>
"><?php 
        echo $row['id'];