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.
23 lines
906 B
23 lines
906 B
<?php
|
|
require_once('../conn.php');
|
|
if(isset($_GET['contractno']) && $_GET['contractno']!=''){
|
|
try{
|
|
$contractno = $_GET['contractno'];
|
|
$sql_str = "SELECT * FROM con_maintance_examine_apply
|
|
LEFT JOIN con_maintance_examine_clear on con_maintance_examine_apply.apply_key=con_maintance_examine_clear.apply_key
|
|
WHERE con_maintance_examine_apply.vol_no = :vol_no";
|
|
$stmt = $conn->prepare($sql_str);
|
|
$stmt->bindParam(':vol_no', $contractno);
|
|
$stmt->execute();
|
|
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
$contractResponse = json_encode($contract);
|
|
|
|
// 設定回應標頭為 JSON
|
|
header('Content-Type: application/json');
|
|
|
|
// 將 JSON 回應返回給客戶端
|
|
echo json_encode($contract);
|
|
}catch (PDOException $e ){
|
|
die("ERROR!!!: ". $e->getMessage());
|
|
}
|
|
}
|