<?php
/**
 * This view display the result of multiple update action. It's rendered via ajax for the confirmation modal
 *
 * @var $aResults   The array containing the result of each surveymenu entry action
 */
?>

<?php if (!$aResults['global']['result']) :?>
    <strong>
        <?php echo $aResults['global']['message'] ;?>
    </strong>
<?php else : ?>
    <?php unset($aResults['global']); ?>
    <table class="table table-striped">
        <caption class="visually-hidden"><?php eT('Survey menu batch edit results'); ?></caption>
        <thead>
            <th><?php eT('Survey menu entry ID');?></th>
            <th><?php eT('Status');?></th>
        </thead>
        <tbody>
            <?php foreach ($aResults as $iSurveyMenuEntryId => $result) :?>
                <tr>
                    <td>
                        <?php echo $iSurveyMenuEntryId;?>
                    </td>
                    <?php if ($result['status'] === true) :?>
                        <td class="text-success">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php else : ?>
                        <td class="text-danger">
                            <?php echo $result['message']; ?>
                        </td>
                    <?php endif;?>
                </tr>
            <?php endforeach;?>
        </tbody>
    </table>
<?php endif;?>
