{% extends "base.html" %}

{% block title %}My Profile{% endblock %}

{% block content %}
<div class="container mt-4">
    <h1 class="mb-4">My Profile</h1>
    <p>Update your registration number, contact details, and logo for reports.</p>

    <form method="POST" enctype="multipart/form-data">
        <div class="form-group">
            <label for="registration_number">Registration Number</label>
            <input type="text" id="registration_number" name="registration_number" class="form-control" value="{{ current_user.registration_number or '' }}">
        </div>
        <div class="form-group">
            <label for="contact_details">Contact Details</label>
            <textarea id="contact_details" name="contact_details" class="form-control" rows="3">{{ current_user.contact_details or '' }}</textarea>
        </div>
        <div class="form-group">
            <label for="logo">Logo</label>
            <input type="file" id="logo" name="logo" class="form-control-file">
            {% if current_user.logo_filename %}
                <div class="mt-2">
                    <p>Current Logo:</p>
                    <img src="{{ url_for('static', filename='uploads/' + current_user.logo_filename) }}" alt="Consultant Logo" style="max-width: 200px; max-height: 100px;">
                </div>
            {% endif %}
        </div>
        <button type="submit" class="btn btn-primary">Update Profile</button>
    </form>
</div>
{% endblock %}
