{% extends 'base.html.twig' %}

{% block title %}KingProduct index{% endblock %}

{% block body %}
    <h1>KingProduct index</h1>

    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Description</th>
                <th>Price</th>
                <th>IsAvailable</th>
                <th>DateCreated</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for king_product in king_products %}
            <tr>
                <td>{{ king_product.id }}</td>
                <td>{{ king_product.name }}</td>
                <td>{{ king_product.description }}</td>
                <td>{{ king_product.price }}</td>
                <td>{{ king_product.isAvailable ? 'Yes' : 'No' }}</td>
                <td>{{ king_product.dateCreated ? king_product.dateCreated|date('Y-m-d H:i:s') : '' }}</td>
                <td>
                    <a href="{{ path('app_king_product_show', {'id': king_product.id}) }}">show</a>
                    <a href="{{ path('app_king_product_edit', {'id': king_product.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="7">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <a href="{{ path('app_king_product_new') }}">Create new</a>
{% endblock %}
