<?php
$view->extend('MarketZodacoBundle::base_admin.html.php');
?>
<div class="col-lg-12">
    <div class="panel panel-default">
        <div class="panel-heading"><?php echo $view['translator']->trans("Help and Support"); ?></div>
        <div class="panel-body">
            <?php
            if (count($list) > 0) {
                ?>
                <form method="POST">
                    <table data-toggle="table"  data-show-refresh="false" data-show-toggle="false" data-show-columns="false" data-search="false" data-select-item-name="toolbar1" data-pagination="false">
                        <thead>
                            <tr>
                                <th data-field="id" data-sortable="true"><?php echo $view['translator']->trans("ID"); ?></th>
                                <th data-field="name"  data-sortable="true"><?php echo $view['translator']->trans("Name"); ?></th>
                                <th data-field="status" data-sortable="true"><?php echo $view['translator']->trans("Status"); ?></th>
                                <th data-field="sort" data-sortable="false"><?php echo $view['translator']->trans("Show Footer"); ?></th>
                                <th><?php echo $view['translator']->trans("Delete"); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($list as $key => $value) { ?>
                                <tr data-index="<?php echo $value->getId(); ?>">
                                    <td style="">
                                        <?php echo $value->getId(); ?>
                                    </td>
                                    <td style="">
                                        <a href="<?php echo $view['router']->generate('edit_info', array('id' => $value->getId()), true); ?>"><?php echo $value->getTitle(); ?></a>
                                    </td>
                                    <td style=""><?php
                                        if ($value->getActive() == 1) {
                                            echo "<font color='green'>" . $view['translator']->trans("Active") . "</font>";
                                        } else {
                                            echo "<font color='red'>" . $view['translator']->trans("Disable") . "</font>";
                                        }
                                        ?>
                                    </td>
                                    <td style=""><?php
                                        if ($value->getTotal() == 1) {
                                            echo "<font color='green'>" . $view['translator']->trans("Active") . "</font>";
                                        } else {
                                            echo "<font color='red'>" . $view['translator']->trans("Disable") . "</font>";
                                        }
                                        ?>
                                    </td>
                                    <td style=""><a style="color: red;" onclick="return  confirm('Delete?');" href="<?php echo $view['router']->generate('del_info', array('id' => $value->getId()), true); ?>"><?php echo $view['translator']->trans("Delete"); ?></a>
                                    </td>
                                </tr>
                                <?php if ($arr[$value->getId()] != 0) { ?>
                                    <?php foreach ($arr[$value->getId()] as $key1 => $value1) { ?>
                                        <tr> 
                                            <td style="">
                                                <?php echo $value1->getId(); ?>
                                            </td>
                                            <td style="">
                                                <a style=" margin-left: 20px;" href="<?php echo $view['router']->generate('edit_info', array('id' => $value1->getId()), true); ?>">-- <?php echo $value1->getTitle(); ?></a></td> 
                                            <td style=""><?php
                                                if ($value1->getActive() == 1) {
                                                    echo "<font color='green'>" . $view['translator']->trans("Active") . "</font>";
                                                } else {
                                                    echo "<font color='red'>" . $view['translator']->trans("Disable") . "</font>";
                                                }
                                                ?></td> 
                                            <td style=""><?php
                                                if ($value1->getTotal() == 1) {
                                                    echo "<font color='green'>" . $view['translator']->trans("Active") . "</font>";
                                                } else {
                                                    echo "<font color='red'>" . $view['translator']->trans("Disable") . "</font>";
                                                }
                                                ?>
                                            </td>
                                            <td style=""><a style="color: red;" onclick="return  confirm('Delete?');" href="<?php echo $view['router']->generate('del_info', array('id' => $value1->getId()), true); ?>"><?php echo $view['translator']->trans("Delete"); ?></a></td> 
                                        </tr> 
                                    <?php } ?>
                                    <?php
                                }
                            }
                            ?>
                        </tbody> 
                    </table>
                </form>
                <?php
            } else {
                echo $view['translator']->trans("No Data");
            }
            ?>

        </div>
    </div>
</div>