<?php
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
$formname    = "form_admin_user_list";
$inputname   = "input_id";
?>
<? if ($GLOBALS['admin_user']['right_create_user'] == 1 | $GLOBALS['admin_user']['is_super_user'] == 1) { ?>
    <ul class="toolbar_menu">
        <?= button("new", $translation->get("new"), $formname, "loadCard('new', true)"); ?>
    </ul>
<? } ?>

<div id="mainContent">

    <?php echo current_website_language($site, $language); ?>
    <h1><?php echo get_translation('mysyde_top_users'); ?></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 id, name AS '" . $translation->get("name") . "', email AS '" . $translation->get("email") . "', login AS " . $translation->get("backend_login_label") . " FROM main_admin_user ORDER BY name ASC";
        $format = array("option", "text", "text", "text");
        if ($result = mysqli_query($GLOBALS['mysql_con'], $query)) {
            if ($GLOBALS['admin_user']['right_create_user'] == 1 | $GLOBALS['admin_user']['is_super_user'] == 1) {
                linklist($result, "form_admin_user_list", $format);
            }else {
                linklist($result, "form_admin_user_list", $format, 'input_id', 'no_edit');
            }
        }
        ?>

    </form>
</div>