<?php
		
require_once('connection.php');
$url="https://mobile.kspjayamanunggal.co.id/api_kjmDB/Images/";
$sql = "SELECT * FROM mstLelang";
if(!$con->query($sql)){
    echo "Error in connecting to Database.";
}
else{
    $result = $con->query($sql);
    if($result->num_rows > 0){
        $return_arr['mstLelang'] = array();
        while($row = $result->fetch_array()){
            array_push($return_arr['mstLelang'], array(
                'idLelang'=>$row['idLelang'],
                'namaLelang'=>$row['namaLelang'],
                'deskripsiLelang'=>$row['deskripsiLelang'],
                'limitLelang'=>$row['limitLelang'],
                'kendaraanLelang'=> $url.$row['kendaraanLelang']
            ));
        }
        echo json_encode($return_arr);
    }
}          
         
?>