<?php
if (!defined('_GNUBOARD_')) exit; // 개별 실행 방지
// 현재 쓰기 폼에서 사용하는 추가 필드만 저장한다.
$x2_ver = isset($_POST['x2_ver']) ? clean_xss_tags(trim($_POST['x2_ver'])) : '';
$x2_ca2 = isset($_POST['x2_ca2']) ? clean_xss_tags(trim($_POST['x2_ca2'])) : '';
$x2_ca3 = isset($_POST['x2_ca3']) ? clean_xss_tags(trim($_POST['x2_ca3'])) : '';
$x2_description = isset($_POST['x2_description']) ? clean_xss_tags(trim($_POST['x2_description'])) : '';
$x2_txt = isset($_POST['x2_txt']) ? sql_real_escape_string($_POST['x2_txt']) : '';
$add_sql = "";
if (!empty($_POST['wr_date_custom']) && !empty($_POST['wr_time_custom'])) {
$wr_date_custom = clean_xss_tags(trim($_POST['wr_date_custom']));
$wr_time_custom = clean_xss_tags(trim($_POST['wr_time_custom']));
$custom_datetime = "{$wr_date_custom} {$wr_time_custom}";
$add_sql = " , wr_datetime = '{$custom_datetime}' ";
}
$sql = " UPDATE {$write_table}
SET x2_ver = '{$x2_ver}',
x2_ca2 = '{$x2_ca2}',
x2_ca3 = '{$x2_ca3}',
x2_description = '{$x2_description}',
x2_txt = '{$x2_txt}'
{$add_sql}
WHERE wr_id = '{$wr_id}' ";
sql_query($sql);
?>