<?php
include("connect.php");

if (isset($_POST['value']) && $_POST['value'] != "") {

	$q = $_POST['value'];
    
	$result = mysql_query("SELECT * FROM staff WHERE staffName = '".$q."'");
	 
	$row = mysql_fetch_array($result);
	
	$leaveBalance = $row['leaveBalance'];
	$staffPayLeave = $row['staffPayLeave'];

	//$totalLeave = $row3['totalLeave'];
	
	//$arr = array(
    //'z'=>array(
    //    'age'=>33,
    //    'worktime'=>10
    //),
	//);

	$arr = array(
    $q =>array(
		'staffPayLeave'=>$staffPayLeave,
		'leaveBalance'=>$leaveBalance,
    ),
	);
	
	
    foreach($arr as $k=>$v) {
        
        if ($k == trim($q)) {
			echo $v['staffPayLeave'] . '|'. $v['leaveBalance'];
        } 
    }
}
?>