<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once 'db_functions.php'; 
$db = new DB_Functions(); 
$json = $_REQUEST["taskUpdJSON"];
if (get_magic_quotes_gpc()){ 
	$json = stripslashes($json); 
}
//Decode JSON into an Array 
$data = json_decode($json); 
//print_r($data);
//exit;
//Util arrays to create response JSON 
$a=array();
$b=array();

for($i=0; $i<count($data) ; $i++) {
	//Store User into MySQL DB 
	$res = $db->update_task($data[$i]->taskid,$data[$i]->check_in_date,$data[$i]->check_in_time,$data[$i]->check_out_date,$data[$i]->check_out_time,$data[$i]->status,$data[$i]->checkInLati,$data[$i]->checkInLongi,$data[$i]->checkOutLati,$data[$i]->checkOutLongi,$data[$i]->image_name,$data[$i]->checkinaddress,$data[$i]->checkoutaddress,$data[$i]->create_by,$data[$i]->remark);
	//Based on inserttion, create JSON response     
 	array_push($a,$res);  
}
//Post JSON response back to Android Application 
echo json_encode($a); 
?>


