<?php 
require('config.php');
sleep(1);
if (isset($_POST)) {
    $username = (string)$_POST['ci'];
    
    $result = $connexion->query(
        'SELECT * FROM user WHERE ci = "'.strtolower($username).'"'
    );
    
    if ($result->num_rows > 0) {
        echo '<div class="alert alert-warning"><strong>Alerta!</strong> Usuario registrado anteriormente.</div>';
    } else {
        echo '<div class="alert alert-success"><strong>Éxito!</strong> Usuario disponible para registro.</div>';
    }
}