<?php

//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
header("Access-Control-Allow-Origin: *");
include("db_functions.php");
$db=new DB_Functions();

$ei = $_REQUEST['userId']; 
$users=$db->task_master($ei);
$a=array();
$b=array();
   if($users!=false){
   while($row = mysqli_fetch_array($users)) {
	   
	$b["taskid"] = $row["taskid"];
	
  	$b["task_name"] = $row["taskname"];
  	$b["task_subject"] = $row["task_sub"];
  	$b["visit_type"] = $row["visit_type"];
	$b["visit_date"] = $row["visit_date"];
  	$b["transactional_type"] = $row["transactional_type"];
	$b["retailer_name"] = $row["retailer_name"];
	$b["owner_name"] = $row["owner_name"];
	$b["contact_number"] = $row["contact_number"];  
	$b["amount"] = $row["amount"];
	$b["check_out_date"] = $row["check_out_date"];
	$b["check_out_time"] = $row["check_out_time"];
	$b["checkoutaddress"] = $row["checkoutaddress"];
	$b["status"] = $row["status"];
	$b['check_in_date']=$row['check_in_date'];
$b['check_in_time']=$row['check_in_time'];
$b['checkInLati']=$row['checkInLati'];
$b['checkInLongi']=$row['checkInLong'];
$b['checkinaddress']=$row['checkinaddress'];
$b['remark']=$row['remark'];








	  $b["create_date"] = $row["create_date"];
	array_push($a,$b);
   }}
   echo json_encode($a);
?>