<?php

$result = $auth->getApiData("get/productcategory");
if (!isset($result->errorcode)) {
    //print_r($result);
?>
    <div class="card">
        <div class="card-header">
            <h3 class="card-title">Termékekkategóriák</h3>

            <div class="card-tools">
                <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                    <i class="fas fa-minus"></i>
                </button>
                <button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
                    <i class="fas fa-times"></i>
                </button>
            </div>
        </div>
        <div class="card-body table-responsive p-0">
            <table class="table table-hover text-nowrap projects">
                <thead>
                    <tr>
                        <th style="width: 1%">
                            #
                        </th>
                        <th style="width: 20%">
                            Termékkategória neve
                        </th>
                        
                    </tr>
                </thead>
                <tbody>
                    <?php
                  
                    foreach ($result as $productcategory) :
                    ?>
                        <tr>
                            <td>
                                <?php echo $productcategory->id; ?>
                            </td>
                            <td>
                                <a>
                                    <?php echo $productcategory->productCategoryName; ?>
                                </a>
                                <br>
                                <small>
                                    <?php echo convertToDate($productcategory->createdDate)?>
                                </small>
                            </td>
                            
                            
                            <!--<td class="project-state">
                            
                            </td>
                            <td class="project-actions text-right">
                                <a class="btn btn-primary btn-sm" href="<?php echo SITEURL?>/products/product/view?id=<?php echo $productcategory->id?>">
                                    <i class="fas fa-folder">
                                    </i>
                                    Nézet
                                </a>
                                <a class="btn btn-info btn-sm" href="<?php echo SITEURL?>/products/product/edit?id=<?php echo $productcategory->id?>">
                                    <i class="fas fa-pencil-alt">
                                    </i>
                                    Szerkesztés
                                </a>
                            </td> -->
                        </tr>
                    <?php
                    
                    endforeach;
                    ?>
                </tbody>
            </table>
        </div>
        <!-- /.card-body -->
    </div>
<?php
 
}
?>