-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardata.php
68 lines (62 loc) · 2.41 KB
/
cardata.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require("carconfig.php");//includeみたいなん
function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','<',$htmlStr);
$xmlStr=str_replace('>','>',$xmlStr);
$xmlStr=str_replace('"','"',$xmlStr);
$xmlStr=str_replace("'",''',$xmlStr);
$xmlStr=str_replace("&",'&',$xmlStr);
return $xmlStr;
}
// Select all the rows in the maphprkers table
try{
// $sql = "select * from markers where 1";
$sql = "select * from conference";
$result = $pdo->query($sql);
if($result->rowCount() > 0){
header("Content-type: text/xml");
// Start XML file, echo parent node
echo "<?xml version='1.0' ?>";
echo '<conference>';
$ind=0;
while($row = $result->fetch()){
// Add to XML document node
echo '<marker ';
echo 'vehicletype="' . $row['vehicletype'] . '" ';
echo 'loopcount="' . $row['loopcount'] . '" ';
echo 'car_ego_lat="' . $row['car_ego_lat'] . '" ';
echo 'car_ego_lng="' . $row['car_ego_lng'] . '" ';
echo 'car_ego_angle="' . $row['car_ego_angle'] . '" ';
echo 'tra_total="' . $row['tra_total'] . '" ';
echo 'tra_num="' . $row['tra_num'] . '" ';
echo 'tra_lat="' . $row['tra_lat'] . '" ';
echo 'tra_lng="' . $row['tra_lng'] . '" ';
echo 'tra_ang="' . $row['tra_ang'] . '" ';
echo 'tra_carflag="' . $row['tra_carflag'] . '" ';
echo 'infra_ego_lat="' . $row['infra_ego_lat'] . '" ';
echo 'infra_ego_lng="' . $row['infra_ego_lng'] . '" ';
echo 'infra_ego_angle="' . $row['infra_ego_angle'] . '" ';
echo 'jointflag="' . $row['jointflag'] . '" ';
// echo 'car_loopcount="' . $row['car_loopcount'] . '" ';
// echo 'car_GPStime="' . $row['car_GPStime'] . '" ';
// echo 'car_ego_lat="' . $row['car_ego_lat'] . '" ';
// echo 'car_ego_lng="' . $row['car_ego_lng'] . '" ';
// echo 'car_ego_angle="' . $row['car_ego_angle'] . '" ';
// echo 'car_tra_total="' . $row['car_tra_total'] . '" ';
// echo 'car_tra_num="' . $row['car_tra_num'] . '" ';
// echo 'car_tra_lat="' . $row['car_tra_lat'] . '" ';
// echo 'car_tra_lng="' . $row['car_tra_lng'] . '" ';
// echo 'car_tra_ang="' . $row['car_tra_ang'] . '" ';
// echo 'car_tra_carflag="' . $row['car_tra_carflag'] . '" ';
echo '/>';
$ind = $ind + 1;
}
// End XML file
echo '</conference>';
}
}
catch(PDOException $e){
die("ERROR: Could not able to execute $sql. " . $e->getMessage());
}
?>