prepare($sql_str); $stmt->bindParam(':accounttype', $accounttype); $stmt->execute(); $workers = $stmt->fetchAll(PDO::FETCH_ASSOC); $accounttype = "M"; $sql_str = "SELECT id,accountid, name FROM account WHERE accounttype = :accounttype"; $stmt = $conn->prepare($sql_str); $stmt->bindParam(':accounttype', $accounttype); $stmt->execute(); $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC); $persons = array_map(function ($person) { return [ 'view' => $person['accountid'] . '-' . $person['name'], 'value' => $person['accountid'], 'name' => $person['name'] ]; }, $contractpersons); // echo '
';
// print_r($persons);
// echo '
'; $contract_stauts = ["合約簽回", "採購", "工程發包", "工程中", "修理完成"]; ?>

合約入力(修理)