<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$maindb = 'bookform';

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);

$batchno = $_REQUEST["batchno"];
$qry = mysqli_query($conn, "SELECT  depdate,passlimit,halfpay,fullpay FROM `$maindb` where `batchno` ='$batchno' ") or die(mysqli_error($conn));
//$rows = array();
$row = mysqli_fetch_array($qry);
$rows = array('success' => true,
    'depdate' => $row['depdate'],
    'passlimit' => $row['passlimit'],
    'halfpay' => $row['halfpay'],
    'fullpay' => $row['fullpay']
);
header("Content-type: application/json");
echo json_encode($rows);
?>