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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
<?php include("./_common.php"); include($j3_adm_path."/shop_header.php");
if($idx!=''){ $sql = "select * from shop_mail a where idx = '$idx' "; $res = mysql_query($sql,$connect_j3); $cinfo = mysql_fetch_array($res); } ?> <div id="wrap" class='container_wrap'> <div id="sub-title"> <h2>거래처 메일발송</h2> <div class="sub-location"> <a href="./index.php" class="home"><span class="screen_out">홈</span></a> <span class="location-gt"></span> <a>거래처관리</a> <span class="location-gt"></span> <a>거래처 메일발송</a> </div> </div>
<form name='mail_send_form' method='post' action='mail_send_process.php'> <input type='hidden' name='qstr' value=''> <input type='hidden' name='idx' value='<?php echo $cinfo['idx'];?>'> <input type='hidden' name='email_list' value=''> <input type='hidden' name='mode' value=''>
<div class='cust_modal1'> <h4>거래처 조건</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">거래처 조건</caption> <colgroup> <col style="width:190px;"><col style="width:900px;"> </colgroup>
<tbody> <tr> <th>거래처 종류</th> <td colspan=5> <input type='radio' name='cust_type' value='all' id='send_all'> <label for='send_all'>전체거래처(기타조건 포함)</label> <input type='radio' name='cust_type' value='sel' id='send_cust' checked> <label for='send_cust'>선택거래처(기타조건 불포함)</label> </td> </tr> <tr class='cust_selection'> <th>선택 거래처<br><span class='cust_open'>[검색창열기]</span></th> <td colspan=5> <select name='send_email' id='send_email' style='width:300px; height:200px;margin-top:5px;' multiple='multiple'> </select> <a class='all_del_email'>전체삭제</a><a> / </a><a class='sel_del_email'>선택삭제</a> </td> </tr> </table> </div>
<div class='cust_modal1'> <h4>기타 조건</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">기타 조건</caption> <colgroup> <col style="width:190px;"><col style="width:900px;"> </colgroup>
<tbody> <tr> <th>메일링</th> <td colspan=5> <input type='radio' name='mailing_type' value='1' checked> 수신동의한 거래처 <input type='radio' name='mailing_type' value='0'> 전체거래처 <span class='help_info'>수신동의하지 않는 거래처에 광고메일을 보낼경우 법적 처벌을 받을수도 있습니다.</span> </td> </tr> <tr> <th>회원권한</th> <td colspan=5> <select name='cust_level'> <option value='all'>--전체--</option> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> </select> </td> </tr> <tr> <th>특정메일주소만</th> <td colspan=5> <input type='text' name='mail_addr_search' value=''> <span class='help_info'>메일에 특정 서버만 보낼경우(@naver.com)나 빠르게 회원전체를 놓고 특정 메일 1개(admin@domain.com)만 보낼경우 사용</span> </td> </tr> </table> </div> </form> <div id="sub-contents-area" style='padding-left:500px;padding-top:20px;'> <div class="sub-btn-area"> <div class="sub-btn"> <a class="lignt-blue-btn" id='btn_email_send'>메일 보내기</a> <a class="gray-btn" id='btn_cancel_save'>취소</a> </div> </div> </div> </div> <!-- wrap end--> <script> function form_save(){ // 거래처 저장/수정 var form_obj = $("form[name='customer_reg_form']"); if($(form_obj).find("input[name='code']").val()==''){ if($(form_obj).find("input[name='code_auto']").is(":checked")==false){ if($(form_obj).find("input[name='code1']").val()==''){ alert('코드를 입력하세요.'); return; } } }
if($(form_obj).find("input[name='comp_name']").val()==''){ alert('상호명을 입력하세요.'); return; } if($(form_obj).find("input[name='login_id']").val()==''){ alert('로그인 아이디를 입력하세요.'); return; } if($(form_obj).find("input[name='login_password']").val()==''){ alert('로그인 비밀번호를 입력하세요.'); return; }
$(form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if(confirm('저장하시겠습니까?')){ var form_data = $(form_obj).serialize();
$.ajax({type:"post", url:"ajax.customer_reg_process.php", data:form_data, async:false, 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_code = $(xml).find("code").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { document.location.href='?<?php echo $qstr."&time=".time();?>&code='+v_code; } }, error:function(rtn,status,error){ alert(error); } }); } //$(form_obj).submit(); }
$(function(){ $("input[name='cust_type']").click(function(){ // 거래처 종류 선택 $val = $(this).val(); if($val=='all'){ $(".cust_selection").hide(); } else { $(".cust_selection").show(); } });
$(".all_del_email").click(function(){ // 선택 거래처 전체 삭제 if(confirm('정말로 전체 삭제하시겠습니까?')){ $("#send_email option").remove(); } });
$(".sel_del_email").click(function(){ // 선택 거래처 선택 삭제 $("#send_email option").each(function(){ if($(this).is(":selected")){ $(this).remove(); } }); });
$(".cust_open").css("cursor","pointer").click(function(){ $.get("customer_list.inc.php",function(rtn){ $("#modal_member_box").html(rtn).dialog({ resizable: true, height:740, width:1000, modal: true, title:"거래처 [검색]", buttons: { 선택: function() { email_sel_add(); }, 닫기: function() { $( this ).dialog( "close" ); } } }); $("#modal_member_box").css("left","0px;"); }); });
$("#btn_email_send").click(function(){ form_save(); });
$("#btn_cancel_save").click(function(){ // 취소 버튼 document.location.href='mail_list.php?<?php echo $_COOKIE['qstr'];?>'; }); })
function email_sel_add(){ // 선택된 이메일 리스트 추가 $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")){ $tr_obj = $(this).closest("tr"); $val = $tr_obj.find("input[name='email[]']").val(); if($val!=''){ add_email($val); } } }); $("input[name='code_idx[]']").prop("checked",false); }
function add_email(v_email){ if(v_email=='@'){ return; } var vv = "Y"; $("#send_email option").each(function(){ if(v_email==$(this).val()){ vv = "N"; } }); if(v_email!='' && vv=="Y"){ $("#send_email").append("<option value='"+v_email+"'>"+v_email+"</option>"); } }
function form_save(){ if($("#send_cust").is(":checked")){ email_no_list = ""; $("#send_email option").each(function(){ email_no_list = email_no_list+$(this).val()+","; }); $("input[name='email_list']").val(email_no_list); if(email_no_list==''){ alert('검색창열기 버튼을 눌러서 메일보낼 거래처의 메일을 선택하시기 바랍니다.'); return; } } var form_data = $("form[name='mail_send_form']").serialize(); form_data = form_data+"&mode=ajax"; $.get("mail_send_process.php?"+form_data,function(rtn){ $form = $("form[name='mail_send_form']"); if(confirm('해당 조건으로 전송가능한 메일이 '+rtn+'개 있습니다. \n\n정말로 메일을 보내시겠습니까?')){ $form.submit(); } }); } </script> <?php include($j3_adm_path."/shop_footer.php"); ?> <div id="modal_member_box" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
|