bhq@iemsoft.cn
2018-11-27 e2b48dac099e43f4b3243cdf19a7522e4b5eccbe
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Print</title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="public">
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,../js/transport.org.js,common.js')); ?>
<script language="JavaScript">
<!--
// 这里把JS用到的所有语言都赋值到这里
<?php $_from = $this->_var['lang']['js_languages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
//-->
</script>
<style type="text/css">
body
{
  background-color: #ffffff;
  padding: 0px;
  margin: 0px;
}
 
body, td
{
  font-family: Arial, Verdana, sans-serif;
  font-size: 12px;
}
 
.table_box
{
  border:#77776F 1px solid;
  table-layout: fixed;
}
 
.table_line
{
  border:#77776F 1px solid;
}
 
.select_box
{
  margin:-2;
  width:150px;
  background:#FFFFFF;
  line-height:18px;
  border:0px;
  border-style: none;
  font-size:16px;
}
 
.display_no
{
  display:none;
}
 
.div_play_aray
{
  border-style:#77776F 1px solid;
  margin:0;
  height:100%;
  width:100%;
  overflow:auto;
}
</style>
</head>
<body>
  <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_box">
  <form action="shipping.php" enctype="multipart/form-data" method="post" name="theForm" id="theForm" onsubmit="return validate();">
  <input type="hidden" name="act" value="">
  <input type="hidden" name="shipping" value="<?php echo $this->_var['shipping_id']; ?>">
  <input type="hidden" name="config_lable" value="">
  <input type="hidden" name="print_model" value="2">
  <input type="hidden" name="shipping_name" value="<?php echo $this->_var['shipping']['shipping_name']; ?>">
    <!--菜单栏 start-->
    <tr>
      <td style="overflow:hidden; background-color:#EFEFDE; padding-left:8px;">
        <table width="100%" cellpadding="0" cellspacing="0" border="0" height="50">
          <tr>
            <td align="left">
              <select name="lable" id="lable" class="select_box" onchange="javascript:call_flash('lable_add', this);">
                <option value="" selected="selected"><?php echo $this->_var['lang']['lable_select_notice']; ?></option>
                <?php echo $this->html_options(array('options'=>$this->_var['lang']['lable_box'])); ?>
              </select>
              <input type="button" name="del" id="del" value="<?php echo $this->_var['lang']['del_lable']; ?>" onclick="javascript:call_flash('lable_del', this);">
            </td>
            <td id="pic_control_upload" <?php if ($this->_var['shipping']['print_bg'] != ''): ?> class="display_no" <?php endif; ?>>
              <input type="file" name="bg" id="bg" <?php if ($this->_var['shipping']['print_bg'] != ''): ?> disabled="disabled" <?php endif; ?>>
              <input type="button" name="upload" id="upload" value="<?php echo $this->_var['lang']['upload_shipping_bg']; ?>" onclick="javascript:bg_upload();" <?php if ($this->_var['shipping']['print_bg'] != ''): ?> disabled="disabled" <?php endif; ?>>
              <iframe id="bg_upload_hidden" name="bg_upload_hidden" frameborder="0" scrolling="no" class="display_no"></iframe>
            </td>
            <td id="pic_control_del" <?php if ($this->_var['shipping']['print_bg'] == ''): ?> class="display_no" <?php endif; ?>>
              <input type="button" name="upload_del" id="upload_del" onclick="javascript:bg_del();" value="<?php echo $this->_var['lang']['del_shipping_bg']; ?>" <?php if ($this->_var['shipping']['print_bg'] == ''): ?> disabled="disabled" <?php endif; ?>>
            </td>
            <td align="right"><input type="button" value="<?php echo $this->_var['lang']['save_setting']; ?>" onclick="javascript:save();">&nbsp;&nbsp;<input type="button" value="<?php echo $this->_var['lang']['recovery_default']; ?>" onclick="javascript:recovery_default();"></td>
          </tr>
          <tr>
            <td colspan="3">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td style="overflow: hidden;">
        <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_line">
          <tr style="display: none">
            <td colspan="3"></td>
          </tr>
        </table>
      </td>
    </tr>
    <!--菜单栏 end-->
 
    <!--编辑区 start-->
    <tr>
        <td id="xEditingArea" valign="top" height="620" width="100%"><div class="div_play_aray"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1024" height="600" id="test">
      <param name="movie" value="../data/print/pint.swf">
      <param name="quality" value="high">
      <param name="menu" value="false">
      <param name="wmode" value="transparent">
      <param name="FlashVars" value="bcastr_config_bg=<?php echo $this->_var['shipping']['print_bg']; ?>&swf_config_lable=<?php echo $this->_var['shipping']['config_lable']; ?>">
      <param name="allowScriptAccess" value="sameDomain"/>
      <embed src="../data/print/pint.swf" wmode="transparent" FlashVars="bcastr_config_bg=<?php echo $this->_var['shipping']['print_bg']; ?>&swf_config_lable=<?php echo $this->_var['shipping']['config_lable']; ?>" menu="false" quality="high" width="1024" height="600" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" name="test" swLiveConnect="true"/>
      </object></div></td>
    </tr>
    <!--编辑区 end-->
  </form>
  </table>
</body>
</html>
 
<script type="text/javascript">
<!--
var display_yes = (Browser.isIE) ? 'block' : 'table-row-group';
 
window.onload = function()
{
 
  //callFromFlash();
 
 
}
 
/**
 * 恢复默认
 */
function recovery_default()
{
  //获取表单对象
  var the_form = this_obj("theForm");
  if (typeof(the_form) == "undefined")
  {
    return false; //程序错误
  }
 
  if (!confirm(recovery_default_suer))
  {
    return false; //中止执行
  }
 
  the_form.target = '_parent';
  the_form.act.value = 'recovery_default_template';
 
  the_form.submit();
 
  return true;
}
 
/**
 * 保存
 */
function save()
{
  //获取表单对象
  var the_form = this_obj("theForm");
  if (typeof(the_form) == "undefined")
  {
    return false; //程序错误
  }
 
  the_form.config_lable.value = call_flash('lable_Location_info', '');
 
  the_form.target = '_parent';
  the_form.act.value = 'do_edit_print_template';
 
  the_form.submit();
 
  return true;
}
 
/**
 * 打印单背景图片删除
 */
function bg_del()
{
  //获取表单对象
  var the_form = this_obj("theForm");
  if (typeof(the_form) == "undefined")
  {
    return false; //程序错误
  }
 
  if (!confirm(upload_del_confirm))
  {
    return false; //中止执行
  }
 
  var params = 'shipping=' + the_form.shipping.value;
  Ajax.call('shipping.php?is_ajax=1&act=print_del', params, bg_del_call_back, 'GET', 'JSON');
 
}
 
function bg_del_call_back(result)
{
  //==0 成功
  if (result.error == 0)
  {
    call_flash('bg_delete', '');
  }
 
}
 
/**
 * 打印单背景图片上传
 */
function bg_upload()
{
  //获取表单对象
  var the_form = this_obj("theForm");
  if (typeof(the_form) == "undefined")
  {
    return false; //程序错误
  }
 
  //判断是否选取了上传文件
  if (the_form.bg.value == '')
  {
    alert(no_select_upload);
 
    return false;
  }
 
  the_form.target = 'bg_upload_hidden';
  the_form.act.value = 'print_upload';
 
  the_form.submit();
 
  return true;
 
}
 
/**
 * 与模板Flash编辑器通信
 */
function call_flash(type, currt_obj)
{
  //获取flash对象
  var obj = this_obj("test");
 
  //执行操作
  switch (type)
  {
    case 'bg_delete': //删除打印单背景图片
 
      var result_del = obj.bg_delete();
 
      //执行成功 修改页面上传窗口为显示 生效
      if (result_del)
      {
        document.getElementById('pic_control_upload').style.display = display_yes;
        document.getElementById('pic_control_del').style.display = 'none';
 
        var the_form = this_obj("theForm");
        the_form.bg.disabled = "";
        the_form.bg.value = "";
        the_form.upload.disabled = "";
        the_form.upload_del.disabled = "disabled";
      }
 
    break;
 
    case 'bg_add': //添加打印单背景图片
 
      var result_add = obj.bg_add(currt_obj);
 
      //执行成功 修改页面上传窗口为隐藏 失效
      if (result_add)
      {
        document.getElementById('pic_control_upload').style.display = 'none';
        document.getElementById('pic_control_del').style.display = display_yes;
 
        var the_form = this_obj("theForm");
        the_form.bg.disabled = "disabled";
        the_form.upload.disabled = "disabled";
        the_form.upload_del.disabled = "";
      }
 
    break;
 
    case 'lable_add': //插入标签
 
      if (typeof(currt_obj) != 'object')
      {
        return false;
      }
 
      if (currt_obj.value == '')
      {
        alert(no_select_lable);
 
        return false;
      }
 
      var result = obj.lable_add('t_' + currt_obj.value, currt_obj.options[currt_obj.selectedIndex].text, 150, 50, 20, 100, 'b_' + currt_obj.value);
      if (!result)
      {
        alert(no_add_repeat_lable);
 
        return false;
      }
 
    break;
 
    case 'lable_del': //删除标签
 
      var result_del = obj.lable_del();
 
      if (result_del)
      {
        //alert("删除成功!");
      }
      else
      {
        alert(no_select_lable_del);
      }
 
    break;
 
    case 'lable_Location_info': //获取标签位置信息
 
      var result_info = obj.lable_Location_info();
 
      return result_info;
 
    break;
  }
 
  return true;
 
}
 
/**
 * 获取页面Flash编辑器对象
 */
function this_obj(flash_name)
{
  var _obj;
 
  if (Browser.isIE)
  {
      _obj = window[flash_name];
  }
  else
  {
      _obj = document[flash_name];
  }
 
  if (typeof(_obj) == "undefined")
  {
    _obj = document[flash_name];
  }
  
  return _obj;
 
}
//-->
</script>