
<?php

// gets all imeinos in json for autocomplete

include 'includes/database.php';
$db=new MySQLDatabase();
$db->open_connection();
$sql = mysqli_query($db->connection, "SELECT imeino FROM devstock WHERE imeino IS NOT NULL LIMIT 100;") or die (mysqli_error($db->connection) );
$larray = array();
while ($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){
    $row_array['value'] = $row['imeino'];
    array_push($larray, $row_array); 
    }  
$db->close_connection();
echo json_encode($larray);

?>
