<div class="form-row mt-n4 border-bottom">
    <div class="form-group col-2 text-center">
        <img src="<?php echo $images ?>dataflex.png" id="avatar" name="avatar" class="p-2 mt-2 align-self-center border border-dark rounded" alt="Immagine cliente" style="width:120px; filter: grayscale(100%)">
    </div>

    <div class="form-group col-9">
        <p class="text-secondary"><small>Selezionare un'immagine del tipo <code>gif</code>, <code>webp</code>, <code>jpg/jpeg</code> o <code>png</code> per caricare una foto sul profilo:</small></p>
        <div class="input-group">
            <div class="custom-file">
                <input type="file" class="custom-file-input border-secondary" id="image" name="image" accept=".gif, .jpg, .jpeg, .png, .webp" onchange="previewImage();" <?php echo $solalettura ?>>
                <label class="custom-file-label border-secondary" id="nomefile" name="nomefile"><?php echo $immagine ?></label> 
            </div>
            <div class="input-group-append">
                <button class="btn btn-secondary rounded-right" type="button" onclick="$('#temp').val(''); $('#nomefile').text('Selezionare un file...'); $('#avatar').attr('src',getCookie('images') + 'dataflex.png').css('filter','grayscale(100%)');">Cancella</button>
            </div>
            <input type="text" class="d-none" id="temp">
        </div>
    </div>

    <div class="form-group col-1">    
        <div id="waitData" class="w-100 py-5 bg-white text-center d-none">
        <div class="spinner-border text-info" role="status"></div>
    </div>
  </div>
</div>

<div class="form-row pt-2">
    <div class="form-group col-10">
        <label class="text-secondary mb-n2"><small>Ragione sociale</small></label>
        <input type="text" class="form-control form-control-sm text-uppercase" name="ragione-sociale" id="ragione-sociale" value="<?php echo $ragione_sociale ?>" required <?php echo $solalettura ?>>
    </div>
</div>

<div class="form-row mt-n2">
    <div class="form-group col-4">
        <label class="text-secondary mb-n2"><small>Forma societaria</small></label>
        <select class="form-control form-control-sm" name="list-forma" id="list-forma" <?php echo $solalettura ?>><?php echo $forma_giuridica ?></select>
    </div>

    <div class="form-group col-2">
        <label class="text-secondary mb-n2"><small>Codice fiscale</small></label>
        <input type="text" class="form-control form-control-sm text-uppercase" name="codice-fiscale" id="codice-fiscale" value="<?php echo $codice_fiscale ?>" <?php echo $solalettura ?>>
    </div>

    <div class="form-group col-2">
        <label class="text-secondary mb-n2"><small>Partita IVA</small></label>
        <input type="text" class="form-control form-control-sm text-uppercase" name="partita-iva" id="partita-iva" value="<?php echo $partita_iva ?>" <?php echo $solalettura ?>>
    </div>
</div>

<div class="form-row mt-n2">
    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Nazione</small></label>
        <select class="form-control form-control-sm" name="list-nazioni" id="list-nazioni" onchange=fillRegione() <?php echo $solalettura ?>><?php echo $nazione ?></select>
    </div>

    <div class="form-group col-2">
        <label class="text-secondary mb-n2"><small>Regione</small>&nbsp;<span class="spinner-border text-info spinner-border-sm d-none" id="waitRegione"></span></label>
        <select class="form-control form-control-sm px-1" name="list-regioni" id="list-regioni" onchange=fillProvincia() <?php echo $solalettura ?>><?php echo $regione ?></select>
    </div>

    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Provincia</small>&nbsp;<span class="spinner-border text-info spinner-border-sm d-none" id="waitProvincia"></span></label>
        <select class="form-control form-control-sm px-1" name="list-province" id="list-province" <?php echo $solalettura ?>><?php echo $provincia ?></select>
    </div>

    <div class="form-group col-4">
        <label class="text-secondary mb-n2"><small>Località</small></label>
        <input type="text" class="form-control form-control-sm text-uppercase" name="localita" id="localita" value="<?php echo $localita ?>" required <?php echo $solalettura ?>>
    </div>
</div>

<div class="form-row mt-n2">
    <div class="form-group col-8">
        <label class="text-secondary mb-n2"><small>Indirizzo</small></label>
        <input type="text" class="form-control form-control-sm text-uppercase" name="indirizzo" id="indirizzo" value="<?php echo $indirizzo ?>" required <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-1">
        <label class="text-secondary mb-n2"><small>CAP</small></label>
        <input type="number" class="form-control form-control-sm p-1" name="cap" id="cap"  value="<?php echo $cap ?>" <?php echo $solalettura ?>>
    </div>
</div>

<div class="form-row mt-n2">
    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Telefono 1</small></label>
        <input type="text" class="form-control form-control-sm" name="telefono1" id="telefono1" value="<?php echo $telefono1 ?>" <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Telefono 2</small></label>
        <input type="text" class="form-control form-control-sm" name="telefono2" id="telefono2" value="<?php echo $telefono2 ?>" <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Cellulare</small></label>
        <input type="text" class="form-control form-control-sm" name="cellulare" id="cellulare" value="<?php echo $mobile ?>" <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-3">
        <label class="text-secondary mb-n2"><small>Fax</small></label>
        <input type="text" class="form-control form-control-sm" name="fax" id="fax" value="<?php echo $fax ?>" <?php echo $solalettura ?>>
    </div>
</div>

<div class="form-row mt-n2">
    <div class="form-group col-4">
        <label class="text-secondary mb-n2"><small>PEC</small></label>
        <input type="email" class="form-control form-control-sm text-lowercase" name="pec" id="pec" value="<?php echo $pec ?>" <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-4">
        <label class="text-secondary mb-n2"><small>Email 1</small></label>
        <input type="email" class="form-control form-control-sm text-lowercase" name="email1" id="email1" value="<?php echo $email1 ?>" <?php echo $solalettura ?>>
    </div>
    <div class="form-group col-4">
        <label class="text-secondary mb-n2"><small>Email 2</small></label>
        <input type="email" class="form-control form-control-sm text-lowercase" name="email2" id="email2" value="<?php echo $email2 ?>" <?php echo $solalettura ?>>
    </div>
</div>