<?php
$sub_menu = '400300';
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
include_once(G5_LIB_PATH.'/iteminfo.lib.php');

auth_check_menu($auth, $sub_menu, "w");

$html_title = "»óÇ° ";

$it = array(
'it_id'=>'',
'it_skin'=>'',
'it_mobile_skin'=>'',
'it_name'=>'',
'it_basic'=>'',
'it_order'=>0,
'it_type1'=>0,
'it_type2'=>0,
'it_type3'=>0,
'it_type4'=>0,
'it_type5'=>0,
'it_brand'=>'',
'it_model'=>'',
'it_tel_inq'=>0,
'it_use'=>0,
'it_nocoupon'=>0,
'ec_mall_pid'=>'',
'it_mobile_explan'=>'',
'it_sell_email'=>'',
'it_shop_memo'=>'',
'it_info_gubun'=>'',
'it_explan'=>'',
'it_point_type'=>0,
'it_cust_price'=>0,
'it_option_subject'=>'',
'it_price'=>0,
'it_point'=>0,
'it_supply_point'=>0,
'it_soldout'=>0,
'it_stock_sms'=>0,
'it_stock_qty'=>0,
'it_noti_qty'=>0,
'it_buy_min_qty'=>0,
'it_buy_max_qty'=>0,
'it_notax'=>0,
'it_supply_subject'=>'',
'it_sc_type'=>0,
'it_sc_method'=>0,
'it_sc_price'=>0,
'it_sc_minimum'=>0,
'it_sc_qty'=>0,
'it_img1'=>'',
'it_img2'=>'',
'it_img3'=>'',
'it_img4'=>'',
'it_img5'=>'',
'it_img6'=>'',
'it_img7'=>'',
'it_img8'=>'',
'it_img9'=>'',
'it_img10'=>'',
'it_head_html'=>'',
'it_tail_html'=>'',
'it_mobile_head_html'=>'',
'it_mobile_tail_html'=>'',
);

for($i=0;$i<=10;$i++){
    $it['it_'.$i.'_subj'] = '';
    $it['it_'.$i] = '';
}

if ($w == "")
{
    $html_title .= "ÀÔ·Â";

    // ¿É¼ÇÀº ÄíÅ°¿¡ ÀúÀåµÈ °ªÀ» º¸¿©ÁÜ. ´ÙÀ½ ÀÔ·ÂÀ» À§ÇÑ°ÍÀÓ
    //$it[ca_id] = _COOKIE[ck_ca_id];
    $it['ca_id'] = get_cookie("ck_ca_id");
    $it['ca_id2'] = get_cookie("ck_ca_id2");
    $it['ca_id3'] = get_cookie("ck_ca_id3");
    if (!$it['ca_id'])
    {
        $sql = " select ca_id from {$g5['g5_shop_category_table']} order by ca_order, ca_id limit 1 ";
        $row = sql_fetch($sql);
        if (! (isset($row['ca_id']) && $row['ca_id']))
            alert("µî·ÏµÈ ºÐ·ù°¡ ¾ø½À´Ï´Ù. ¿ì¼± ºÐ·ù¸¦ µî·ÏÇÏ¿© ÁÖ½Ê½Ã¿À.", './categorylist.php');
        $it['ca_id'] = $row['ca_id'];
    }
    //$it[it_maker]  = stripslashes($_COOKIE[ck_maker]);
    //$it[it_origin] = stripslashes($_COOKIE[ck_origin]);
    $it['it_maker']  = stripslashes(get_cookie("ck_maker"));
    $it['it_origin'] = stripslashes(get_cookie("ck_origin"));
}
else if ($w == "u")
{
    $html_title .= "¼öÁ¤";

    if ($is_admin != 'super')
    {
        $sql = " select it_id from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b
                  where a.it_id = '$it_id'
                    and a.ca_id = b.ca_id
                    and b.ca_mb_id = '{$member['mb_id']}' ";
        $row = sql_fetch($sql);
        if (!$row['it_id'])
            alert("\'{$member['mb_id']}\' ´Ô²²¼­ ¼öÁ¤ ÇÒ ±ÇÇÑÀÌ ¾ø´Â »óÇ°ÀÔ´Ï´Ù.");
    }

    $it = get_shop_item($it_id);

    if(!$it)
        alert('»óÇ°Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.');

    if (! (isset($ca_id) && $ca_id))
        $ca_id = $it['ca_id'];

    $sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
    $ca = sql_fetch($sql);
}
else
{
    alert();
}

$qstr  = $qstr.'&amp;sca='.$sca.'&amp;page='.$page;

$g5['title'] = $html_title;
include_once (G5_ADMIN_PATH.'/admin.head.php');

// ºÐ·ù¸®½ºÆ®
$category_select = '';
$script = '';
$sql = " select * from {$g5['g5_shop_category_table']} ";
if ($is_admin != 'super')
    $sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_order, ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
    $len = strlen($row['ca_id']) / 2 - 1;

    $nbsp = "";
    for ($i=0; $i<$len; $i++)
        $nbsp .= "&nbsp;&nbsp;&nbsp;";

    $category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";

    $script .= "ca_use['{$row['ca_id']}'] = {$row['ca_use']};\n";
    $script .= "ca_stock_qty['{$row['ca_id']}'] = {$row['ca_stock_qty']};\n";
    //$script .= "ca_explan_html['$row[ca_id]'] = $row[ca_explan_html];\n";
    $script .= "ca_sell_email['{$row['ca_id']}'] = '{$row['ca_sell_email']}';\n";
}

