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




for($i=0; $i<count($data) ; $i++) {

$task_id=$data[$i]->taskid;
$create_by=$data[$i]->create_by;
$chech_in_date=$data[$i]->check_in_date;
$check_in_time=$data[$i]->check_in_time;
$checkInLati=$data[$i]->checkInLati;
$checkInLongi=$data[$i]->checkInLongi;
$checkinaddress=$data[$i]->checkinaddress;


	//Store User into MySQL DB 
	$res = $db->check_in($task_id,$create_by,$chech_in_date,$check_in_time,$checkInLati,$checkInLongi,$checkinaddress);
	//Based on inserttion, create JSON response     
 	array_push($a,$res);  
}
//Post JSON response back to Android Application 
echo json_encode($a); 
?>


