<?php
if (!defined('_GNUBOARD_')) exit; // 개별 실행 방지
$x2_label = (isset($_POST['x2_label']) && $_POST['x2_label'] == '1') ? '1' : '0';
$x2_memo_clean = (isset($_POST['x2_memo_clean']) && $_POST['x2_memo_clean'] == '1') ? '1' : '0';
$x2_see = (isset($_POST['x2_see']) && $_POST['x2_see'] == '1') ? '1' : '0';
$x2_line = isset($_POST['x2_line']) ? sql_real_escape_string($_POST['x2_line']) : '';
$x2_memo = isset($_POST['x2_memo']) ? sql_real_escape_string($_POST['x2_memo']) : '';
$x2_relay = isset($_POST['x2_relay']) ? sql_real_escape_string($_POST['x2_relay']) : '';
// 2. 날짜/시간 커스텀 업데이트 로직 정제
$add_sql = "";
if (!empty($_POST['wr_date_custom']) && !empty($_POST['wr_time_custom'])) {
$custom_datetime = "{$_POST['wr_date_custom']} {$_POST['wr_time_custom']}";
$add_sql = " , wr_datetime = '{$custom_datetime}' ";
}
// 3. 단일 쿼리로 최적화 업데이트 (x2_ca3 포함 및 문법 수정)
$sql = " UPDATE {$write_table}
SET x2_ver = '{$x2_ver}',
x2_car2 = '{$x2_car2}',
x2_tag = '{$x2_tag}',
x2_ca2 = '{$x2_ca2}',
x2_ca3 = '{$x2_ca3}',
x2_ca4 = '{$x2_ca4}',
x2_txt = '{$x2_txt}',
x2_top = '{$x2_top}',
x2_project = '{$x2_project}',
x2_project_bt = '{$x2_project_bt}',
x2_project_txt ='{$x2_project_txt}',
x2_label = '{$x2_label}',
x2_relay = '{$x2_relay}',
x2_line = '{$x2_line}',
x2_memo = '{$x2_memo}',
x2_memo_clean = '{$x2_memo_clean}',
x2_see = '{$x2_see}'
{$add_sql}
WHERE wr_id = '{$wr_id}' ";
sql_query($sql);
?>