// ÀçÀÔ°í¾Ë¸² ¼³Á¤ ÇÊµå Ãß°¡
if(!sql_query(" select it_stock_sms from {$g5['g5_shop_item_table']} limit 1 ", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_stock_qty` ", true);
}

// Ãß°¡¿É¼Ç Æ÷ÀÎÆ® ¼³Á¤ ÇÊµå Ãß°¡
if(!sql_query(" select it_supply_point from {$g5['g5_shop_item_table']} limit 1 ", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `it_supply_point` int(11) NOT NULL DEFAULT '0' AFTER `it_point_type` ", true);
}

// »óÇ°¸Þ¸ð ÇÊµå Ãß°¡
if(!sql_query(" select it_shop_memo from {$g5['g5_shop_item_table']} limit 1 ", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `it_shop_memo` text NOT NULL AFTER `it_use_avg` ", true);
}

// Áö½Ä¼îÇÎ PID ÇÊµåÃß°¡
// »óÇ°¸Þ¸ð ÇÊµå Ãß°¡
if(!sql_query(" select ec_mall_pid from {$g5['g5_shop_item_table']} limit 1 ", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `ec_mall_pid` varchar(255) NOT NULL AFTER `it_shop_memo` ", true);
}

$pg_anchor ='<ul class="anchor">
<li><a href="#anc_sitfrm_cate">»óÇ°ºÐ·ù</a></li>
<li><a href="#anc_sitfrm_skin">½ºÅ²¼³Á¤</a></li>
<li><a href="#anc_sitfrm_ini">±âº»Á¤º¸</a></li>
<li><a href="#anc_sitfrm_compact">¿ä¾àÁ¤º¸</a></li>
<li><a href="#anc_sitfrm_cost">°¡°Ý ¹× Àç°í</a></li>
<li><a href="#anc_sitfrm_sendcost">¹è¼Ûºñ</a></li>
<li><a href="#anc_sitfrm_img">»óÇ°ÀÌ¹ÌÁö</a></li>
<li><a href="#anc_sitfrm_relation">°ü·Ã»óÇ°</a></li>
<li><a href="#anc_sitfrm_event">°ü·ÃÀÌº¥Æ®</a></li>
<li><a href="#anc_sitfrm_optional">»ó¼¼¼³¸í¼³Á¤</a></li>
<li><a href="#anc_sitfrm_extra">¿©ºÐÇÊµå</a></li>
</ul>
';


// ÄíÆùÀû¿ë¾ÈÇÔ ¼³Á¤ ÇÊµå Ãß°¡
if(!sql_query(" select it_nocoupon from {$g5['g5_shop_item_table']} limit 1", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `it_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_use` ", true);
}

// ½ºÅ²ÇÊµå Ãß°¡
if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)) {
    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
                    ADD `it_skin` varchar(255) NOT NULL DEFAULT '' AFTER `ca_id3`,
                    ADD `it_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `it_skin` ", true);
}
?>

<form name="fitemform" action="./itemformupdate.php" method="post" enctype="MULTIPART/FORM-DATA" autocomplete="off" onsubmit="return fitemformcheck(this)">

<input type="hidden" name="codedup" value="<?php echo $default['de_code_dup_use']; ?>">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod"  value="<?php echo $sod; ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx"  value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">

<section id="anc_sitfrm_cate">
    <h2 class="h2_frm">»óÇ°ºÐ·ù</h2>
    <?php echo $pg_anchor; ?>
    <div class="local_desc02 local_desc">
        <p>±âº»ºÐ·ù´Â ¹Ýµå½Ã ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù. ÇÏ³ªÀÇ »óÇ°¿¡ ÃÖ´ë 3°³ÀÇ ´Ù¸¥ ºÐ·ù¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.</p>
    </div>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>»óÇ°ºÐ·ù ÀÔ·Â</caption>
        <colgroup>
            <col class="grid_4">
            <col>
        </colgroup>
        <tbody>
        <tr>
            <th scope="row"><label for="ca_id">±âº»ºÐ·ù</label></th>
            <td>
                <?php if ($w == "") echo help("±âº»ºÐ·ù¸¦ ¼±ÅÃÇÏ¸é, ÆÇ¸Å/Àç°í/HTML»ç¿ë/ÆÇ¸ÅÀÚ E-mail µîÀ», ¼±ÅÃÇÑ ºÐ·ùÀÇ ±âº»°ªÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù."); ?>
                <select name="ca_id" id="ca_id" onchange="categorychange(this.form)">
                    <option value="">¼±ÅÃÇÏ¼¼¿ä</option>
                    <?php echo conv_selected_option($category_select, $it['ca_id']); ?>
                </select>
                <script>
                    var ca_use = new Array();
                    var ca_stock_qty = new Array();
                    //var ca_explan_html = new Array();
                    var ca_sell_email = new Array();
                    var ca_opt1_subject = new Array();
                    var ca_opt2_subject = new Array();
                    var ca_opt3_subject = new Array();
                    var ca_opt4_subject = new Array();
                    var ca_opt5_subject = new Array();
                    var ca_opt6_subject = new Array();
                    <?php echo "\n$script"; ?>
                </script>
            </td>
        </tr>
        <?php for ($i=2; $i<=3; $i++) { ?>
        <tr>
            <th scope="row"><label for="ca_id<?php echo $i; ?>"><?php echo $i; ?>Â÷ ºÐ·ù</label></th>
            <td>
                <?php echo help($i.'Â÷ ºÐ·ù´Â ±âº» ºÐ·ùÀÇ ÇÏÀ§ ºÐ·ù °³³äÀÌ ¾Æ´Ï¹Ç·Î ±âº» ºÐ·ù ¼±ÅÃ½Ã ÇØ´ç »óÇ°ÀÌ Æ÷ÇÔµÉ ÃÖÇÏÀ§ ºÐ·ù¸¸ ¼±ÅÃÇÏ½Ã¸é µË´Ï´Ù.'); ?>
                <select name="ca_id<?php echo $i; ?>" id="ca_id<?php echo $i; ?>">
                    <option value="">¼±ÅÃÇÏ¼¼¿ä</option>
                    <?php echo conv_selected_option($category_select, $it['ca_id'.$i]); ?>
                </select>
            </td>
        </tr>
        <?php } ?>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_skin">
    <h2 class="h2_frm">½ºÅ²¼³Á¤</h2>
    <?php echo $pg_anchor; ?>
    <div class="local_desc02 local_desc">
        <p>»óÇ°»ó¼¼º¸±â¿¡¼­ »ç¿ëÇÒ ½ºÅ²À» ¼³Á¤ÇÕ´Ï´Ù.</p>
    </div>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>½ºÅ²¼³Á¤</caption>
      
        <tbody>
        <tr>
            <th scope="row"><label for="it_skin">PC¿ë ½ºÅ²</label></th>
            <td>
                <?php echo get_skin_select('shop', 'it_skin', 'it_skin', $it['it_skin']); ?>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_skin" value="1" id="chk_ca_it_skin">
                <label for="chk_ca_it_skin">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_skin" value="1" id="chk_all_it_skin">
                <label for="chk_all_it_skin">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_mobile_skin">¸ð¹ÙÀÏ¿ë ½ºÅ²</label></th>
            <td>
                <?php echo get_mobile_skin_select('shop', 'it_mobile_skin', 'it_mobile_skin', $it['it_mobile_skin']); ?>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_mobile_skin" value="1" id="chk_ca_it_mobile_skin">
                <label for="chk_ca_it_mobile_skin">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_mobile_skin" value="1" id="chk_all_it_mobile_skin">
                <label for="chk_all_it_mobile_skin">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_ini">
    <h2 class="h2_frm">±âº»Á¤º¸</h2>
    <?php echo $pg_anchor; ?>
    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>±âº»Á¤º¸ ÀÔ·Â</caption>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_3">
        </colgroup>
        <tbody>
        <tr>
            <th scope="row">»óÇ°ÄÚµå</th>
            <td colspan="2">
                <?php if ($w == '') { // Ãß°¡ ?>
                    <!-- ÃÖ±Ù¿¡ ÀÔ·ÂÇÑ ÄÚµå(ÀÚµ¿ »ý¼º½Ã)°¡ ¸ñ·ÏÀÇ »ó´Ü¿¡ Ãâ·ÂµÇ°Ô ÇÏ·Á¸é ¾Æ·¡ÀÇ ÄÚµå·Î ´ëÃ¼ÇÏ½Ê½Ã¿À. -->
                    <!-- <input type=text class=required name=it_id value="<?php echo 10000000000-time()?>" size=12 maxlength=10 required> <a href='javascript:;' onclick="codedupcheck(document.all.it_id.value)"><img src='./img/btn_code.gif' border=0 align=absmiddle></a> -->
                    <?php echo help("»óÇ°ÀÇ ÄÚµå´Â 10ÀÚ¸® ¼ýÀÚ·Î ÀÚµ¿»ý¼ºÇÕ´Ï´Ù. <b>Á÷Á¢ »óÇ°ÄÚµå¸¦ ÀÔ·ÂÇÒ ¼öµµ ÀÖ½À´Ï´Ù.</b>\n»óÇ°ÄÚµå´Â ¿µ¹®ÀÚ, ¼ýÀÚ, - ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù."); ?>
                    <input type="text" name="it_id" value="<?php echo time(); ?>" id="it_id" required class="frm_input required" size="20" maxlength="20">
                    <!-- <?php if ($default['de_code_dup_use']) { ?><button type="button" class="btn_frmline" onclick="codedupcheck(document.all.it_id.value)">Áßº¹°Ë»ç</a><?php } ?> -->
                <?php } else { ?>
                    <input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
                    <span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
                    <a href="<?php echo shop_item_url($it_id); ?>" class="btn_frmline">»óÇ°È®ÀÎ</a>
                    <a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemuselist.php?sfl=a.it_id&amp;stx=<?php echo $it_id; ?>" class="btn_frmline">»ç¿ëÈÄ±â</a>
                    <a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemqalist.php?sfl=a.it_id&amp;stx=<?php echo $it_id; ?>" class="btn_frmline">»óÇ°¹®ÀÇ</a>
                <?php } ?>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_name">»óÇ°¸í</label></th>
            <td colspan="2">
                <?php echo help("HTML ÀÔ·ÂÀÌ ºÒ°¡ÇÕ´Ï´Ù."); ?>
                <input type="text" name="it_name" value="<?php echo get_text(cut_str($it['it_name'], 250, "")); ?>" id="it_name" required class="frm_input required" size="95">
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_basic">±âº»¼³¸í</label></th>
            <td>
                <?php echo help("»óÇ°¸í ÇÏ´Ü¿¡ »óÇ°¿¡ ´ëÇÑ Ãß°¡ÀûÀÎ ¼³¸íÀÌ ÇÊ¿äÇÑ °æ¿ì¿¡ ÀÔ·ÂÇÕ´Ï´Ù. HTML ÀÔ·Âµµ °¡´ÉÇÕ´Ï´Ù."); ?>
                <input type="text" name="it_basic" value="<?php echo get_text(html_purifier($it['it_basic'])); ?>" id="it_basic" class="frm_input" size="95">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">
                <label for="chk_ca_it_basic">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">
                <label for="chk_all_it_basic">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_order">Ãâ·Â¼ø¼­</label></th>
            <td>
                <?php echo help("¼ýÀÚ°¡ ÀÛÀ» ¼ö·Ï »óÀ§¿¡ Ãâ·ÂµË´Ï´Ù. À½¼ö ÀÔ·Âµµ °¡´ÉÇÏ¸ç ÀÔ·Â °¡´É ¹üÀ§´Â -2147483648 ºÎÅÍ 2147483647 ±îÁöÀÔ´Ï´Ù.\n<b>ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é ÀÚµ¿À¸·Î Ãâ·ÂµË´Ï´Ù.</b>"); ?>
                <input type="text" name="it_order" value="<?php echo $it['it_order']; ?>" id="it_order" class="frm_input" size="12">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_order" value="1" id="chk_ca_it_order">
                <label for="chk_ca_it_order">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_order" value="1" id="chk_all_it_order">
                <label for="chk_all_it_order">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row">»óÇ°À¯Çü</th>
            <td>
                <?php echo help("¸ÞÀÎÈ­¸é¿¡ À¯Çüº°·Î Ãâ·ÂÇÒ¶§ »ç¿ëÇÕ´Ï´Ù.\nÀÌ°÷¿¡ Ã¼Å©ÇÏ°ÔµÇ¸é »óÇ°¸®½ºÆ®¿¡¼­ À¯Çüº°·Î Á¤·ÄÇÒ¶§ Ã¼Å©µÈ »óÇ°ÀÌ °¡Àå ¸ÕÀú Ãâ·ÂµË´Ï´Ù."); ?>
                <input type="checkbox" name="it_type1" value="1" <?php echo ($it['it_type1'] ? "checked" : ""); ?> id="it_type1">
                <label for="it_type1">È÷Æ® <img src="<?php echo G5_SHOP_URL; ?>/img/icon_hit.gif" alt=""></label>
                <input type="checkbox" name="it_type2" value="1" <?php echo ($it['it_type2'] ? "checked" : ""); ?> id="it_type2">
                <label for="it_type2">ÃßÃµ <img src="<?php echo G5_SHOP_URL; ?>/img/icon_rec.gif" alt=""></label>
                <input type="checkbox" name="it_type3" value="1" <?php echo ($it['it_type3'] ? "checked" : ""); ?> id="it_type3">
                <label for="it_type3">½Å»óÇ° <img src="<?php echo G5_SHOP_URL; ?>/img/icon_new.gif" alt=""></label>
                <input type="checkbox" name="it_type4" value="1" <?php echo ($it['it_type4'] ? "checked" : ""); ?> id="it_type4">
                <label for="it_type4">ÀÎ±â <img src="<?php echo G5_SHOP_URL; ?>/img/icon_best.gif" alt=""></label>
                <input type="checkbox" name="it_type5" value="1" <?php echo ($it['it_type5'] ? "checked" : ""); ?> id="it_type5">
                <label for="it_type5">ÇÒÀÎ <img src="<?php echo G5_SHOP_URL; ?>/img/icon_discount.gif" alt=""></label>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_type" value="1" id="chk_ca_it_type">
                <label for="chk_ca_it_type">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_type" value="1" id="chk_all_it_type">
                <label for="chk_all_it_type">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_maker">Á¦Á¶»ç</label></th>
            <td>
                <?php echo help("ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é »óÇ°»ó¼¼ÆäÀÌÁö¿¡ Ãâ·ÂÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_maker" value="<?php echo get_text($it['it_maker']); ?>" id="it_maker" class="frm_input" size="40">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_maker" value="1" id="chk_ca_it_maker">
                <label for="chk_ca_it_maker">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_maker" value="1" id="chk_all_it_maker">
                <label for="chk_all_it_maker">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_origin">¿ø»êÁö</label></th>
            <td>
                <?php echo help("ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é »óÇ°»ó¼¼ÆäÀÌÁö¿¡ Ãâ·ÂÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_origin" value="<?php echo get_text($it['it_origin']); ?>" id="it_origin" class="frm_input" size="40">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_origin" value="1" id="chk_ca_it_origin">
                <label for="chk_ca_it_origin">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_origin" value="1" id="chk_all_it_origin">
                <label for="chk_all_it_origin">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_brand">ºê·£µå</label></th>
            <td>
                <?php echo help("ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é »óÇ°»ó¼¼ÆäÀÌÁö¿¡ Ãâ·ÂÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_brand" value="<?php echo get_text($it['it_brand']); ?>" id="it_brand" class="frm_input" size="40">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_brand" value="1" id="chk_ca_it_brand">
                <label for="chk_ca_it_brand">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_brand" value="1" id="chk_all_it_brand">
                <label for="chk_all_it_brand">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_model">¸ðµ¨</label></th>
            <td>
                <?php echo help("ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é »óÇ°»ó¼¼ÆäÀÌÁö¿¡ Ãâ·ÂÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_model" value="<?php echo get_text($it['it_model']); ?>" id="it_model" class="frm_input" size="40">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_model" value="1" id="chk_ca_it_model">
                <label for="chk_ca_it_model">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_model" value="1" id="chk_all_it_model">
                <label for="chk_all_it_model">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_tel_inq">ÀüÈ­¹®ÀÇ</label></th>
            <td>
                <?php echo help("»óÇ° ±Ý¾× ´ë½Å ÀüÈ­¹®ÀÇ·Î Ç¥½ÃµË´Ï´Ù."); ?>
                <input type="checkbox" name="it_tel_inq" value="1" id="it_tel_inq" <?php echo ($it['it_tel_inq']) ? "checked" : ""; ?>> ¿¹
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_tel_inq" value="1" id="chk_ca_it_tel_inq">
                <label for="chk_ca_it_tel_inq">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_tel_inq" value="1" id="chk_all_it_tel_inq">
                <label for="chk_all_it_tel_inq">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_use">ÆÇ¸Å°¡´É</label></th>
            <td>
                <?php echo help("Àá½Ã ÆÇ¸Å¸¦ Áß´ÜÇÏ°Å³ª Àç°í°¡ ¾øÀ» °æ¿ì¿¡ Ã¼Å©¸¦ ÇØÁ¦ÇØ ³õÀ¸¸é Ãâ·ÂµÇÁö ¾ÊÀ¸¸ç, ÁÖ¹®µµ ¹ÞÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="checkbox" name="it_use" value="1" id="it_use" <?php echo ($it['it_use']) ? "checked" : ""; ?>> ¿¹
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_use" value="1" id="chk_ca_it_use">
                <label for="chk_ca_it_use">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_use" value="1" id="chk_all_it_use">
                <label for="chk_all_it_use">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_nocoupon">ÄíÆùÀû¿ë¾ÈÇÔ</label></th>
            <td>
                <?php echo help("¼³Á¤¿¡ Ã¼Å©ÇÏ½Ã¸é ÄíÆù »ý¼º ¶§ »óÇ° °Ë»ö °á°ú¿¡ ³ëÃâµÇÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="checkbox" name="it_nocoupon" value="1" id="it_nocoupon" <?php echo ($it['it_nocoupon']) ? "checked" : ""; ?>> ¿¹
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_nocoupon" value="1" id="chk_ca_it_nocoupon">
                <label for="chk_ca_it_nocoupon">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_nocoupon" value="1" id="chk_all_it_nocoupon">
                <label for="chk_all_it_nocoupon">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="ec_mall_pid">³×ÀÌ¹ö¼îÇÎ »óÇ°ID</label></th>
            <td colspan="2">
                <?php echo help("³×ÀÌ¹ö¼îÇÎ¿¡ ÀÔÁ¡ÇÑ °æ¿ì ³×ÀÌ¹ö¼îÇÎ »óÇ°ID¸¦ ÀÔ·ÂÇÏ½Ã¸é ³×ÀÌ¹öÆäÀÌ¿Í ¿¬µ¿µË´Ï´Ù.<br>ÀÏºÎ ¼îÇÎ¸ôÀÇ °æ¿ì ³×ÀÌ¹ö¼îÇÎ »óÇ°ID ´ë½Å ¼îÇÎ¸ô »óÇ°ID¸¦ ÀÔ·ÂÇØ¾ß ÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù.<br>³×ÀÌ¹öÆäÀÌ ¿¬µ¿°úÁ¤¿¡¼­ ÀÌ ºÎºÐ¿¡ ´ëÇÑ ¾È³»°¡ ÀÌ·ïÁö´Ï ¾È³»¹ÞÀº ´ë·Î °ªÀ» ÀÔ·ÂÇÏ½Ã¸é µË´Ï´Ù."); ?>
                <input type="text" name="ec_mall_pid" value="<?php echo get_text($it['ec_mall_pid']); ?>" id="ec_mall_pid" class="frm_input" size="20">
            </td>
        </tr>
        <tr>
            <th scope="row">»óÇ°¼³¸í</th>
            <td colspan="2"> <?php echo editor_html('it_explan', get_text(html_purifier($it['it_explan']), 0)); ?></td>
        </tr>
        <tr>
            <th scope="row">¸ð¹ÙÀÏ »óÇ°¼³¸í</th>
            <td colspan="2"> <?php echo editor_html('it_mobile_explan', get_text(html_purifier($it['it_mobile_explan']), 0)); ?></td>
        </tr>
        <tr>
            <th scope="row"><label for="it_sell_email">ÆÇ¸ÅÀÚ e-mail</label></th>
            <td>
                <?php echo help("¿î¿µÀÚ¿Í ½ÇÁ¦ ÆÇ¸ÅÀÚ°¡ ´Ù¸¥ °æ¿ì ½ÇÁ¦ ÆÇ¸ÅÀÚÀÇ e-mailÀ» ÀÔ·ÂÇÏ¸é, »óÇ° ÁÖ¹® ½ÃÁ¡À» ±âÁØÀ¸·Î ½ÇÁ¦ ÆÇ¸ÅÀÚ¿¡°Ôµµ ÁÖ¹®¼­¸¦ ¹ß¼ÛÇÕ´Ï´Ù."); ?>
                <input type="text" name="it_sell_email" value="<?php echo get_sanitize_input($it['it_sell_email']); ?>" id="it_sell_email" class="frm_input" size="40">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_sell_email" value="1" id="chk_ca_it_sell_email">
                <label for="chk_ca_it_sell_email">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_sell_email" value="1" id="chk_all_it_sell_email">
                <label for="chk_all_it_sell_email">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_shop_memo">»óÁ¡¸Þ¸ð</label></th>
            <td><textarea name="it_shop_memo" id="it_shop_memo"><?php echo html_purifier($it['it_shop_memo']); ?></textarea></td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_shop_memo" value="1" id="chk_ca_it_shop_memo">
                <label for="chk_ca_it_shop_memo">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_shop_memo" value="1" id="chk_all_it_shop_memo">
                <label for="chk_all_it_shop_memo">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_compact">
    <h2 class="h2_frm">»óÇ°¿ä¾àÁ¤º¸</h2>
    <?php echo $pg_anchor; ?>
    <div class="local_desc02 local_desc">
        <p><strong>ÀüÀÚ»ó°Å·¡ µî¿¡¼­ÀÇ »óÇ° µîÀÇ Á¤º¸Á¦°ø¿¡ °üÇÑ °í½Ã</strong>¿¡ µû¶ó ÃÑ 35°³ »óÇ°±º¿¡ ´ëÇØ »óÇ° Æ¯¼º µîÀ» ¾ç½Ä¿¡ µû¶ó ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.</p>
    </div>

    <div id="sit_compact">
        <?php echo help("»óÇ°±ºÀ» ¼±ÅÃÇÏ¸é ÀÚµ¿À¸·Î Ç×¸ñÀÌ º¯È¯µË´Ï´Ù."); ?>
        <select id="it_info_gubun" name="it_info_gubun">
            <option value="">»óÇ°±ºÀ» ¼±ÅÃÇÏ¼¼¿ä.</option>
            <?php
            if(!$it['it_info_gubun']) $it['it_info_gubun'] = 'wear';
            foreach($item_info as $key=>$value) {
                $opt_value = $key;
                $opt_text  = $value['title'];
                echo '<option value="'.$opt_value.'" '.get_selected($opt_value, $it['it_info_gubun']).'>'.$opt_text.'</option>'.PHP_EOL;
            }
            ?>
        </select>
    </div>
    <div id="sit_compact_fields"><?php include_once(G5_ADMIN_PATH.'/shop_admin/iteminfo.php'); ?></div>
</section>


<script>
$(function(){
    $(document).on("change", "#it_info_gubun", function() {
        var gubun = $(this).val();
        $.post(
            "<?php echo G5_ADMIN_URL; ?>/shop_admin/iteminfo.php",
            { it_id: "<?php echo $it['it_id']; ?>", gubun: gubun },
            function(data) {
                $("#sit_compact_fields").empty().html(data);
            }
        );
    });
});
</script>

<section id="anc_sitfrm_cost">
    <h2 class="h2_frm">°¡°Ý ¹× Àç°í</h2>
    <?php echo $pg_anchor; ?>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>°¡°Ý ¹× Àç°í ÀÔ·Â</caption>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_3">
        </colgroup>
        <tbody>
        <tr>
            <th scope="row"><label for="it_price">ÆÇ¸Å°¡°Ý</label></th>
            <td>
                <input type="text" name="it_price" value="<?php echo $it['it_price']; ?>" id="it_price" class="frm_input" size="8"> ¿ø
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_price" value="1" id="chk_ca_it_price">
                <label for="chk_ca_it_price">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_price" value="1" id="chk_all_it_price">
                <label for="chk_all_it_price">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_cust_price">½ÃÁß°¡°Ý</label></th>
            <td>
                <?php echo help("ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é »óÇ°»ó¼¼ÆäÀÌÁö¿¡ Ãâ·ÂÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_cust_price" value="<?php echo $it['it_cust_price']; ?>" id="it_cust_price" class="frm_input" size="8"> ¿ø
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_cust_price" value="1" id="chk_ca_it_cust_price">
                <label for="chk_ca_it_cust_price">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_cust_price" value="1" id="chk_all_it_cust_price">
                <label for="chk_all_it_cust_price">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_point_type">Æ÷ÀÎÆ® À¯Çü</label></th>
            <td>
                <?php echo help("Æ÷ÀÎÆ® À¯ÇüÀ» ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ºñÀ²·Î ¼³Á¤ÇßÀ» °æ¿ì ¼³Á¤ ±âÁØ±Ý¾×ÀÇ %ºñÀ²·Î Æ÷ÀÎÆ®°¡ Áö±ÞµË´Ï´Ù."); ?>
                <select name="it_point_type" id="it_point_type">
                    <option value="0"<?php echo get_selected('0', $it['it_point_type']); ?>>¼³Á¤±Ý¾×</option>
                    <option value="1"<?php echo get_selected('1', $it['it_point_type']); ?>>ÆÇ¸Å°¡±âÁØ ¼³Á¤ºñÀ²</option>
                    <option value="2"<?php echo get_selected('2', $it['it_point_type']); ?>>±¸¸Å°¡±âÁØ ¼³Á¤ºñÀ²</option>
                </select>
                <script>
                $(function() {
                    $("#it_point_type").change(function() {
                        if(parseInt($(this).val()) > 0)
                            $("#it_point_unit").text("%");
                        else
                            $("#it_point_unit").text("Á¡");
                    });
                });
                </script>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_point_type" value="1" id="chk_ca_it_point_type">
                <label for="chk_ca_it_point_type">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_point_type" value="1" id="chk_all_it_point_type">
                <label for="chk_all_it_point_type">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_point">Æ÷ÀÎÆ®</label></th>
            <td>
                <?php echo help("ÁÖ¹®¿Ï·áÈÄ È¯°æ¼³Á¤¿¡¼­ ¼³Á¤ÇÑ ÁÖ¹®¿Ï·á ¼³Á¤ÀÏ ÈÄ È¸¿ø¿¡°Ô ºÎ¿©ÇÏ´Â Æ÷ÀÎÆ®ÀÔ´Ï´Ù.\n¶Ç, Æ÷ÀÎÆ®ºÎ¿©¸¦ '¾Æ´Ï¿À'·Î ¼³Á¤ÇÑ °æ¿ì ½Å¿ëÄ«µå, °èÁÂÀÌÃ¼·Î ÁÖ¹®ÇÏ´Â È¸¿ø²²´Â ºÎ¿©ÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_point" value="<?php echo $it['it_point']; ?>" id="it_point" class="frm_input" size="8"> <span id="it_point_unit"><?php if($it['it_point_type']) echo '%'; else echo 'Á¡'; ?></span>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_point" value="1" id="chk_ca_it_point">
                <label for="chk_ca_it_point">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_point" value="1" id="chk_all_it_point">
                <label for="chk_all_it_point">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_supply_point">Ãß°¡¿É¼Ç»óÇ° Æ÷ÀÎÆ®</label></th>
            <td>
                <?php echo help("»óÇ°ÀÇ Ãß°¡¿É¼Ç»óÇ° ±¸¸Å¿¡ ÀÏ°ýÀûÀ¸·Î Áö±ÞÇÏ´Â Æ÷ÀÎÆ®ÀÔ´Ï´Ù. 0À¸·Î ¼³Á¤ÇÏ½Ã¸é ±¸¸ÅÆ÷ÀÎÆ®¸¦ Áö±ÞÇÏÁö ¾Ê½À´Ï´Ù.\nÁÖ¹®¿Ï·áÈÄ È¯°æ¼³Á¤¿¡¼­ ¼³Á¤ÇÑ ÁÖ¹®¿Ï·á ¼³Á¤ÀÏ ÈÄ È¸¿ø¿¡°Ô ºÎ¿©ÇÏ´Â Æ÷ÀÎÆ®ÀÔ´Ï´Ù.\n¶Ç, Æ÷ÀÎÆ®ºÎ¿©¸¦ '¾Æ´Ï¿À'·Î ¼³Á¤ÇÑ °æ¿ì ½Å¿ëÄ«µå, °èÁÂÀÌÃ¼·Î ÁÖ¹®ÇÏ´Â È¸¿ø²²´Â ºÎ¿©ÇÏÁö ¾Ê½À´Ï´Ù."); ?>
                <input type="text" name="it_supply_point" value="<?php echo $it['it_supply_point']; ?>" id="it_supply_point" class="frm_input" size="8"> Á¡
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_supply_point" value="1" id="chk_ca_it_supply_point">
                <label for="chk_ca_it_supply_point">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_supply_point" value="1" id="chk_all_it_supply_point">
                <label for="chk_all_it_supply_point">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_soldout">»óÇ°Ç°Àý</label></th>
            <td>
                <?php echo help("Àá½Ã ÆÇ¸Å¸¦ Áß´ÜÇÏ°Å³ª Àç°í°¡ ¾øÀ» °æ¿ì¿¡ Ã¼Å©ÇØ ³õÀ¸¸é Ç°Àý»óÇ°À¸·Î Ç¥½ÃµË´Ï´Ù."); ?>
                <input type="checkbox" name="it_soldout" value="1" id="it_soldout" <?php echo ($it['it_soldout']) ? "checked" : ""; ?>> ¿¹
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_soldout" value="1" id="chk_ca_it_soldout">
                <label for="chk_ca_it_soldout">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_soldout" value="1" id="chk_all_it_soldout">
                <label for="chk_all_it_soldout">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_stock_sms">ÀçÀÔ°íSMS ¾Ë¸²</label></th>
            <td colspan="2">
                <?php echo help("»óÇ°ÀÌ Ç°ÀýÀÎ °æ¿ì¿¡ Ã¼Å©ÇØ ³õÀ¸¸é »óÇ°»ó¼¼º¸±â¿¡¼­ °í°´ÀÌ ÀçÀÔ°íSMS ¾Ë¸²À» ½ÅÃ»ÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù."); ?>
                <input type="checkbox" name="it_stock_sms" value="1" id="it_stock_sms" <?php echo ($it['it_stock_sms']) ? "checked" : ""; ?>> ¿¹
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_stock_qty">Àç°í¼ö·®</label></th>
            <td>
                <?php echo help("<b>ÁÖ¹®°ü¸®¿¡¼­ »óÇ°º° »óÅÂ º¯°æ¿¡ µû¶ó ÀÚµ¿À¸·Î Àç°í¸¦ °¡°¨ÇÕ´Ï´Ù.</b> Àç°í´Â ±Ô°Ý/»ö»óº°ÀÌ ¾Æ´Ñ, »óÇ°º°·Î¸¸ °ü¸®µË´Ï´Ù.<br>Àç°í¼ö·®À» 0À¸·Î ¼³Á¤ÇÏ½Ã¸é Ç°Àý»óÇ°À¸·Î Ç¥½ÃµË´Ï´Ù."); ?>
                <input type="text" name="it_stock_qty" value="<?php echo $it['it_stock_qty']; ?>" id="it_stock_qty" class="frm_input" size="8"> °³
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_stock_qty" value="1" id="chk_ca_it_stock_qty">
                <label for="chk_ca_it_stock_qty">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_stock_qty" value="1" id="chk_all_it_stock_qty">
                <label for="chk_all_it_stock_qty">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_noti_qty">Àç°í Åëº¸¼ö·®</label></th>
            <td>
                <?php echo help("»óÇ°ÀÇ Àç°í°¡ Åëº¸¼ö·®º¸´Ù ÀÛÀ» ¶§ ¼îÇÎ¸ô°ü¸® ¸ÞÀÎÈ­¸éÀÇ Àç°íÇöÈ²¿¡ Àç°íºÎÁ· »óÇ°À¸·Î Ç¥½ÃµË´Ï´Ù.<br>¿É¼ÇÀÌ ÀÖ´Â »óÇ°Àº °³º° ¿É¼ÇÀÇ Åëº¸¼ö·®ÀÌ Àû¿ëµË´Ï´Ù."); ?>
                <input type="text" name="it_noti_qty" value="<?php echo $it['it_noti_qty']; ?>" id="it_noti_qty" class="frm_input" size="8"> °³
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_noti_qty" value="1" id="chk_ca_it_noti_qty">
                <label for="chk_ca_it_noti_qty">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_noti_qty" value="1" id="chk_all_it_noti_qty">
                <label for="chk_all_it_noti_qty">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_buy_min_qty">ÃÖ¼Ò±¸¸Å¼ö·®</label></th>
            <td>
                <?php echo help("»óÇ° ±¸¸Å½Ã ÃÖ¼Ò ±¸¸Å ¼ö·®À» ¼³Á¤ÇÕ´Ï´Ù."); ?>
                <input type="text" name="it_buy_min_qty" value="<?php echo $it['it_buy_min_qty']; ?>" id="it_buy_min_qty" class="frm_input" size="8"> °³
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_buy_min_qty" value="1" id="chk_ca_it_buy_min_qty">
                <label for="chk_ca_it_buy_min_qty">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_buy_min_qty" value="1" id="chk_all_it_buy_min_qty">
                <label for="chk_all_it_buy_min_qty">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_buy_max_qty">ÃÖ´ë±¸¸Å¼ö·®</label></th>
            <td>
                <?php echo help("»óÇ° ±¸¸Å½Ã ÃÖ´ë ±¸¸Å ¼ö·®À» ¼³Á¤ÇÕ´Ï´Ù."); ?>
                <input type="text" name="it_buy_max_qty" value="<?php echo $it['it_buy_max_qty']; ?>" id="it_buy_max_qty" class="frm_input" size="8"> °³
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_buy_max_qty" value="1" id="chk_ca_it_buy_max_qty">
                <label for="chk_ca_it_buy_max_qty">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_buy_max_qty" value="1" id="chk_all_it_buy_max_qty">
                <label for="chk_all_it_buy_max_qty">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row"><label for="it_notax">»óÇ°°ú¼¼ À¯Çü</label></th>
            <td>
                <?php echo help("»óÇ°ÀÇ °ú¼¼À¯Çü(°ú¼¼, ºñ°ú¼¼)À» ¼³Á¤ÇÕ´Ï´Ù."); ?>
                <select name="it_notax" id="it_notax">
                    <option value="0"<?php echo get_selected('0', $it['it_notax']); ?>>°ú¼¼</option>
                    <option value="1"<?php echo get_selected('1', $it['it_notax']); ?>>ºñ°ú¼¼</option>
                </select>
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_notax" value="1" id="chk_ca_it_notax">
                <label for="chk_ca_it_notax">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_notax" value="1" id="chk_all_it_notax">
                <label for="chk_all_it_notax">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <?php
        $opt_subject = explode(',', $it['it_option_subject']);
        ?>
        <tr>
            <th scope="row">»óÇ°¼±ÅÃ¿É¼Ç</th>
            <td colspan="2">
                <div class="sit_option tbl_frm01">
                    <?php echo help('¿É¼ÇÇ×¸ñÀº ÄÞ¸¶(,) ·Î ±¸ºÐÇÏ¿© ¿©·¯°³¸¦ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿ÊÀ» ¿¹·Î µé¾î [¿É¼Ç1 : »çÀÌÁî , ¿É¼Ç1 Ç×¸ñ : XXL,XL,L,M,S] , [¿É¼Ç2 : »ö»ó , ¿É¼Ç2 Ç×¸ñ : »¡,ÆÄ,³ë]<br><strong>¿É¼Ç¸í°ú ¿É¼ÇÇ×¸ñ¿¡ µû¿ÈÇ¥(\', ")´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.</strong>'); ?>
                    <table>
                    <caption>»óÇ°¼±ÅÃ¿É¼Ç ÀÔ·Â</caption>
                    <colgroup>
                        <col class="grid_4">
                        <col>
                    </colgroup>
                    <tbody>
                    <tr>
                        <th scope="row">
                            <label for="opt1_subject">¿É¼Ç1</label>
                            <input type="text" name="opt1_subject" value="<?php echo isset($opt_subject[0]) ? $opt_subject[0] : ''; ?>" id="opt1_subject" class="frm_input" size="15">
                        </th>
                        <td>
                            <label for="opt1"><b>¿É¼Ç1 Ç×¸ñ</b></label>
                            <input type="text" name="opt1" value="" id="opt1" class="frm_input" size="50">
                        </td>
                    </tr>
                    <tr>
                        <th scope="row">
                            <label for="opt2_subject">¿É¼Ç2</label>
                            <input type="text" name="opt2_subject" value="<?php echo isset($opt_subject[1]) ? $opt_subject[1] : ''; ?>" id="opt2_subject" class="frm_input" size="15">
                        </th>
                        <td>
                            <label for="opt2"><b>¿É¼Ç2 Ç×¸ñ</b></label>
                            <input type="text" name="opt2" value="" id="opt2" class="frm_input" size="50">
                        </td>
                    </tr>
                     <tr>
                        <th scope="row">
                            <label for="opt3_subject">¿É¼Ç3</label>
                            <input type="text" name="opt3_subject" value="<?php echo isset($opt_subject[2]) ? $opt_subject[2] : ''; ?>" id="opt3_subject" class="frm_input" size="15">
                        </th>
                        <td>
                            <label for="opt3"><b>¿É¼Ç3 Ç×¸ñ</b></label>
                            <input type="text" name="opt3" value="" id="opt3" class="frm_input" size="50">
                        </td>
                    </tr>
                    </tbody>
                    </table>
                    <div class="btn_confirm02 btn_confirm">
                        <button type="button" id="option_table_create" class="btn_frmline">¿É¼Ç¸ñ·Ï»ý¼º</button>
                    </div>
                </div>
                <div id="sit_option_frm"><?php include_once(G5_ADMIN_PATH.'/shop_admin/itemoption.php'); ?></div>

                <script>
                $(function() {
                    <?php if($it['it_id'] && $po_run) { ?>
                    //¿É¼ÇÇ×¸ñ¼³Á¤
                    var arr_opt1 = new Array();
                    var arr_opt2 = new Array();
                    var arr_opt3 = new Array();
                    var opt1 = opt2 = opt3 = '';
                    var opt_val;

                    $(".opt-cell").each(function() {
                        opt_val = $(this).text().split(" > ");
                        opt1 = opt_val[0];
                        opt2 = opt_val[1];
                        opt3 = opt_val[2];

                        if(opt1 && $.inArray(opt1, arr_opt1) == -1)
                            arr_opt1.push(opt1);

                        if(opt2 && $.inArray(opt2, arr_opt2) == -1)
                            arr_opt2.push(opt2);

                        if(opt3 && $.inArray(opt3, arr_opt3) == -1)
                            arr_opt3.push(opt3);
                    });


                    $("input[name=opt1]").val(arr_opt1.join());
                    $("input[name=opt2]").val(arr_opt2.join());
                    $("input[name=opt3]").val(arr_opt3.join());
                    <?php } ?>
                    // ¿É¼Ç¸ñ·Ï»ý¼º
                    $("#option_table_create").click(function() {
                        var it_id = $.trim($("input[name=it_id]").val());
                        var opt1_subject = $.trim($("#opt1_subject").val());
                        var opt2_subject = $.trim($("#opt2_subject").val());
                        var opt3_subject = $.trim($("#opt3_subject").val());
                        var opt1 = $.trim($("#opt1").val());
                        var opt2 = $.trim($("#opt2").val());
                        var opt3 = $.trim($("#opt3").val());
                        var $option_table = $("#sit_option_frm");

                        if(!opt1_subject || !opt1) {
                            alert("¿É¼Ç¸í°ú ¿É¼ÇÇ×¸ñÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        $.post(
                            "<?php echo G5_ADMIN_URL; ?>/shop_admin/itemoption.php",
                            { it_id: it_id, w: "<?php echo $w; ?>", opt1_subject: opt1_subject, opt2_subject: opt2_subject, opt3_subject: opt3_subject, opt1: opt1, opt2: opt2, opt3: opt3 },
                            function(data) {
                                $option_table.empty().html(data);
                            }
                        );
                    });

                    // ¸ðµÎ¼±ÅÃ
                    $(document).on("click", "input[name=opt_chk_all]", function() {
                        if($(this).is(":checked")) {
                            $("input[name='opt_chk[]']").attr("checked", true);
                        } else {
                            $("input[name='opt_chk[]']").attr("checked", false);
                        }
                    });

                    // ¼±ÅÃ»èÁ¦
                    $(document).on("click", "#sel_option_delete", function() {
                        var $el = $("input[name='opt_chk[]']:checked");
                        if($el.length < 1) {
                            alert("»èÁ¦ÇÏ·Á´Â ¿É¼ÇÀ» ÇÏ³ª ÀÌ»ó ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        $el.closest("tr").remove();
                    });

                    // ÀÏ°ýÀû¿ë
                    $(document).on("click", "#opt_value_apply", function() {
                        if($(".opt_com_chk:checked").length < 1) {
                            alert("ÀÏ°ý ¼öÁ¤ÇÒ Ç×¸ñÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        var opt_price = $.trim($("#opt_com_price").val());
                        var opt_stock = $.trim($("#opt_com_stock").val());
                        var opt_noti = $.trim($("#opt_com_noti").val());
                        var opt_use = $("#opt_com_use").val();
                        var $el = $("input[name='opt_chk[]']:checked");

                        // Ã¼Å©µÈ ¿É¼ÇÀÌ ÀÖÀ¸¸é Ã¼Å©µÈ °Í¸¸ Àû¿ë
                        if($el.length > 0) {
                            var $tr;
                            $el.each(function() {
                                $tr = $(this).closest("tr");

                                if($("#opt_com_price_chk").is(":checked"))
                                    $tr.find("input[name='opt_price[]']").val(opt_price);

                                if($("#opt_com_stock_chk").is(":checked"))
                                    $tr.find("input[name='opt_stock_qty[]']").val(opt_stock);

                                if($("#opt_com_noti_chk").is(":checked"))
                                    $tr.find("input[name='opt_noti_qty[]']").val(opt_noti);

                                if($("#opt_com_use_chk").is(":checked"))
                                    $tr.find("select[name='opt_use[]']").val(opt_use);
                            });
                        } else {
                            if($("#opt_com_price_chk").is(":checked"))
                                $("input[name='opt_price[]']").val(opt_price);

                            if($("#opt_com_stock_chk").is(":checked"))
                                $("input[name='opt_stock_qty[]']").val(opt_stock);

                            if($("#opt_com_noti_chk").is(":checked"))
                                $("input[name='opt_noti_qty[]']").val(opt_noti);

                            if($("#opt_com_use_chk").is(":checked"))
                                $("select[name='opt_use[]']").val(opt_use);
                        }
                    });
                });
                </script>
            </td>
        </tr>
        <?php
        $spl_subject = explode(',', $it['it_supply_subject']);
        $spl_count = count($spl_subject);
        ?>
        <tr>
            <th scope="row">»óÇ°Ãß°¡¿É¼Ç</th>
            <td colspan="2">
                <div id="sit_supply_frm" class="sit_option tbl_frm01">
                    <?php echo help('¿É¼ÇÇ×¸ñÀº ÄÞ¸¶(,) ·Î ±¸ºÐÇÏ¿© ¿©·¯°³¸¦ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. ½º¸¶Æ®ÆùÀ» ¿¹·Î µé¾î [Ãß°¡1 : Ãß°¡±¸¼º»óÇ° , Ãß°¡1 Ç×¸ñ : ¾×Á¤º¸È£ÇÊ¸§,ÄÉÀÌ½º,ÃæÀü±â]<br><strong>¿É¼Ç¸í°ú ¿É¼ÇÇ×¸ñ¿¡ µû¿ÈÇ¥(\', ")´Â ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.</strong>'); ?>
                    <table>
                    <caption>»óÇ°Ãß°¡¿É¼Ç ÀÔ·Â</caption>
                    <colgroup>
                        <col class="grid_4">
                        <col>
                    </colgroup>
                    <tbody>
                    <?php
                    $i = 0;
                    do {
                        $seq = $i + 1;
                    ?>
                    <tr>
                        <th scope="row">
                            <label for="spl_subject_<?php echo $seq; ?>">Ãß°¡<?php echo $seq; ?></label>
                            <input type="text" name="spl_subject[]" id="spl_subject_<?php echo $seq; ?>" value="<?php echo $spl_subject[$i]; ?>" class="frm_input" size="15">
                        </th>
                        <td>
                            <label for="spl_item_<?php echo $seq; ?>"><b>Ãß°¡<?php echo $seq; ?> Ç×¸ñ</b></label>
                            <input type="text" name="spl[]" id="spl_item_<?php echo $seq; ?>" value="" class="frm_input" size="40">
                            <?php
                            if($i > 0)
                                echo '<button type="button" id="del_supply_row" class="btn_frmline">»èÁ¦</button>';
                            ?>
                        </td>
                    </tr>
                    <?php
                        $i++;
                    } while($i < $spl_count);
                    ?>
                    </tbody>
                    </table>
                    <div id="sit_option_addfrm_btn"><button type="button" id="add_supply_row" class="btn_frmline">¿É¼ÇÃß°¡</button></div>
                    <div class="btn_confirm02 btn_confirm">
                        <button type="button" id="supply_table_create">¿É¼Ç¸ñ·Ï»ý¼º</button>
                    </div>
                </div>
                <div id="sit_option_addfrm"><?php include_once(G5_ADMIN_PATH.'/shop_admin/itemsupply.php'); ?></div>

                <script>
                $(function() {
                    <?php if($it['it_id'] && $ps_run) { ?>
                    // Ãß°¡¿É¼ÇÀÇ Ç×¸ñ ¼³Á¤
                    var arr_subj = new Array();
                    var subj, spl;

                    $("input[name='spl_subject[]']").each(function() {
                        subj = $.trim($(this).val());
                        if(subj && $.inArray(subj, arr_subj) == -1)
                            arr_subj.push(subj);
                    });

                    for(i=0; i<arr_subj.length; i++) {
                        var arr_spl = new Array();
                        $(".spl-subject-cell").each(function(index) {
                            subj = $(this).text();
                            if(subj == arr_subj[i]) {
                                spl = $(".spl-cell:eq("+index+")").text();
                                arr_spl.push(spl);
                            }
                        });

                        $("input[name='spl[]']:eq("+i+")").val(arr_spl.join());
                    }
                    <?php } ?>
                    // ÀÔ·ÂÇÊµåÃß°¡
                    $("#add_supply_row").click(function() {
                        var $el = $("#sit_supply_frm tr:last");
                        var fld = "<tr>\n";
                        fld += "<th scope=\"row\">\n";
                        fld += "<label for=\"\">Ãß°¡</label>\n";
                        fld += "<input type=\"text\" name=\"spl_subject[]\" value=\"\" class=\"frm_input\" size=\"15\">\n";
                        fld += "</th>\n";
                        fld += "<td>\n";
                        fld += "<label for=\"\"><b>Ãß°¡ Ç×¸ñ</b></label>\n";
                        fld += "<input type=\"text\" name=\"spl[]\" value=\"\" class=\"frm_input\" size=\"40\">\n";
                        fld += "<button type=\"button\" id=\"del_supply_row\" class=\"btn_frmline\">»èÁ¦</button>\n";
                        fld += "</td>\n";
                        fld += "</tr>";

                        $el.after(fld);

                        supply_sequence();
                    });

                    // ÀÔ·ÂÇÊµå»èÁ¦
                    $(document).on("click", "#del_supply_row", function() {
                        $(this).closest("tr").remove();

                        supply_sequence();
                    });

                    // ¿É¼Ç¸ñ·Ï»ý¼º
                    $("#supply_table_create").click(function() {
                        var it_id = $.trim($("input[name=it_id]").val());
                        var subject = new Array();
                        var supply = new Array();
                        var subj, spl;
                        var count = 0;
                        var $el_subj = $("input[name='spl_subject[]']");
                        var $el_spl = $("input[name='spl[]']");
                        var $supply_table = $("#sit_option_addfrm");

                        $el_subj.each(function(index) {
                            subj = $.trim($(this).val());
                            spl = $.trim($el_spl.eq(index).val());

                            if(subj && spl) {
                                subject.push(subj);
                                supply.push(spl);
                                count++;
                            }
                        });

                        if(!count) {
                            alert("Ãß°¡¿É¼Ç¸í°ú Ãß°¡¿É¼ÇÇ×¸ñÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        $.post(
                            "<?php echo G5_ADMIN_URL; ?>/shop_admin/itemsupply.php",
                            { it_id: it_id, w: "<?php echo $w; ?>", 'subject[]': subject, 'supply[]': supply },
                            function(data) {
                                $supply_table.empty().html(data);
                            }
                        );
                    });

                    // ¸ðµÎ¼±ÅÃ
                    $(document).on("click", "input[name=spl_chk_all]", function() {
                        if($(this).is(":checked")) {
                            $("input[name='spl_chk[]']").attr("checked", true);
                        } else {
                            $("input[name='spl_chk[]']").attr("checked", false);
                        }
                    });

                    // ¼±ÅÃ»èÁ¦
                    $(document).on("click", "#sel_supply_delete", function() {
                        var $el = $("input[name='spl_chk[]']:checked");
                        if($el.length < 1) {
                            alert("»èÁ¦ÇÏ·Á´Â ¿É¼ÇÀ» ÇÏ³ª ÀÌ»ó ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        $el.closest("tr").remove();
                    });

                    // ÀÏ°ýÀû¿ë
                    $(document).on("click", "#spl_value_apply", function() {
                        if($(".spl_com_chk:checked").length < 1) {
                            alert("ÀÏ°ý ¼öÁ¤ÇÒ Ç×¸ñÀ» ÇÏ³ªÀÌ»ó Ã¼Å©ÇØ ÁÖ½Ê½Ã¿À.");
                            return false;
                        }

                        var spl_price = $.trim($("#spl_com_price").val());
                        var spl_stock = $.trim($("#spl_com_stock").val());
                        var spl_noti = $.trim($("#spl_com_noti").val());
                        var spl_use = $("#spl_com_use").val();
                        var $el = $("input[name='spl_chk[]']:checked");

                        // Ã¼Å©µÈ ¿É¼ÇÀÌ ÀÖÀ¸¸é Ã¼Å©µÈ °Í¸¸ Àû¿ë
                        if($el.length > 0) {
                            var $tr;
                            $el.each(function() {
                                $tr = $(this).closest("tr");

                                if($("#spl_com_price_chk").is(":checked"))
                                    $tr.find("input[name='spl_price[]']").val(spl_price);

                                if($("#spl_com_stock_chk").is(":checked"))
                                    $tr.find("input[name='spl_stock_qty[]']").val(spl_stock);

                                if($("#spl_com_noti_chk").is(":checked"))
                                    $tr.find("input[name='spl_noti_qty[]']").val(spl_noti);

                                if($("#spl_com_use_chk").is(":checked"))
                                    $tr.find("select[name='spl_use[]']").val(spl_use);
                            });
                        } else {
                            if($("#spl_com_price_chk").is(":checked"))
                                $("input[name='spl_price[]']").val(spl_price);

                            if($("#spl_com_stock_chk").is(":checked"))
                                $("input[name='spl_stock_qty[]']").val(spl_stock);

                            if($("#spl_com_noti_chk").is(":checked"))
                                $("input[name='spl_noti_qty[]']").val(spl_noti);

                            if($("#spl_com_use_chk").is(":checked"))
                                $("select[name='spl_use[]']").val(spl_use);
                        }
                    });
                });

                function supply_sequence()
                {
                    var $tr = $("#sit_supply_frm tr");
                    var seq;
                    var th_label, td_label;

                    $tr.each(function(index) {
                        seq = index + 1;
                        $(this).find("th label").attr("for", "spl_subject_"+seq).text("Ãß°¡"+seq);
                        $(this).find("th input").attr("id", "spl_subject_"+seq);
                        $(this).find("td label").attr("for", "spl_item_"+seq);
                        $(this).find("td label b").text("Ãß°¡"+seq+" Ç×¸ñ");
                        $(this).find("td input").attr("id", "spl_item_"+seq);
                    });
                }
                </script>
            </td>
        </tr>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_sendcost">
    <h2 class="h2_frm">¹è¼Ûºñ</h2>
    <?php echo $pg_anchor; ?>
    <div class="local_desc02 local_desc">
        <p>¼îÇÎ¸ô¼³Á¤ &gt; ¹è¼ÛºñÀ¯Çü ¼³Á¤º¸´Ù <strong>°³º°»óÇ° ¹è¼Ûºñ¼³Á¤ÀÌ ¿ì¼±</strong> Àû¿ëµË´Ï´Ù.</p>
    </div>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>¹è¼Ûºñ ÀÔ·Â</caption>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_3">
        </colgroup>
        <tbody>
            <tr>
                <th scope="row"><label for="it_sc_type">¹è¼Ûºñ À¯Çü</label></th>
                <td>
                    <?php echo help("¹è¼Ûºñ À¯ÇüÀ» ¼±ÅÃÇÏ¸é ÀÚµ¿À¸·Î Ç×¸ñÀÌ º¯È¯µË´Ï´Ù."); ?>
                    <select name="it_sc_type" id="it_sc_type">
                        <option value="0"<?php echo get_selected('0', $it['it_sc_type']); ?>>¼îÇÎ¸ô ±âº»¼³Á¤ »ç¿ë</option>
                        <option value="1"<?php echo get_selected('1', $it['it_sc_type']); ?>>¹«·á¹è¼Û</option>
                        <option value="2"<?php echo get_selected('2', $it['it_sc_type']); ?>>Á¶°ÇºÎ ¹«·á¹è¼Û</option>
                        <option value="3"<?php echo get_selected('3', $it['it_sc_type']); ?>>À¯·á¹è¼Û</option>
                        <option value="4"<?php echo get_selected('4', $it['it_sc_type']); ?>>¼ö·®º° ºÎ°ú</option>
                    </select>
                </td>
                <td rowspan="4" id="sc_grp" class="td_grpset">
                    <input type="checkbox" name="chk_ca_it_sendcost" value="1" id="chk_ca_it_sendcost">
                    <label for="chk_ca_it_sendcost">ºÐ·ùÀû¿ë</label>
                    <input type="checkbox" name="chk_all_it_sendcost" value="1" id="chk_all_it_sendcost">
                    <label for="chk_all_it_sendcost">ÀüÃ¼Àû¿ë</label>
                </td>
            </tr>
            <tr id="sc_con_method">
                <th scope="row"><label for="it_sc_method">¹è¼Ûºñ °áÁ¦</label></th>
                <td>
                    <select name="it_sc_method" id="it_sc_method">
                        <option value="0"<?php echo get_selected('0', $it['it_sc_method']); ?>>¼±ºÒ</option>
                        <option value="1"<?php echo get_selected('1', $it['it_sc_method']); ?>>ÂøºÒ</option>
                        <option value="2"<?php echo get_selected('2', $it['it_sc_method']); ?>>»ç¿ëÀÚ¼±ÅÃ</option>
                    </select>
                </td>
            </tr>
            <tr id="sc_con_basic">
                <th scope="row"><label for="it_sc_price">±âº»¹è¼Ûºñ</label></th>
                <td>
                    <?php echo help("¹«·á¹è¼Û ÀÌ¿ÜÀÇ ¼³Á¤¿¡ Àû¿ëµÇ´Â ¹è¼Ûºñ ±Ý¾×ÀÔ´Ï´Ù."); ?>
                    <input type="text" name="it_sc_price" value="<?php echo $it['it_sc_price']; ?>" id="it_sc_price" class="frm_input" size="8"> ¿ø
                </td>
            </tr>
            <tr id="sc_con_minimum">
                <th scope="row"><label for="it_sc_minimum">¹è¼Ûºñ »ó¼¼Á¶°Ç</label></th>
                <td>
                    ÁÖ¹®±Ý¾× <input type="text" name="it_sc_minimum" value="<?php echo $it['it_sc_minimum']; ?>" id="it_sc_minimum" class="frm_input" size="8"> ÀÌ»ó ¹«·á ¹è¼Û
                </td>
            </tr>
            <tr id="sc_con_qty">
                <th scope="row"><label for="it_sc_qty">¹è¼Ûºñ »ó¼¼Á¶°Ç</label></th>
                <td>
                    <?php echo help("»óÇ°ÀÇ ÁÖ¹® ¼ö·®¿¡ µû¶ó ¹è¼Ûºñ°¡ ºÎ°úµË´Ï´Ù. ¿¹¸¦ µé¾î ±âº»¹è¼Ûºñ°¡ 3,000¿ø ¼ö·®À» 3À¸·Î ¼³Á¤ÇßÀ» °æ¿ì »óÇ°ÀÇ ÁÖ¹®¼ö·®ÀÌ 5°³ÀÌ¸é 6,000¿ø ¹è¼Ûºñ°¡ ºÎ°úµË´Ï´Ù."); ?>
                    ÁÖ¹®¼ö·® <input type="text" name="it_sc_qty" value="<?php echo $it['it_sc_qty']; ?>" id="it_sc_qty" class="frm_input" size="8"> ¸¶´Ù ¹è¼Ûºñ ºÎ°ú
                </td>
            </tr>
        </tbody>
        </table>
    </div>

    <script>
    $(function() {
        <?php
        switch($it['it_sc_type']) {
            case 1:
                echo '$("#sc_con_method").hide();'.PHP_EOL;
                echo '$("#sc_con_basic").hide();'.PHP_EOL;
                echo '$("#sc_con_minimum").hide();'.PHP_EOL;
                echo '$("#sc_con_qty").hide();'.PHP_EOL;
                echo '$("#sc_grp").attr("rowspan","1");'.PHP_EOL;
                break;
            case 2:
                echo '$("#sc_con_method").show();'.PHP_EOL;
                echo '$("#sc_con_basic").show();'.PHP_EOL;
                echo '$("#sc_con_minimum").show();'.PHP_EOL;
                echo '$("#sc_con_qty").hide();'.PHP_EOL;
                echo '$("#sc_grp").attr("rowspan","4");'.PHP_EOL;
                break;
            case 3:
                echo '$("#sc_con_method").show();'.PHP_EOL;
                echo '$("#sc_con_basic").show();'.PHP_EOL;
                echo '$("#sc_con_minimum").hide();'.PHP_EOL;
                echo '$("#sc_con_qty").hide();'.PHP_EOL;
                echo '$("#sc_grp").attr("rowspan","3");'.PHP_EOL;
                break;
            case 4:
                echo '$("#sc_con_method").show();'.PHP_EOL;
                echo '$("#sc_con_basic").show();'.PHP_EOL;
                echo '$("#sc_con_minimum").hide();'.PHP_EOL;
                echo '$("#sc_con_qty").show();'.PHP_EOL;
                echo '$("#sc_grp").attr("rowspan","4");'.PHP_EOL;
                break;
            default:
                echo '$("#sc_con_method").hide();'.PHP_EOL;
                echo '$("#sc_con_basic").hide();'.PHP_EOL;
                echo '$("#sc_con_minimum").hide();'.PHP_EOL;
                echo '$("#sc_con_qty").hide();'.PHP_EOL;
                echo '$("#sc_grp").attr("rowspan","2");'.PHP_EOL;
                break;
        }
        ?>
        $("#it_sc_type").change(function() {
            var type = $(this).val();

            switch(type) {
                case "1":
                    $("#sc_con_method").hide();
                    $("#sc_con_basic").hide();
                    $("#sc_con_minimum").hide();
                    $("#sc_con_qty").hide();
                    $("#sc_grp").attr("rowspan","1");
                    break;
                case "2":
                    $("#sc_con_method").show();
                    $("#sc_con_basic").show();
                    $("#sc_con_minimum").show();
                    $("#sc_con_qty").hide();
                    $("#sc_grp").attr("rowspan","4");
                    break;
                case "3":
                    $("#sc_con_method").show();
                    $("#sc_con_basic").show();
                    $("#sc_con_minimum").hide();
                    $("#sc_con_qty").hide();
                    $("#sc_grp").attr("rowspan","3");
                    break;
                case "4":
                    $("#sc_con_method").show();
                    $("#sc_con_basic").show();
                    $("#sc_con_minimum").hide();
                    $("#sc_con_qty").show();
                    $("#sc_grp").attr("rowspan","4");
                    break;
                default:
                    $("#sc_con_method").hide();
                    $("#sc_con_basic").hide();
                    $("#sc_con_minimum").hide();
                    $("#sc_con_qty").hide();
                    $("#sc_grp").attr("rowspan","1");
                    break;
            }
        });
    });
    </script>
</section>


<section id="anc_sitfrm_img">
    <h2 class="h2_frm">ÀÌ¹ÌÁö</h2>
    <?php echo $pg_anchor; ?>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>ÀÌ¹ÌÁö ¾÷·Îµå</caption>
        <colgroup>
            <col class="grid_4">
            <col>
        </colgroup>
        <tbody>
        <?php for($i=1; $i<=10; $i++) { ?>
        <tr>
            <th scope="row"><label for="it_img<?php echo $i; ?>">ÀÌ¹ÌÁö <?php echo $i; ?></label></th>
            <td>
                <input type="file" name="it_img<?php echo $i; ?>" id="it_img<?php echo $i; ?>" onChange="readURL(this,<?=$i?>)">
				<img id="View<?=$i?>" src="#" alt="ÀÌ¹ÌÁö ¹Ì¸®º¸±â" style="width: 120px;display:none;"/>
                <?php
                $it_img = G5_DATA_PATH.'/item/'.$it['it_img'.$i];
                $it_img_exists = run_replace('shop_item_image_exists', (is_file($it_img) && file_exists($it_img)), $it, $i);

                if($it_img_exists) {
                    $thumb = get_it_thumbnail($it['it_img'.$i], 25, 25);
                    $img_tag = run_replace('shop_item_image_tag', '<img src="'.G5_DATA_URL.'/item/'.$it['it_img'.$i].'" class="shop_item_preview_image" >', $it, $i);
                ?>
                <label for="it_img<?php echo $i; ?>_del"><span class="sound_only">ÀÌ¹ÌÁö <?php echo $i; ?> </span>ÆÄÀÏ»èÁ¦</label>
                <input type="checkbox" name="it_img<?php echo $i; ?>_del" id="it_img<?php echo $i; ?>_del" value="1">
                <span class="sit_wimg_limg<?php echo $i; ?>"><?php echo $thumb; ?></span>
                <div id="limg<?php echo $i; ?>" class="banner_or_img">
                    <?php echo $img_tag; ?>
                    <button type="button" class="sit_wimg_close">´Ý±â</button>
                </div>
                <script>
                $('<button type="button" id="it_limg<?php echo $i; ?>_view" class="btn_frmline sit_wimg_view">ÀÌ¹ÌÁö<?php echo $i; ?> È®ÀÎ</button>').appendTo('.sit_wimg_limg<?php echo $i; ?>');
                </script>
                <?php } ?>
            </td>
        </tr>
        <?php } ?>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_relation" class="srel">
    <h2 class="h2_frm">°ü·Ã»óÇ°</h2>
    <?php echo $pg_anchor; ?>

    <div class="local_desc02 local_desc">
        <p>
            µî·ÏµÈ ÀüÃ¼»óÇ° ¸ñ·Ï¿¡¼­ »óÇ°ºÐ·ù¸¦ ¼±ÅÃÇÏ¸é ÇØ´ç »óÇ° ¸®½ºÆ®°¡ ¿¬ÀÌ¾î ³ªÅ¸³³´Ï´Ù.<br>
            »óÇ°¸®½ºÆ®¿¡¼­ °ü·Ã »óÇ°À¸·Î Ãß°¡ÇÏ½Ã¸é ¼±ÅÃµÈ °ü·Ã»óÇ° ¸ñ·Ï¿¡ <strong>ÇÔ²²</strong> Ãß°¡µË´Ï´Ù.<br>
            ¿¹¸¦ µé¾î, A »óÇ°¿¡ B »óÇ°À» °ü·Ã»óÇ°À¸·Î µî·ÏÇÏ¸é B »óÇ°¿¡µµ A »óÇ°ÀÌ °ü·Ã»óÇ°À¸·Î ÀÚµ¿ Ãß°¡µÇ¸ç, <strong>È®ÀÎ ¹öÆ°À» ´©¸£¼Å¾ß Á¤»ó ¹Ý¿µµË´Ï´Ù.</strong>
        </p>
    </div>

    <div class="compare_wrap">
        <section class="compare_left">
            <h3>µî·ÏµÈ ÀüÃ¼»óÇ° ¸ñ·Ï</h3>
            <label for="sch_relation" class="sound_only">»óÇ°ºÐ·ù</label>
            <span class="srel_pad">
                <select id="sch_relation">
                    <option value=''>ºÐ·ùº° »óÇ°</option>
                    <?php
                        $sql = " select * from {$g5['g5_shop_category_table']} ";
                        if ($is_admin != 'super')
                            $sql .= " where ca_mb_id = '{$member['mb_id']}' ";
                        $sql .= " order by ca_order, ca_id ";
                        $result = sql_query($sql);
                        for ($i=0; $row=sql_fetch_array($result); $i++)
                        {
                            $len = strlen($row['ca_id']) / 2 - 1;

                            $nbsp = "";
                            for ($i=0; $i<$len; $i++)
                                $nbsp .= "&nbsp;&nbsp;&nbsp;";

                            echo "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
                        }
                    ?>
                </select>
                <label for="sch_name" class="sound_only">»óÇ°¸í</label>
                <input type="text" name="sch_name" id="sch_name" class="frm_input" size="15">
                <button type="button" id="btn_search_item" class="btn_frmline">°Ë»ö</button>
            </span>
            <div id="relation" class="srel_list">
                <p>»óÇ°ÀÇ ºÐ·ù¸¦ ¼±ÅÃÇÏ½Ã°Å³ª »óÇ°¸íÀ» ÀÔ·ÂÇÏ½Å ÈÄ °Ë»öÇÏ¿© ÁÖ½Ê½Ã¿À.</p>
            </div>
            <script>
            $(function() {
                $("#btn_search_item").click(function() {
                    var ca_id = $("#sch_relation").val();
                    var it_name = $.trim($("#sch_name").val());
                    var $relation = $("#relation");

                    if(ca_id == "" && it_name == "") {
                        $relation.html("<p>»óÇ°ÀÇ ºÐ·ù¸¦ ¼±ÅÃÇÏ½Ã°Å³ª »óÇ°¸íÀ» ÀÔ·ÂÇÏ½Å ÈÄ °Ë»öÇÏ¿© ÁÖ½Ê½Ã¿À.</p>");
                        return false;
                    }

                    $("#relation").load(
                        "./itemformrelation.php",
                        { it_id: "<?php echo $it_id; ?>", ca_id: ca_id, it_name: it_name }
                    );
                });

                $(document).on("click", "#relation .add_item", function() {
                    // ÀÌ¹Ì µî·ÏµÈ »óÇ°ÀÎÁö Ã¼Å©
                    var $li = $(this).closest("li");
                    var it_id = $li.find("input:hidden").val();
                    var it_id2;
                    var dup = false;
                    $("#reg_relation input[name='re_it_id[]']").each(function() {
                        it_id2 = $(this).val();
                        if(it_id == it_id2) {
                            dup = true;
                            return false;
                        }
                    });

                    if(dup) {
                        alert("ÀÌ¹Ì ¼±ÅÃµÈ »óÇ°ÀÔ´Ï´Ù.");
                        return false;
                    }

                    var cont = "<li>"+$li.html().replace("add_item", "del_item").replace("Ãß°¡", "»èÁ¦")+"</li>";
                    var count = $("#reg_relation li").length;

                    if(count > 0) {
                        $("#reg_relation li:last").after(cont);
                    } else {
                        $("#reg_relation").html("<ul>"+cont+"</ul>");
                    }

                    $li.remove();
                });

                $(document).on("click", "#reg_relation .del_item", function() {
                    if(!confirm("»óÇ°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
                        return false;

                    $(this).closest("li").remove();

                    var count = $("#reg_relation li").length;
                    if(count < 1)
                        $("#reg_relation").html("<p>¼±ÅÃµÈ »óÇ°ÀÌ ¾ø½À´Ï´Ù.</p>");
                });
            });
            </script>
        </section>

        <section class="compare_right">
            <h3>¼±ÅÃµÈ °ü·Ã»óÇ° ¸ñ·Ï</h3>
            <span class="srel_pad"></span>
            <div id="reg_relation" class="srel_sel">
                <?php
                $str = array();
                $sql = " select b.ca_id, b.it_id, b.it_name, b.it_price
                           from {$g5['g5_shop_item_relation_table']} a
                           left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id)
                          where a.it_id = '$it_id'
                          order by ir_no asc ";
                $result = sql_query($sql);
                for($g=0; $row=sql_fetch_array($result); $g++)
                {
                    $it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];

                    if($g==0)
                        echo '<ul>';
                ?>
                    <li>
                        <input type="hidden" name="re_it_id[]" value="<?php echo $row['it_id']; ?>">
                        <div class="list_item"><?php echo $it_name; ?></div>
                        <div class="list_item_btn"><button type="button" class="del_item btn_frmline">»èÁ¦</button></div>
                    </li>
                <?php
                    $str[] = $row['it_id'];
                }
                $str = implode(",", $str);

                if($g > 0)
                    echo '</ul>';
                else
                    echo '<p>¼±ÅÃµÈ »óÇ°ÀÌ ¾ø½À´Ï´Ù.</p>';
                ?>
            </div>
            <input type="hidden" name="it_list" value="<?php echo $str; ?>">
        </section>

    </div>

</section>


<section id="anc_sitfrm_event" class="srel">
    <h2 class="h2_frm">°ü·ÃÀÌº¥Æ®</h2>
    <?php echo $pg_anchor; ?>

    <div class="compare_wrap">
        <section class="compare_left">
            <h3>µî·ÏµÈ ÀüÃ¼ÀÌº¥Æ® ¸ñ·Ï</h3>
            <div id="event_list" class="srel_list srel_noneimg">
                <?php
                $sql = " select ev_id, ev_subject from {$g5['g5_shop_event_table']} order by ev_id desc ";
                $result = sql_query($sql);
                for ($g=0; $row=sql_fetch_array($result); $g++) {
                    if($g == 0)
                        echo '<ul>';
                ?>
                    <li>
                        <input type="hidden" name="ev_id[]" value="<?php echo $row['ev_id']; ?>">
                        <div class="list_item"><?php echo get_text($row['ev_subject']); ?></div>
                        <div class="list_item_btn"><button type="button" class="add_event btn_frmline">Ãß°¡</button></div>
                    </li>
                <?php
                }

                if($g > 0)
                    echo '</ul>';
                else
                    echo '<p>µî·ÏµÈ ÀÌº¥Æ®°¡ ¾ø½À´Ï´Ù.</p>';
                ?>
            </div>
            <script>
            $(function() {
                $(document).on("click", "#event_list .add_event", function() {
                    // ÀÌ¹Ì µî·ÏµÈ ÀÌº¥Æ®ÀÎÁö Ã¼Å©
                    var $li = $(this).closest("li");
                    var ev_id = $li.find("input:hidden").val();
                    var ev_id2;
                    var dup = false;
                    $("#reg_event_list input[name='ev_id[]']").each(function() {
                        ev_id2 = $(this).val();
                        if(ev_id == ev_id2) {
                            dup = true;
                            return false;
                        }
                    });

                    if(dup) {
                        alert("ÀÌ¹Ì ¼±ÅÃµÈ ÀÌº¥Æ®ÀÔ´Ï´Ù.");
                        return false;
                    }

                    var cont = "<li>"+$li.html().replace("add_event", "del_event").replace("Ãß°¡", "»èÁ¦")+"</li>";
                    var count = $("#reg_event_list li").length;

                    if(count > 0) {
                        $("#reg_event_list li:last").after(cont);
                    } else {
                        $("#reg_event_list").html("<ul>"+cont+"</ul>");
                    }
                });

                $(document).on("click", "#reg_event_list .del_event", function() {
                    if(!confirm("»óÇ°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
                        return false;

                    $(this).closest("li").remove();

                    var count = $("#reg_event_list li").length;
                    if(count < 1)
                        $("#reg_event_list").html("<p>¼±ÅÃµÈ ÀÌº¥Æ®°¡ ¾ø½À´Ï´Ù.</p>");
                });
            });
            </script>
        </section>

        <section class="compare_right">
            <h3>¼±ÅÃµÈ °ü·ÃÀÌº¥Æ® ¸ñ·Ï</h3>
            <div id="reg_event_list" class="srel_sel srel_noneimg">
                <?php
                $str = "";
                $comma = "";
                $sql = " select b.ev_id, b.ev_subject
                           from {$g5['g5_shop_event_item_table']} a
                           left join {$g5['g5_shop_event_table']} b on (a.ev_id=b.ev_id)
                          where a.it_id = '$it_id'
                          order by b.ev_id desc ";
                $result = sql_query($sql);
                for ($g=0; $row=sql_fetch_array($result); $g++) {
                    $str .= $comma . $row['ev_id'];
                    $comma = ",";

                    if($g == 0)
                        echo '<ul>';
                ?>
                    <li>
                        <input type="hidden" name="ev_id[]" value="<?php echo $row['ev_id']; ?>">
                        <div class="list_item"><?php echo get_text($row['ev_subject']); ?></div>
                        <div class="list_item_btn"><button type="button" class="del_event btn_frmline">»èÁ¦</button></div>
                    </li>
                <?php
                }

                if($g > 0)
                    echo '</ul>';
                else
                    echo '<p>¼±ÅÃµÈ ÀÌº¥Æ®°¡ ¾ø½À´Ï´Ù.</p>';
                ?>
            </div>
            <input type="hidden" name="ev_list" value="<?php echo $str; ?>">
        </section>
    </div>

</section>


<section id="anc_sitfrm_optional">
    <h2 class="h2_frm">»ó¼¼¼³¸í¼³Á¤</h2>
    <?php echo $pg_anchor; ?>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <caption>»ó¼¼¼³¸í¼³Á¤</caption>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_3">
        </colgroup>
        <tbody>
        <tr>
            <th scope="row">»óÇ°»ó´Ü³»¿ë</th>
            <td><?php echo help("»óÇ°»ó¼¼¼³¸í ÆäÀÌÁö »ó´Ü¿¡ Ãâ·ÂÇÏ´Â HTML ³»¿ëÀÔ´Ï´Ù."); ?><?php echo editor_html('it_head_html', get_text(html_purifier($it['it_head_html']), 0)); ?></td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_head_html" value="1" id="chk_ca_it_head_html">
                <label for="chk_ca_it_head_html">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_head_html" value="1" id="chk_all_it_head_html">
                <label for="chk_all_it_head_html">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row">»óÇ°ÇÏ´Ü³»¿ë</th>
            <td><?php echo help("»óÇ°»ó¼¼¼³¸í ÆäÀÌÁö ÇÏ´Ü¿¡ Ãâ·ÂÇÏ´Â HTML ³»¿ëÀÔ´Ï´Ù."); ?><?php echo editor_html('it_tail_html', get_text(html_purifier($it['it_tail_html']), 0)); ?></td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_tail_html" value="1" id="chk_ca_it_tail_html">
                <label for="chk_ca_it_tail_html">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_tail_html" value="1" id="chk_all_it_tail_html">
                <label for="chk_all_it_tail_html">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row">¸ð¹ÙÀÏ »óÇ°»ó´Ü³»¿ë</th>
            <td><?php echo help("¸ð¹ÙÀÏ »óÇ°»ó¼¼¼³¸í ÆäÀÌÁö »ó´Ü¿¡ Ãâ·ÂÇÏ´Â HTML ³»¿ëÀÔ´Ï´Ù."); ?><?php echo editor_html('it_mobile_head_html', get_text(html_purifier($it['it_mobile_head_html']), 0)); ?></td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_mobile_head_html" value="1" id="chk_ca_it_mobile_head_html">
                <label for="chk_ca_it_mobile_head_html">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_mobile_head_html" value="1" id="chk_all_it_mobile_head_html">
                <label for="chk_all_it_mobile_head_html">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <tr>
            <th scope="row">¸ð¹ÙÀÏ »óÇ°ÇÏ´Ü³»¿ë</th>
            <td><?php echo help("¸ð¹ÙÀÏ »óÇ°»ó¼¼¼³¸í ÆäÀÌÁö ÇÏ´Ü¿¡ Ãâ·ÂÇÏ´Â HTML ³»¿ëÀÔ´Ï´Ù."); ?><?php echo editor_html('it_mobile_tail_html', get_text(html_purifier($it['it_mobile_tail_html']), 0)); ?></td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_it_mobile_tail_html" value="1" id="chk_ca_it_mobile_tail_html">
                <label for="chk_ca_it_mobile_tail_html">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_it_mobile_tail_html" value="1" id="chk_all_it_mobile_tail_html">
                <label for="chk_all_it_mobile_tail_html">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        </tbody>
        </table>
    </div>
</section>


<section id="anc_sitfrm_extra">
    <h2>¿©ºÐÇÊµå ¼³Á¤</h2>
    <?php echo $pg_anchor ?>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <colgroup>
            <col class="grid_4">
            <col>
            <col class="grid_3">
        </colgroup>
        <tbody>
        <?php for ($i=1; $i<=10; $i++) { ?>
        <tr>
            <th scope="row">¿©ºÐÇÊµå<?php echo $i ?></th>
            <td class="td_extra">
                <label for="it_<?php echo $i ?>_subj">¿©ºÐÇÊµå <?php echo $i ?> Á¦¸ñ</label>
                <input type="text" name="it_<?php echo $i ?>_subj" id="it_<?php echo $i ?>_subj" value="<?php echo get_text($it['it_'.$i.'_subj']) ?>" class="frm_input">
                <label for="it_<?php echo $i ?>">¿©ºÐÇÊµå <?php echo $i ?> °ª</label>
                <input type="text" name="it_<?php echo $i ?>" value="<?php echo get_text($it['it_'.$i]) ?>" id="it_<?php echo $i ?>" class="frm_input">
            </td>
            <td class="td_grpset">
                <input type="checkbox" name="chk_ca_<?php echo $i ?>" value="1" id="chk_ca_<?php echo $i ?>">
                <label for="chk_ca_<?php echo $i ?>">ºÐ·ùÀû¿ë</label>
                <input type="checkbox" name="chk_all_<?php echo $i ?>" value="1" id="chk_all_<?php echo $i ?>">
                <label for="chk_all_<?php echo $i ?>">ÀüÃ¼Àû¿ë</label>
            </td>
        </tr>
        <?php } ?>
        <?php if ($w == "u") { ?>
        <tr>
            <th scope="row">ÀÔ·ÂÀÏ½Ã</th>
            <td colspan="2">
                <?php echo help("»óÇ°À» Ã³À½ ÀÔ·Â(µî·Ï)ÇÑ ½Ã°£ÀÔ´Ï´Ù."); ?>
                <?php echo $it['it_time']; ?>
            </td>
        </tr>
        <tr>
            <th scope="row">¼öÁ¤ÀÏ½Ã</th>
            <td colspan="2">
                <?php echo help("»óÇ°À» ÃÖÁ¾ ¼öÁ¤ÇÑ ½Ã°£ÀÔ´Ï´Ù."); ?>
                <?php echo $it['it_update_time']; ?>
            </td>
        </tr>
        <?php } ?>
        </tbody>
        </table>
    </div>
</section>

<div class="btn_fixed_top">
    <a href="./itemlist.php?<?php echo $qstr; ?>" class="btn btn_02">¸ñ·Ï</a>
    <a href="<?php echo shop_item_url($it_id); ?>" class="btn_02  btn">»óÇ°º¸±â</a>
    <input type="submit" value="È®ÀÎ" class="btn_submit btn" accesskey="s">
</div>
</form>


<script>
var f = document.fitemform;

<?php if ($w == 'u') { ?>
$(".banner_or_img").addClass("sit_wimg");
$(function() {
    $(".sit_wimg_view").bind("click", function() {
        var sit_wimg_id = $(this).attr("id").split("_");
        var $img_display = $("#"+sit_wimg_id[1]);

        $img_display.toggle();

        if($img_display.is(":visible")) {
            $(this).text($(this).text().replace("È®ÀÎ", "´Ý±â"));
        } else {
            $(this).text($(this).text().replace("´Ý±â", "È®ÀÎ"));
        }

        var $img = $("#"+sit_wimg_id[1]).children("img");
        var width = $img.width();
        var height = $img.height();
        if(width > 700) {
            var img_width = 700;
            var img_height = Math.round((img_width * height) / width);

            $img.width(img_width).height(img_height);
        }
    });
    $(".sit_wimg_close").bind("click", function() {
        var $img_display = $(this).parents(".banner_or_img");
        var id = $img_display.attr("id");
        $img_display.toggle();
        var $button = $("#it_"+id+"_view");
        $button.text($button.text().replace("´Ý±â", "È®ÀÎ"));
    });
});
<?php } ?>

function codedupcheck(id)
{
    if (!id) {
        alert('»óÇ°ÄÚµå¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
        f.it_id.focus();
        return;
    }

    var it_id = id.replace(/[A-Za-z0-9\-_]/g, "");
    if(it_id.length > 0) {
        alert("»óÇ°ÄÚµå´Â ¿µ¹®ÀÚ, ¼ýÀÚ, -, _ ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
        return false;
    }

    $.post(
        "./codedupcheck.php",
        { it_id: id },
        function(data) {
            if(data.name) {
                alert("ÄÚµå '"+data.code+"' ´Â '".data.name+"' (À¸)·Î ÀÌ¹Ì µî·ÏµÇ¾î ÀÖÀ¸¹Ç·Î\n\n»ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
                return false;
            } else {
                alert("'"+data.code+"' Àº(´Â) µî·ÏµÈ ÄÚµå°¡ ¾øÀ¸¹Ç·Î »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
                document.fitemform.codedup.value = '';
            }
        }, "json"
    );
}

function fitemformcheck(f)
{
    if (!f.ca_id.value) {
        alert("±âº»ºÐ·ù¸¦ ¼±ÅÃÇÏ½Ê½Ã¿À.");
        f.ca_id.focus();
        return false;
    }

    if (f.w.value == "") {
        var error = "";
        $.ajax({
            url: "./ajax.it_id.php",
            type: "POST",
            data: {
                "it_id": f.it_id.value
            },
            dataType: "json",
            async: false,
            cache: false,
            success: function(data, textStatus) {
                error = data.error;
            }
        });

        if (error) {
            alert(error);
            return false;
        }
    }

    if(f.it_point_type.value == "1" || f.it_point_type.value == "2") {
        var point = parseInt(f.it_point.value);
        if(point < 0 || point > 99) {
            alert("Æ÷ÀÎÆ® ºñÀ²À» 0°ú 99 »çÀÌÀÇ °ªÀ¸·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
            f.it_point.focus();
            f.it_point.select();
            return false;
        }
    }

    if(parseInt(f.it_sc_type.value) > 1) {
        if(!f.it_sc_price.value || f.it_sc_price.value == "0") {
            alert("±âº»¹è¼Ûºñ¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
            return false;
        }

        if(f.it_sc_type.value == "2" && (!f.it_sc_minimum.value || f.it_sc_minimum.value == "0")) {
            alert("¹è¼Ûºñ »ó¼¼Á¶°ÇÀÇ ÁÖ¹®±Ý¾×À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
            return false;
        }

        if(f.it_sc_type.value == "4" && (!f.it_sc_qty.value || f.it_sc_qty.value == "0")) {
            alert("¹è¼Ûºñ »ó¼¼Á¶°ÇÀÇ ÁÖ¹®¼ö·®À» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
            return false;
        }
    }

    // °ü·Ã»óÇ°Ã³¸®
    var item = new Array();
    var re_item = it_id = "";

    $("#reg_relation input[name='re_it_id[]']").each(function() {
        it_id = $(this).val();
        if(it_id == "")
            return true;

        item.push(it_id);
    });

    if(item.length > 0)
        re_item = item.join();

    $("input[name=it_list]").val(re_item);

    // ÀÌº¥Æ®Ã³¸®
    var evnt = new Array();
    var ev = ev_id = "";

    $("#reg_event_list input[name='ev_id[]']").each(function() {
        ev_id = $(this).val();
        if(ev_id == "")
            return true;

        evnt.push(ev_id);
    });

    if(evnt.length > 0)
        ev = evnt.join();

    $("input[name=ev_list]").val(ev);

    <?php echo get_editor_js('it_explan'); ?>
    <?php echo get_editor_js('it_mobile_explan'); ?>
    <?php echo get_editor_js('it_head_html'); ?>
    <?php echo get_editor_js('it_tail_html'); ?>
    <?php echo get_editor_js('it_mobile_head_html'); ?>
    <?php echo get_editor_js('it_mobile_tail_html'); ?>

    return true;
}

function categorychange(f)
{
    var idx = f.ca_id.value;

    if (f.w.value == "" && idx)
    {
        f.it_use.checked = ca_use[idx] ? true : false;
        f.it_stock_qty.value = ca_stock_qty[idx];
        f.it_sell_email.value = ca_sell_email[idx];
    }
}

categorychange(document.fitemform);


function readURL(input, num) {
		if (input.files && input.files[0]) {
		var reader = new FileReader();

		reader.onload = function (e) {
				$('#View'+num).attr('src', e.target.result);
				$('#View'+num).css('display', '');
			}

		  reader.readAsDataURL(input.files[0]);
		}
	}


</script>

<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');