File: /var/www/test/Installationlist/fm_integration/fm_config.php
<?php
// ============================================================
// fm_config.php ─ FileMaker Data API 連線設定
// ------------------------------------------------------------
// ⚠️ 重要:
// 1. 此檔案包含帳密,務必放在 Web 根目錄之外,或至少設定 .htaccess
// 擋掉直接從瀏覽器存取(見下方說明)。
// 2. 請依您實際的 FileMaker Server 環境修改以下設定值。
// ============================================================
return [
// ── 連線資訊 ──────────────────────────────────────
'host' => 'https://fm.ysnet.com.tw', // ← 改成您的 FileMaker Server 網址
'database' => 'YSNET_MIS', // ← 改成資料庫檔名(不含 .fmp12)
'username' => 'web_api', // ← 建議用專用帳號,不要用管理員帳號
'password' => '@Andrejiao9527', // ← 改成實際密碼
'verify_ssl' => true, // 正式環境請保持 true;除非用自簽憑證測試
'timeout_sec' => 15,
// ── 版面與欄位設定 ─────────────────────────────────
'layout' => '裝機單_WebAPI', // ← FileMaker 中用來寫入的「版面」名稱(不是資料表名稱)
'match_field' => 'user_id', // ← 用來比對「是否已有此記錄」的欄位名稱
'container_field' => 'pdf_file', // ← 容器欄位名稱,PDF 會寫入這裡
// ── 欄位對應表 ────────────────────────────────────
// 左邊 key = submit.php 內部變數名稱(程式碼固定,不要改)
// 右邊 value = 對應到 FileMaker layout 上的實際欄位名稱(← 請依實際情況修改)
'field_map' => [
'user_id' => 'user_id',
'applicant_name' => '申請人姓名',
'applicant_usernumber' => '身分證統編',
'applicant_phone' => '行動電話',
'applicant_homenumber' => '住宅電話',
'applicant_email' => '電子信箱',
'member' => '社區名稱',
'address' => '裝機地址',
'speed' => '申請速率',
'basenumber' => '據點',
'pppoeid' => 'PPPoE帳號',
'pppoepw' => 'PPPoE密碼',
'fee_type' => '費率類型',
'fee_amount' => '費率金額',
'total_fee' => '應繳總計',
'deposit_total' => '押金總計',
'install_date' => '裝機日',
'rental_start_date' => '起租日',
'rental_end_date' => '到期日',
'real_end_date' => '贈送後到期日',
'info_devices_text' => '資訊箱設備文字',
'router_devices_text' => '網路設備文字',
'use_devices_text' => '借用設備文字',
'extra_fees_text' => '加收項目文字',
'gift_months_text' => '贈送月份文字',
'enname' => '施工工程師',
'enphone' => '工程師電話',
'dl_speed' => '下載測速',
'ul_speed' => '上傳測速',
'sig_type' => '簽名類型',
],
];