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