	<div style="position:relative;left:10px;width:1000px;">
<h2><a style="text-decoration:none;" href="./index.php?admin_modul=admin_object_list&object=Import">Import</a> -> {$form_data->name}</h2>
<div id="adminLeftFloater">
            <div title="Dateiauswahl" id="base">

            
                <form class="edit" enctype="multipart/form-data" method="POST" action="./index.php?admin_modul=admin_import_editor&action=upload_file&id={$form_data->id}">
                <div class="import-container" style="width:600px;margin-left:9px;margin-right:9px;padding:20px;background:#f5f5f5;border-radius:5px;">
                    <div class="upload-section">
                        <h3>CSV-Datei für {$form_data->name}</h3>
                        <p>Wählen Sie die CSV-Datei für den Import aus.</p>
                        <div class="file-upload-wrapper">
                            <input id="file_upload" name="Filedata" type="file" accept=".csv" 
                                   onchange="validateFile(this)" style="display:none" />
                            <label for="file_upload" class="upload-btn">Datei auswählen</label>
                            <span id="file-name">Keine Datei ausgewählt</span>
                        </div>
                        <div id="file-validation" style="margin-top:10px;color:#666;"></div>
                    </div>
                    
                    <div class="action-section" style="margin-top:20px;">
                        <input type="submit" name="Importieren" value="Import" class="submit-btn" disabled>
                        <div id="upload-progress" style="display:none;">
                            <div class="progress-bar"></div>
                        </div>
                    </div>
                </div>
                </form>
	    </div>
</div>
</div>

<style>
.import-container {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}
.upload-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}
.upload-btn:hover {
    background: #e0e0e0;
}
.submit-btn {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}
.progress-bar {
    height: 4px;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}
.rsTabs {
    position: relative;
    width: 100%;
}
.rsTabs_BodyElement {
    display: none;
    padding: 10px;
}
.rsTabs_BodyElementActive {
    display: block;
}
.rsTabs_Header {
    position: relative;
    border-bottom: 1px solid #ddd;
}
.rsTabs_HeaderTab {
    display: inline-block;
    padding: 8px 16px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    background: #f5f5f5;
}
.rsTabs_HeaderTabActive {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}
</style>

<script>
function validateFile(input) {
    const file = input.files[0];
    const submitBtn = document.querySelector('.submit-btn');
    const validation = document.getElementById('file-validation');
    const fileName = document.getElementById('file-name');
    
    if (file) {
        fileName.textContent = file.name;
        
        if (!file.name.toLowerCase().endsWith('.csv')) {
            validation.innerHTML = '<span style="color:red">Bitte wählen Sie eine CSV-Datei aus.</span>';
            submitBtn.disabled = true;
            return;
        }
        
        if (file.size > 5 * 1024 * 1024) {
            validation.innerHTML = '<span style="color:red">Die Datei ist zu groß (max. 5MB)</span>';
            submitBtn.disabled = true;
            return;
        }
        
        validation.innerHTML = '<span style="color:green">Die Datei ist bereit zum Import.</span>';
        submitBtn.disabled = false;
    } else {
        fileName.textContent = 'Keine Datei ausgewählt';
        validation.innerHTML = '';
        submitBtn.disabled = true;
    }
}

document.querySelector('form').onsubmit = function(e) {
    const submitBtn = document.querySelector('.submit-btn');
    const progressBar = document.querySelector('.progress-bar');
    const uploadProgress = document.getElementById('upload-progress');
    
    submitBtn.disabled = true;
    uploadProgress.style.display = 'block';
    
    // Simuliere Fortschritt
    let progress = 0;
    const interval = setInterval(() => {
        progress += Math.random() * 30;
        if (progress > 90) clearInterval(interval);
        progressBar.style.width = Math.min(progress, 90) + '%';
    }, 500);
};
</script>

{if $info_message}<div class="info_message message">{$info_message}</div>{/if}
{if $warning_message}<div class="warning_message message">{$warning_message}</div>{/if}
{if $error_message}<div class="error_message message">{$error_message}</div>{/if}