<?php
// gets json of Reposession order nos from reporders
include 'includes/database.php';
$db=new MySQLDatabase();
$db->open_connection();
$sql = mysqli_query($db->connection, "SELECT odate, repono, cname FROM reporders ORDER BY repono DESC") or die (mysqli_error($db->connection) );
$larray = array();
while ($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){
    $odate = substr($row['odate'],8,2)."-".substr($row['odate'],5,2)."-".substr($row['odate'] ,0,4);
    $row_array['value'] = $row['repono'].' - '.$odate.' - '.$row['cname'];
    array_push($larray, $row_array); 
    }
echo json_encode($larray);
$db->close_connection(); 
?>