{% extends "head.html" %}

{% block title %}Vehicle Details{% endblock %}

{% block content %}
<div class="container-lg py-4">
    <div class="p-5 mb-4 bg-light rounded-3">
        <h1 class="display-4">Buying a Used Car? Check it!</h1>
        <p class="lead">
            <a href="https://www.salvagedb.com/" title="Salvagedb.com" rel="nofollow">Salvagedb.com</a> provides
            information about salvage or junk vehicles; damage from hail, flood or fire; mileage discrepancies or
            odometer rollback; and gray market vehicles. We do not claim that the car got in our databank has salvage
            title, but the fact that it has been damaged for sure. Our site helps people avoid buying a damaged vehicle
            in the past.
        </p>
    </div>

    <div class="row">
        <div class="col-md-6 mb-4">
            <div class="card">
                <div class="card-header">
                    <h2 class="h4 mb-0">Vehicle Details</h2>
                </div>
                <div class="card-body">
                    <table class="table table-striped">
                        <tbody>
                        <tr>
                            <th scope="row">Make</th>
                            <td>{{det[0][1]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Model</th>
                            <td>{{det[0][2]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Year</th>
                            <td>{{det[0][3]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Body Style</th>
                            <td>{{det[0][4]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Engine</th>
                            <td>{{det[0][5]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Cylinders</th>
                            <td>{{det[0][6]}}</td>
                        </tr>
                        <tr>
                            <th scope="row">Drive</th>
                            <td>{{det[0][7]}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h2 class="h4 mb-0">Search salvage history?</h2>
                </div>
                <div class="card-body">
                    <form name="search_bar" id="search_bar" action="/search" method="post">
                        <div class="input-group">
                            <input id="make_model" class="form-control" name="q" 
                                   value="{{vin}}" autocomplete="off" spellcheck="false" type="text"
                                   placeholder="Enter VIN number">
                            <button class="g-recaptcha btn btn-primary d-flex align-items-center justify-content-center" data-sitekey="{{capcha_site}}" 
                                    id="go_button" data-callback='onSubmit' data-action='submit'>Search</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    function onSubmit(token) {
        document.getElementById("search_bar").submit();
    }
</script>
{% endblock %}