You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
774 B
20 lines
774 B
<?php
|
|
error_reporting(0);
|
|
include '../DB.php';
|
|
try {
|
|
$conn = new DB();
|
|
|
|
if ($conn) {
|
|
$sql = "SELECT distinct(latitude),longitude,facilitynum,facilityno,address,buildcompany,marchintotime,estimatedcompletiontime,process,status,create_at from worksite ORDER BY create_at desc";
|
|
$result = $conn->getAll($sql);
|
|
//print_r($result);
|
|
for($i=0;$i<sizeof($result);$i++){
|
|
$installsql = "SELECT * FROM wipinstallation where facilityno = '".$result[$i]["facilityno"]."' order by id desc"; # sql語法存在變數中
|
|
$installinffo=$conn->getAll($installsql);
|
|
$result[$i]['installschedule']= $installinffo;
|
|
}
|
|
echo json_encode($result);
|
|
}
|
|
} catch (Exception $e) {
|
|
die($e->getMessage());
|
|
}
|