require_once 'functions/' . get_value_get('p') . '.php';
    }
} else {
    if (file_exists('functions/dns.php')) {
        require_once 'functions/dns.php';
    }
}
// Types:
// - zoeken (niet af)... > verplaatst
if (check_user_right(get_value_session('from_db', 'id'), 'pakketten', get_value_session('from_db', 'is_admin')) !== FALSE) {
    $html = '<div class="paginatitel">' . $lang->translate(625) . '</div>';
    if (get_value_get('type') == 'verwijderen' && check_user_right(get_value_session('from_db', 'id'), 'pakketverwijderen', get_value_session('from_db', 'is_admin')) !== FALSE) {
        $pakket = pakketten_get_value_details(get_value_session('from_db', 'id'), get_value_get('id'), get_value_session('from_db', 'is_admin'));
        if ($pakket !== FALSE) {
            if (check_user_subuser(get_value_session('from_db', 'id'), $pakket['user_id'], $type = 3) !== FALSE || $pakket['user_id'] == get_value_session('from_db', 'id') || get_value_session('from_db', 'is_admin') == '1') {
                if (pakketten_do_action_verwijder($pakket['user_id'], get_value_get('id')) == FALSE) {
                    $html .= '<br /><p><b>' . $lang->translate(676) . '</b></p><br /><br />';
                } else {
                    $html .= '<br /><p><b>' . $lang->translate(677) . '</b></p><br /><br />';
                }
            }
        }
    } elseif (get_value_get('type') == 'bewerken' && check_user_right(get_value_session('from_db', 'id'), 'pakketbewerken', get_value_session('from_db', 'is_admin')) !== FALSE) {
        $pakket = pakketten_get_value_details(get_value_session('from_db', 'id'), get_value_get('id'), get_value_session('from_db', 'is_admin'));
        if ($pakket !== FALSE) {
            if (check_user_subuser(get_value_session('from_db', 'id'), $pakket['user_id'], $type = 3) !== FALSE || $pakket['user_id'] == get_value_session('from_db', 'id') || get_value_session('from_db', 'is_admin') == '1') {
                if (get_value_get('p') == "dns") {
                    if (get_value_post('submit')) {
                        if (!isset($mysqli) || empty($mysqli)) {
                            create_db_connection('mysqli', 'central');
                        }
     } else {
         $html .= '<br /><p>' . $lang->translate(562) . '</p><br /><br />';
     }
 } elseif (get_value_get('type') == 'verwijderen') {
     $html = '<b>' . $lang->translate(551) . '</b><br /><br />';
     if (check_user_right(get_value_session('from_db', 'id'), 'klantbekijken', get_value_session('from_db', 'is_admin')) != FALSE) {
         if (check_user_subuser(get_value_session('from_db', 'id'), get_value_get('id')) != FALSE || get_value_session('from_db', 'is_admin') == '1') {
             $succes = 0;
             if (get_value_post('submit')) {
                 if (get_subusers(get_value_get('id'), 3) !== FALSE) {
                     $html .= '<br /><br />' . $lang->translate(570) . '<br /><br />';
                 } else {
                     $pakketten = pakketten_get_value_overview(get_value_get('id'), '%');
                     if ($pakketten !== FALSE) {
                         foreach ($pakketten as $pakket) {
                             pakketten_do_action_verwijder(get_value_get('id'), $pakket['id']);
                         }
                     }
                     $sql = 'DELETE FROM `user_subuser` WHERE `subuserid` LIKE "' . $mysqli->real_escape_string(get_value_get('id')) . '"';
                     record_change_user(get_value_get('id'));
                     $sql2 = 'DELETE FROM `user` WHERE `id` LIKE "' . $mysqli->real_escape_string(get_value_get('id')) . '"';
                     $mysqli->query($sql);
                     $mysqli->query($sql2);
                     $succes = 1;
                 }
             }
             if ($succes !== 0) {
                 $html .= '<br /><br />' . $lang->translate(554) . '<br /><br />';
             } elseif (get_subusers(get_value_get('id'), 1) != FALSE) {
                 $html .= '<br /><br />' . $lang->translate(555) . '<br /><br />';
             } else {