<?php

// require_once(MODULE_PATH . "recruting/recruting_config.inc.php");

$siteparts     = \DynCom\mysyde\common\classes\Siteparts::get();
$pageIds       = array();
$sitepartCount = array();
$formname      = "form_recruting";
$translation   = \DynCom\mysyde\common\classes\Registry::get("translation");

$action = (isset($_GET['action']) ? $_GET['action'] : "");

if ($action != "" && $action != "admin_login") {
    require_once(MODULE_PATH . "recruting/recruting.inc.php");
    exit();
}

?>

<div id="mainContent">
    <?php echo current_website_language($site, $language); ?>
    <h1><?php echo get_translation('top_recruting'); ?></h1>

    <div class="dashboard_part_right">
        <h2><?php echo get_translation('last_changed_faq'); ?></h2>

        <form id="<?= $formname ?>" name="<?= $formname ?>" method="post" enctype="multipart/form-data">
            <input type="hidden" class="selected_linklist_row" name="input_id" value="" />

            <div class="requestLoader"></div>
            <div id="page_linklist">
                <?
                $query = "SELECT
        			main_faq.id, 
                    GROUP_CONCAT(' ', IF(main_faq_group_link.active = 1,main_faq_setup_group.description,NULL)) AS '".$translation->get("linked_with")."',
        			main_faq.description AS '" . $translation->get("description") . "',
        			from_unixtime(main_faq.modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', 
        			main_admin_user.name AS '" . $translation->get("changed_by") . "' 
        		from 
        			main_faq left join main_admin_user
        		ON 
        			main_faq.modified_user = main_admin_user.id
                LEFT JOIN
                    main_faq_group_link 
                ON 
                    main_faq_group_link.main_faq_id = main_faq.id
                LEFT JOIN 
                    main_faq_setup_group
                ON 
                    main_faq_setup_group.id = main_faq_group_link.main_faq_setup_group_id

        		where 
        			(main_faq.main_language_id = " . (int)$GLOBALS["language"]['id'] . ")
                GROUP BY main_faq_group_link.main_faq_id ORDER BY main_faq.modified_date desc limit 20";

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