/home/mjc1/public_html/j3demo/shopm/board_new.inc.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
<?php
include_once("./_common.php");

$bbsinfo bbs_info($b_table); // 게시판 정보 가져오기
//$cust_info = customer_info_get($id_ccode); // 회원 정보 가져오기
$cust_info $cinfo;

if(
$idx!=''){
    
$cinfo board_info_get($bbsinfo,$idx);
    
$b_file_array $cinfo['file_array'];
    if(
$cinfo['w_ccode']!=$id_ccode && $cinfo['w_login_id']!=''){ alert('수정하실 권한이 없습니다.'); exit; }
} else if(
$pcode!=''){
    
$pinfo board_info_get($bbsinfo,$pcode);

    
$cinfo['w_name'] = $cust_info['comp_name'];
    
$cinfo['w_email'] = $cust_info['email'];
    
$cinfo['w_subject'] = "Re: {$pinfo['w_subject']}";
} else {
    
$cinfo['w_name'] = $cust_info['comp_name'];
    
$cinfo['w_email'] = $cust_info['email'];
}

if(
$bbsinfo['b_uload_lv']<=$cust_info['mb_lv']){
    for(
$i=0;$i<$bbsinfo['b_file_cnt'];$i++){
        
$파일필드[$i] = "<input type='file' name='add_file[]'>";
        
$file_info $b_file_array[$i];
        if(
$file_info['idx']!=''){
            
$파일필드[$i] .= "&nbsp;<a href='{$j3_adm_url}/board_download.php?b_table={$b_table}&idx={$idx}&b_no={$i}'>{$file_info['b_oriname']}</a>";
            
$파일필드[$i] .= "&nbsp;<input type='checkbox' name='add_file_del_{$i}' value='1'> 삭제";
        }
        
$파일필드[$i] .= "<br>";
    }
} else {
    
$파일숨김클래스 "screen_out";
}

if(
$bbsinfo['b_file_cnt']==0){ $파일숨김클래스 "screen_out"; }
if(
$bbsinfo['b_cate']==''){ $분류숨김클래스 "screen_out"; }
else{
    
$분류필드 "<select name='w_cate'>";
    
$cate_array explode("|",$bbsinfo['b_cate']);
    
$분류필드 .= "<option value=''>--선택--</option>";
    foreach(
$cate_array as $key=>$val){
        if(
$cinfo['w_cate']==$val){ $std "selected"; } else { $std ""; }
        
$분류필드 .= "<option value='{$val}{$std}>{$val}</option>";
    }
    
$분류필드 .= "</select>";
}

if(
$id_ccode!=''){    $비번숨김클래스 "screen_out"; } // 비회원일때만 비번보임


$히든필드 "<input type='hidden' name='qstr' value=''>
    <input type='hidden' name='idx' value='
{$idx}'>
    <input type='hidden' name='pcode' value='
{$pcode}'>
    <input type='hidden' name='b_table' value='
{$b_table}'>
"
;

if(
$idx==''){
    
$title "작성";
} else {
    
$title "수정";
}
?>
<form name='board_reg_form' id='board_reg_form' method='post' action='<?php echo $j3_shopp_url;?>/ajax.board_reg_process.php' enctype="multipart/form-data">
<?php echo $히든필드;?>

<div class="width_full">
    <h1 class="screen_out">게시판</h1>
    <table class="width_full txt14 black_line_t">
        <caption class="mt15 mb5 l_height24 txt15 align_l bold"><?php echo $bbsinfo['b_title'];?> 게시판 <?php echo $title?></caption>
        <colgroup>
            <col class="width_30"><col>
        </colgroup>
        <tbody>
        <tr class='<?php echo $분류숨김클래스;?>'>
            <th class="p3 gray_line_b2">분류</th>
            <td colspan="3" class="p3 gray_line_b2">
                <?php echo $분류필드;?>
            </td>
        </tr>
        <tr>
            <th class="p3 gray_line_b2">작성자</th>
            <td class="p3 gray_line_b2">
                <input type='text' name='w_name' class="width_full height26 gray_line" value='<?php echo $cinfo['w_name'];?>'>
            </td>
        </tr>
        <tr>
            <th class="p3 gray_line_b2">이메일</th>
            <td class="p3 gray_line_b2">
                <input type='text' name='w_email' class="width_full height26 gray_line" value='<?php echo $cinfo['w_email'];?>'>
            </td>
        </tr>
        <tr class='<?php echo $비번숨김클래스;?> password_tr_class'>
            <th class="p3 gray_line_b2">비밀번호</th>
            <td class="p3 gray_line_b2">
                <input type='password' name='w_passwd' class="width_full height26 gray_line" value=''>
            </td>
        </tr>
        <tr>
            <th class="p3 gray_line_b2">제목</th>
            <td class="p3 gray_line_b2">
                <input type='text' name='w_subject' class="width_full height26 gray_line" value='<?php echo $cinfo['w_subject'];?>'>
            </td>
        </tr>
        <tr>
            <th class="p3 gray_line_b2">내용</th>
            <td class="p3 gray_line_b2">
                <textarea name='w_content' id='w_content' class="width_full height80 gray_line"><?php echo br2nl($cinfo['w_content']);?></textarea>
            </td>
        </tr>
        <tr class='<?php echo $파일숨김클래스;?>'>
            <th class="p3 gray_line_b2">첨부파일</th>
            <td class="p3 gray_line_b2">
                <?php 
                    
foreach($파일필드 as $key=>$val){
                        echo 
$val;
                    }
                
?>
            </td>
        </tr>        
        <tr class='<?php echo $비번숨김클래스;?>'>
            <th class="p3 gray_line_b2">스팸방지 코드</th>
            <td class="p3 gray_line_b2">
<?php 
    
// 스팸방지 확인 적용 JS에서 human_check() 함수이용 true일경우 진행 POST된 값에서 $_REQUEST['g-recaptcha-response'] 값이 있으면 true
    
include_once("{$j3_lib_path}/scaptcha/simple-php-captcha.php");
    
$captcha simple_php_captcha();
    
$_SESSION['captcha'] = $captcha;
    
$_SESSION['captcha_code'] = $captcha['code'];
    
$c_code captcha_str_ch($_SESSION['captcha']['code']);
    echo 
"<ul><li style='float:left;line-height:28px;' class='txt21'>{$c_code}</li>";
    echo 
"<li style='mt5'><input type='text' name='captcha_input' class='width_full height26 gray_line'></li></ul>";
?>
            </td>
        </tr>        
    </table>
</div>
</form>