<?php
include_once 'db_functions.php';     
$db = new DB_Functions();  

$ref_no = $_REQUEST['TaDaNo'];    
$res_tada = $db->TaDaItems($ref_no);     
$a = array();     
$b = array(); 
 
 if ($res_tada != false){ 
   while($row = mysql_fetch_array($res_tada)) {
	   
	$b["ref_no"] = $row["system_ref_no"];
  	$b["ref_date"] = $row["entry_date"];
	$b["ref_time"] = $row["entry_time"];
	$b["total_amt"] = $row["total_amt"];
	
	$b["food_exp"] = $row["food_exp"];
	if($row["food_exp_img"]){
  		$b["food_exp_img"] = "http://test.cansale.in/cansaledms/API/tada/food/".$row["food_exp_img"];
	}else{
		$b["food_exp_img"] = null;
	}
	
	$b["courier_exp"] = $row["courier_exp"];
	if($row["courier_exp_img"]){
		$b["courier_exp_img"] = "http://test.cansale.in/cansaledms/API/tada/courier/".$row["courier_exp_img"];
	}else{
		$b["courier_exp_img"] = null;
	}
	
	$b["localconv_exp"] = $row["localconv_exp"];
	if($row["localconv_exp_img"]){
		$b["localconv_exp_img"] = "http://test.cansale.in/cansaledms/API/tada/local_conv/".$row["localconv_exp_img"];
	}else{
		$b["localconv_exp_img"] = null;
	}
	
	$b["mobile_exp"] = $row["mobile_exp"];
	if($row["mobile_exp_img"]){
		$b["mobile_exp_img"] = "http://test.cansale.in/cansaledms/API/tada/mobile/".$row["mobile_exp_img"];
	}else{
		$b["mobile_exp_img"] = null;
	}
	
	$b["other_exp"] = $row["other_exp"];
	if($row["other_exp_img"]){
		$b["other_exp_img"] = "http://test.cansale.in/cansaledms/API/tada/other/".$row["other_exp_img"];
	}else{
		$b["other_exp_img"] = null;
	}
	
	$b["remark"] = $row["remark"];
	$b["status"] = $row["status"];
	
	array_push($a,$b);
   }	
	echo json_encode($a);
 }
?>