<?php
require_once("../includes/database.php");
if (!empty($_POST["account_number"])) {
    $account_number = $_POST["account_number"];

    $result = mysqli_query($con, "SELECT account_number FROM accounts WHERE account_number='$account_number'");
    $count = mysqli_num_rows($result);
    if ($count > 0) {
        echo "<span style='color:red'> Account Number already exists .</span>";
        echo "<script>$('#submit').prop('disabled',true);</script>";
    } else {

        echo "<span style='color:green'> Account Number available for Registration .</span>";
        echo "<script>$('#submit').prop('disabled',false);</script>";
    }
}
