<?php

$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
$formname    = "form_infopoint_screens_list";
$inputname   = "input_group_id";
?>

<ul class="toolbar_menu">
    <?= button("new", $translation->get("new"), $formname, "loadCard('new_screen', true)"); ?>
    <?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_screen')"); ?>
    <?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_screen', false, '{$translation->get('delete_screen')}')"); ?>
    <?= button("open_screen", $translation->get("open_screen"), $formname, "loadCard('open_screen')"); ?>
</ul>

<div id="mainContent">

    <?php echo current_website_language($site, $language); ?>
    <h1><?php echo get_translation('infopoint_screens'); ?></h1>

    <form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
        <input type="hidden" class="selected_linklist_row" name="input_id" value="" />
        <div class="requestLoader"></div>
        <?
        $query = "SELECT main_infopoint_screens.id, main_infopoint_screens.description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') as '" . $translation->get("changed_on") . "', main_admin_user.name as '" . $translation->get("changed_by") . "' from main_infopoint_screens
            LEFT JOIN
                main_admin_user
            ON
                main_admin_user.id = main_infopoint_screens.modified_user
            ORDER BY main_infopoint_screens.sorting asc";

        $format = array('option', 'text', 'text', 'text');
        if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
            linklist($result, $formname, $format, "input_id", "edit_faq_list", TRUE, 'update_sortorder_faq');
        }
        ?>
    </form>

</div>