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

$formname    = "form_bewerber_list";
$inputname   = "input_id";

?>

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

<div id="mainContent">

    <?php echo current_website_language($site, $language); ?>
    <h1><?php echo get_translation('left_bewerbung'); ?></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 bun.id, bu.name AS '" . $translation->get("name") . "', description as '". $translation->get("description")."', from_unixtime(bun.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from bewerber_user AS bu left join main_admin_user ON bu.modified_user = main_admin_user.id INNER JOIN bewerbung as bun on bu.id = bun.user_id INNER JOIN main_collection as mc on bun.main_collection_id = mc.id  where   (bu.main_language_id = " . (int)$GLOBALS["language"]['id'] . ")  ORDER BY id DESC";
         
        $format = array('option', 'text', 'text', 'text');
        if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
            linklist($result, $formname, $format, "input_id", "edit_bewerbung", FALSE, 'update_sortorder_bewerber', "sendRequest('delete_bewerbung', false, '{$translation->get('delete_stufeform_confirm')}')"); 
        }
        ?>
    </form>

</div>