"", "item_name" => "", "item_div" => "", "spec" => "", "unit" => "", "unitprice" => "", "searchtag" => "", "update_log" => "" ]; if ($mode === 'update' && $num !== '') { try { $sql = "SELECT * FROM {$DB}.{$tablename} WHERE num = ?"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_INT); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); if (is_numeric($row['unitprice'])) { $row['unitprice'] = number_format($row['unitprice']); } } catch (PDOException $e) { echo "DB 오류: " . $e->getMessage(); exit; } } else if ($mode === 'copy' && $num !== '') { try { $sql = "SELECT * FROM {$DB}.{$tablename} WHERE num = ?"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_INT); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); if (is_numeric($row['unitprice'])) { $row['unitprice'] = number_format($row['unitprice']); } $num = ''; $row['update_log'] = ''; } catch (PDOException $e) { echo "DB 오류: " . $e->getMessage(); exit; } } // item_div 목록 로딩 $itemDivList = []; $unitList = []; try { $sql = "SELECT DISTINCT item_div FROM {$DB}.{$tablename} WHERE item_div IS NOT NULL AND item_div != ''"; $stmt = $pdo->query($sql); $itemDivList = $stmt->fetchAll(PDO::FETCH_COLUMN); $sql2 = "SELECT DISTINCT unit FROM {$DB}.{$tablename} WHERE unit IS NOT NULL AND unit != ''"; $stmt2 = $pdo->query($sql2); $unitList = $stmt2->fetchAll(PDO::FETCH_COLUMN); } catch (PDOException $e) { echo "오류: " . $e->getMessage(); } $title = '단가 신규 등록'; if ($mode === 'update') { $title = '단가 수정'; } else if ($mode === 'copy') { $title = '단가 복사'; } ?>
| 품목코드 | |||
| 품목명 | 품목구분 | ||
| 규격 | 단위 | ||
| 단가 | 검색태그 | 자동 생성됩니다 | |