<?php
 
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");

$formname    = "form_stufe_list";
$inputname   = "input_id";

?>

<ul class="toolbar_menu">
    <?= button("new", $translation->get("new"), $formname, "loadCard('new_stufeform', true)"); ?>
    <?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_stufeform')"); ?>
    <?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_stufeform', false, '{$translation->get('delete_stufeform_confirm')}')"); ?>
</ul>

<div id="mainContent">

    <?php echo current_website_language($site, $language); ?>
    <h1><?php echo get_translation('left_stufe'); ?></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 stufe.id, 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 stufe left join main_admin_user ON stufe.modified_user = main_admin_user.id where   (main_language_id = " . (int)$GLOBALS["language"]['id'] . ")  ORDER BY sorting asc";
       
        $format = array('option', 'text', 'text', 'text');
        if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
            linklist($result, $formname, $format, "input_id", "edit_stufeform", FALSE, 'update_sortorder_stufe', "sendRequest('delete_stufeform', false, '{$translation->get('delete_stufeform_confirm')}')"); 
        }
        ?>
    </form>

</div>