5) {
sleep(1);
header("Location:" . $WebSite . "login/login_form.php");
exit;
}
include $_SERVER['DOCUMENT_ROOT'] . '/load_header.php';
$title_message = '모델별 BOM 생성';
?>
=$title_message?>
prepare($sql);
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC); // $row 배열로 DB 정보를 불러온다.
$itemList = isset($row['itemList']) ? $row['itemList'] : [];
$load_priceDate = $row['registedate'] ?? '';
// itemList 문자열일 때만 json_decode 실행
if (is_string($itemList)) {
$itemList = json_decode($itemList, true);
}
// itemList 유효한 배열이 아닐 경우 빈 배열로 초기화
if (!is_array($itemList)) {
$itemList = [];
}
} catch (PDOException $Exception) {
print "오류: ".$Exception->getMessage();
}
if($mode == 'copy')
{
try {
$sql = "SELECT * FROM ".$DB.".models WHERE model_id = ?";
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1, $model_id, PDO::PARAM_INT);
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC);
include '_row.php';
} catch (PDOException $Exception) {
print "오류: ".$Exception->getMessage();
}
}
else {
if($model_id > 0) {
try {
$sql = "SELECT * FROM ".$DB.".models WHERE model_id = ?";
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1, $model_id, PDO::PARAM_INT);
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC);
include '_row.php';
} catch (PDOException $Exception) {
print "오류: ".$Exception->getMessage();
}
$mode = 'modify';
} else {
include '_request.php';
$mode = 'insert';
}
}
// 예: getCategoryByName($parentName) 함수가 존재하며,
// '절곡물'이라는 2단계 카테고리의 자식(3단계) 카테고리 이름 배열을 리턴한다.
$l3_list = getCategoryByName('스크린','절곡물'); // 자바스크립트에서 사용함
?>