/home/mjc1/public_html/otms_old/qa_view.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
$dir 
".";
include_once(
$dir."/_common.php");
include(
'./header.php'); 

if(
$eid==''){
    
alert('로그인 후에 이용가능합니다.',"index.php"); exit;
}

if(
$idx!=''){
    
$sql "select a.* from zom_prod_qa a left join zom_product b on a.p_code = b.p_code where a.idx = '{$idx}' ";
    
$cinfo sql_fetch($sql,$connect_om);
    
//_pr($cinfo);
}


$qstr $_SERVER['QUERY_STRING'];
?>
<script src="./lib/ckeditor/ckeditor.js"></script>
<!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>-->
<div id="contents" style="height:2px;border-bottom:1px solid #eee;background:#2f6ba9">
    <span class="screen_out">header 하단 선</span>
</div>

<div id="wrap">
    <div id="sub-title">
        <h2>상품Q&A 관리</h2>
        <div class="sub-location">
            <a href="./index.php" class="home"><span class="screen_out">홈</span></a>
            <span class="location-gt"></span>
            <a>Q&A 관리</a>
            <span class="location-gt"></span>
            <a>상품Q&A 관리</a>
        </div>
    </div>

<form name='qa_form' id="qa_form" method='post' action="" enctype="multipart/form-data" onsubmit='return false;'>
    <input type='hidden' name='sel_del' value=''>
    <input type='hidden' name='all_del' value=''>
    <input type='hidden' name='idx' value='<?php echo $idx;?>'>

    
    <div class="sub-write-area" style='display:block;width:1200px;'>
        <h4 style='font-size:14px; font-weight:bold;margin-top:10px;'>기본 정보</h4>
        <div class="order-sheet-area" style='width:1200px;'>
            <table class="order-sheet">
                <caption class="screen_out">기본 정보</caption>
                <colgroup>
                    <col style="width:150px;"><col style="width:350px;">
                    <col style="width:150px;"><col style="width:350px;">
                </colgroup>

                <tbody>
                <tr>
                    <th>사이트</th>
                    <td colspan=3 class='linetxt'><?php echo $site_name[$cinfo['om_site']];?></td>
                </tr>
                <tr>
                    <th>상품코드</th>
                    <td class='linetxt'><?php echo $cinfo['p_code'?></td>
                    <th>상품명</th>
                    <td class='linetxt'><?php echo $cinfo['p_name'?></td>
                </tr>
                <tr>
                    <th>문의코드</th>
                    <td class='linetxt'><?php echo $cinfo['qa_code'?></td>
                    <th>문의 제목</th>
                    <td class='linetxt'><?php echo $cinfo['qa_subject'?></td>
                </tr>
                <tr>
                    <th>문의자 ID</th>
                    <td class='linetxt'><?php echo $cinfo['mem_id'?></td>
                    <th>표시여부</th>
                    <td class='linetxt'><?php echo $cinfo['disp_yn'?></td>
                </tr>
                <tr>
                    <th>상품구매여부</th>
                    <td class='linetxt'><?php echo $cinfo['buy_yn'?></td>
                    <th>답변여부</th>
                    <td class='linetxt'><?php echo $cinfo['ans_yn'?></td>
                </tr>
                <tr>
                    <th>문의코드</th>
                    <td class='linetxt'><?php echo $cinfo['qa_grp_no'?></td>
                    <th>문의 제목</th>
                    <td class='linetxt'><?php echo $cinfo['qa_grp_name'?></td>
                </tr>
                <tr>
                    <th>문의내용</th>
                    <td class='linetxt' colspan=3>
                        <?php echo nl2br($cinfo['qa_content']) ?>
                    </td>
                </tr>
                <tr>
                    <th>답변내용</th>
                    <td class='linetxt' colspan=3 style='padding-top:5px;'>
                        <textarea name='ans_content' style='width:600px;height:100px;'><?php echo $cinfo['ans_content'?></textarea>
                    </td>
                </tr>
                <tr>
                    <th>답변일자</th>
                    <td class='linetxt' colspan=3 ><?php echo $cinfo['ans_date'?></td>
                </tr>
                <tr>
                    <th>작성일자</th>
                    <td class='linetxt' colspan=3 ><?php echo $cinfo['reg_date'?></td>
                </tr>
    
            </table>
        </div>

        <div id="sub-contents-area" style='padding-left:460px;padding-top:20px;width:100%;'>
        <div class="sub-btn-area">
            <div class="sub-btn">
                <a class="lignt-blue-btn btn_ans_save">답변내용처리</a>
                <a class="gray-btn btn_cancel_save">목록</a>
            </div>
        </div>
</div>

</form>

</div><!--//wrap-->

<script>
var qstr = '<?php echo $qstr;?>';
$(function(){
    $(".check_all_class").click(function(){ // 전체선택 전체선택 해제
        if($(this).is(":checked")){
            $("input[name='seq_idx[]']").prop("checked",true);
        } else {
            $("input[name='seq_idx[]']").prop("checked",false);            
        }
    });

    $(".btn_cancel_save").click(function(){ // 목록으로
        document.location.href='qa.php?<?php echo $qstr."&time=".time();?>';
    });

    $(".btn_ans_save").click(function(){ // 답변내용 처리
        $form_obj = $("#qa_form");
        if(confirm('답변 처리 하시겠습니까?')){
            $form_obj.find("input[name='sel_del']").val("prod_qa_ans");
            form_data = $form_obj.serialize();
            $.ajax({type:"post", url:"ajax.11.prod_qa_process.php", data:form_data, async:true, dataType : "xml", 
                success:function(xml){    
                    var v_mode = $(xml).find("mode").text();
                    var v_mode_ok = $(xml).find("mode_ok").text();
                    var v_msg = $(xml).find("msg").text();
                    var v_prd_cnt = $(xml).find("prd_cnt").text();
                    var v_use_time = $(xml).find("use_time").text();
                    if(v_mode_ok!='Y'){
                        alert(v_msg);
                    } else {
                        alert('처리되었습니다.'+v_use_time+'초');
                        document.location.reload();
                    }
                },
                error:function(rtn,status,error){    alert(error);        }
            });        
        }
    });

});
</script>
<?php include('./footer.php'); ?>