<commit_before><?php

define('USER','root');
define('PASS','');
define('DB','lids');

$requestJSONData = file_get_contents('php://input');

$requestArray = json_decode($requestJSONData,true);


// parse json post request
$vehicleid = $requestArray["vehicleid"];
$uuid = $requestArray["uuid"];
$latitudeE7 = $requestArray["latitudeE7"];
$longitudeE7=$requestArray["longitudeE7"];
$timestampMs=$requestArray["timestampMs"];
$istripalive=$requestArray["istripalive"];
$tripid=$requestArray["tripid"];
$duration=$requestArray["duration"];

$sql="INSERT INTO tb_usertrips_loc VALUES($tripid,$latitudeE7,$longitudeE7,$timestampMs);";
// print($sql."\n");
$result=mysqli_query($con,$sql);
// if($result)
// {
// 	echo 'query successfull';
// }
// else 
// {
// 	echo "query fail";
// }

mysqli_close($con);

$con = mysqli_connect('localhost',USER,PASS,DB);
$sql="INSERT INTO tb_usertrips VALUES ('".$uuid."',$tripid,0,$vehicleid,'".$triplocation."',$istripalive)";
$stmt = mysqli_prepare($con,$sql);
mysqli_stmt_execute($stmt);

mysqli_close($con);

?>
<commit_msg>update location in a trip<commit_after><?php

define('USER','root');
define('PASS','');
define('DB','lids');

$requestJSONData = file_get_contents('php://input');

$requestArray = json_decode($requestJSONData,true);

// print_r($requestArray);
// parse json post request
$vehicleid = $requestArray["vehicleid"];
$uuid = $requestArray["uuid"];
$latitudeE7 = $requestArray["latitudeE7"];
$longitudeE7=$requestArray["longitudeE7"];
$timestampMs=$requestArray["timestampMs"];
$istripalive=$requestArray["istripalive"];
$tripid=$requestArray["tripid"];
$duration=$requestArray["duration"];

$con = mysqli_connect('localhost',USER,PASS,DB);
$sql="INSERT INTO tb_usertrips_loc VALUES($tripid,$latitudeE7,$longitudeE7,$timestampMs);";
// print($sql."\n");
$result=mysqli_query($con,$sql);
// if($result)
// {
// 	echo 'query successfull';
// }
// else 
// {
// 	echo "query fail";
// }

mysqli_close($con);

$con = mysqli_connect('localhost',USER,PASS,DB);
$sql="UPDATE tb_usertrips SET isTripLive=$istripalive,duration=$duration WHERE TripID=$tripid;";
// print($sql."\n");
$result=mysqli_query($con,$sql);
// if($result)
// {
// 	echo 'query successfull';
// }
// else 
// {
// 	echo "query fail";
// }

mysqli_close($con);

?>

{'fraction_non_alphanumeric': 0.22149122807017543, 'fraction_numerical': 0.005701754385964913, 'mean_word_length': 7.324817518248175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7436805', 'n_tokens_mistral': 839, 'n_tokens_neox': 815, 'n_words': 113}