658 lines
23 KiB
PHP
658 lines
23 KiB
PHP
|
<!-- $Id: goods_info.htm 17126 2010-04-23 10:30:26Z liuhui $ -->
|
||
|
<?php echo $this->fetch('pageheader.htm'); ?>
|
||
|
<?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js')); ?>
|
||
|
<script type="text/javascript" src="../js/calendar.php?lang=<?php echo $this->_var['cfg_lang']; ?>"></script>
|
||
|
<script charset="utf-8" src="../includes/kindeditor/kindeditor.js"></script>
|
||
|
<script charset="utf-8" src="../includes/kindeditor/lang/zh_CN.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
var editor;
|
||
|
KindEditor.ready(function(K) {
|
||
|
editor = K.create('#editor_id');
|
||
|
editor2 = K.create('#editor_id2');
|
||
|
});
|
||
|
</script>
|
||
|
<link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" />
|
||
|
|
||
|
<?php if ($this->_var['warning']): ?>
|
||
|
<ul style="padding:0; margin: 0; list-style-type:none; color: #CC0000;">
|
||
|
<li style="border: 1px solid #CC0000; background: #FFFFCC; padding: 10px; margin-bottom: 5px;" ><?php echo $this->_var['warning']; ?></li>
|
||
|
</ul>
|
||
|
<?php endif; ?>
|
||
|
|
||
|
<!-- start goods form -->
|
||
|
<div class="tab-div">
|
||
|
<!-- tab bar -->
|
||
|
<div id="tabbar-div">
|
||
|
<p>
|
||
|
<span class="tab-front" id="general-tab">一般信息</span>
|
||
|
<span class="tab-back" id="intro-tab">服務說明</span>
|
||
|
<span class="tab-back" id="notice-tab">注意事項</span>
|
||
|
<span class="tab-back" id="gallery-tab">服務相片</span>
|
||
|
</p>
|
||
|
</div>
|
||
|
|
||
|
<!-- tab body -->
|
||
|
<div id="tabbody-div">
|
||
|
<form enctype="multipart/form-data" action="" method="post" name="theForm" >
|
||
|
<table width="90%" id="general-table" align="center">
|
||
|
<tr>
|
||
|
<td>名稱</td>
|
||
|
<td><input type="text" name="name" value="<?php echo $this->_var['room']['name']; ?>" size="50" />
|
||
|
<?php echo $this->_var['lang']['require_field']; ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>價格</td>
|
||
|
<td><input type="text" name="price" value="<?php echo $this->_var['room']['price']; ?>" size="50" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>上傳圖片</td>
|
||
|
<td>
|
||
|
<input type="file" name="image1" size="35" />
|
||
|
<?php if ($this->_var['room']['image1']): ?>
|
||
|
<a href="room.php?act=show_image&img_url=<?php echo $this->_var['room']['image1']; ?>" target="_blank">
|
||
|
<img src="../<?php echo $this->_var['room']['image1']; ?>" width="100" />
|
||
|
<img src="images/yes.gif" border="0" />
|
||
|
</a>
|
||
|
<?php else: ?>
|
||
|
<img src="images/no.gif" />
|
||
|
<?php endif; ?>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<table width="90%" id="intro-table" style="display:none">
|
||
|
<tr>
|
||
|
<td><textarea id="editor_id" name="intro" style="width:100%;height:400px;"><?php echo $this->_var['room']['intro']; ?></textarea></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table width="90%" id="notice-table" style="display:none">
|
||
|
<tr>
|
||
|
<td><textarea id="editor_id2" name="notice" style="width:100%;height:400px;"><?php echo $this->_var['room']['notice']; ?></textarea></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<table width="90%" id="mix-table" style="display:none" align="center">
|
||
|
<?php if ($this->_var['cfg']['use_storage']): ?>
|
||
|
<tr>
|
||
|
<td><a href="javascript:showNotice('noticeStorage');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_goods_number']; ?></td>
|
||
|
<!-- <td><input type="text" name="goods_number" value="<?php echo $this->_var['goods']['goods_number']; ?>" size="20" <?php if ($this->_var['code'] != '' || $this->_var['goods']['_attribute'] != ''): ?>readonly="readonly"<?php endif; ?> /><br />-->
|
||
|
<td><input type="text" name="goods_number" value="<?php echo $this->_var['goods']['goods_number']; ?>" size="20" /><br />
|
||
|
<span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeStorage"><?php echo $this->_var['lang']['notice_storage']; ?></span></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><?php echo $this->_var['lang']['lab_warn_number']; ?></td>
|
||
|
<td><input type="text" name="warn_number" value="<?php echo $this->_var['goods']['warn_number']; ?>" size="20" /></td>
|
||
|
</tr>
|
||
|
<?php endif; ?>
|
||
|
<tr id="alone_sale_1">
|
||
|
<td class="label" id="alone_sale_2"><?php echo $this->_var['lang']['lab_is_on_sale']; ?></td>
|
||
|
<td id="alone_sale_3"><input type="checkbox" name="is_on_sale" value="1" <?php if ($this->_var['goods']['is_on_sale']): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['on_sale_desc']; ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><?php echo $this->_var['lang']['lab_keywords']; ?></td>
|
||
|
<td><input type="text" name="keywords" value="<?php echo htmlspecialchars($this->_var['goods']['keywords']); ?>" size="40" /> <?php echo $this->_var['lang']['notice_keywords']; ?></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><?php echo $this->_var['lang']['lab_goods_brief']; ?></td>
|
||
|
<td><textarea name="goods_brief" cols="40" rows="3"><?php echo htmlspecialchars($this->_var['goods']['goods_brief']); ?></textarea></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td>
|
||
|
<a href="javascript:showNotice('noticeSellerNote');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_seller_note']; ?> </td>
|
||
|
<td><textarea name="seller_note" cols="40" rows="3"><?php echo $this->_var['goods']['seller_note']; ?></textarea><br />
|
||
|
<span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeSellerNote"><?php echo $this->_var['lang']['notice_seller_note']; ?></span></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<?php if ($this->_var['goods_type_list']): ?>
|
||
|
<table width="90%" id="properties-table" style="display:none" align="center">
|
||
|
<tr>
|
||
|
<td><a href="javascript:showNotice('noticeGoodsType');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a><?php echo $this->_var['lang']['lab_goods_type']; ?></td>
|
||
|
<td>
|
||
|
<select name="goods_type" onchange="getAttrList(<?php echo $this->_var['goods']['goods_id']; ?>)">
|
||
|
<option value="0"><?php echo $this->_var['lang']['sel_goods_type']; ?></option>
|
||
|
<?php echo $this->_var['goods_type_list']; ?>
|
||
|
</select><br />
|
||
|
<span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeGoodsType"><?php echo $this->_var['lang']['notice_goods_type']; ?></span></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td id="tbody-goodsAttr" colspan="2" style="padding:0"><?php echo $this->_var['goods_attr_html']; ?></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<?php endif; ?>
|
||
|
|
||
|
<table width="90%" id="gallery-table" style="display:none" align="center">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<?php $_from = $this->_var['img_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('i', 'img');if (count($_from)):
|
||
|
foreach ($_from AS $this->_var['i'] => $this->_var['img']):
|
||
|
?>
|
||
|
<div id="gallery_<?php echo $this->_var['img']['img_id']; ?>" style="float:left; text-align:center; border: 1px solid #DADADA; margin: 4px; padding:2px;">
|
||
|
<a href="javascript:;" onclick="if (confirm('確定刪除?')) dropImg('<?php echo $this->_var['img']['img_id']; ?>')">[-]</a><br />
|
||
|
<a href="homestay.php?act=show_image&img_url=<?php echo $this->_var['img']['img_url']; ?>" target="_blank">
|
||
|
<img src="../<?php if ($this->_var['img']['img_url']): ?><?php echo $this->_var['img']['img_url']; ?><?php else: ?><?php echo $this->_var['img']['img_url']; ?><?php endif; ?>" <?php if ($this->_var['thumb_width'] != 0): ?>width="<?php echo $this->_var['thumb_width']; ?>"<?php endif; ?> <?php if ($this->_var['thumb_height'] != 0): ?>height="<?php echo $this->_var['thumb_height']; ?>"<?php endif; ?> border="0" />
|
||
|
</a><br />
|
||
|
<input type="text" value="<?php echo htmlspecialchars($this->_var['img']['img_desc']); ?>" size="15" name="old_img_desc[<?php echo $this->_var['img']['img_id']; ?>]" oninput = "value=value.replace(/[^\d]/g,'')"/>
|
||
|
</div>
|
||
|
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td> </td></tr>
|
||
|
<tr>
|
||
|
<td>
|
||
|
<a href="javascript:;" onclick="addImg(this)">[+]</a>排序 <input type="text" name="img_desc[]" size="20" value="50" oninput = "value=value.replace(/[^\d]/g,'')"/>上傳文件 <input type="file" name="img_url[]" />
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<div class="button-div">
|
||
|
<input type="hidden" name="id" value="<?php echo $this->_var['room']['id']; ?>" />
|
||
|
<input type="button" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" onclick="validate('<?php echo $this->_var['hs']['id']; ?>')" />
|
||
|
<input type="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" class="button" />
|
||
|
</div>
|
||
|
<input type="hidden" name="act" value="<?php echo $this->_var['form_act']; ?>" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- end goods form -->
|
||
|
<?php echo $this->smarty_insert_scripts(array('files'=>'validator.js,tab.js')); ?>
|
||
|
|
||
|
<script language="JavaScript">
|
||
|
|
||
|
|
||
|
onload = function()
|
||
|
{
|
||
|
// handlePromote(document.forms['theForm'].elements['is_promote'].checked);
|
||
|
|
||
|
if (document.forms['theForm'].elements['auto_thumb'])
|
||
|
{
|
||
|
handleAutoThumb(document.forms['theForm'].elements['auto_thumb'].checked);
|
||
|
}
|
||
|
|
||
|
// 妫€鏌ユ柊璁㈠崟
|
||
|
startCheckOrder();
|
||
|
|
||
|
<?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
|
||
|
foreach ($_from AS $this->_var['item']):
|
||
|
?>
|
||
|
set_price_note(<?php echo $this->_var['item']['rank_id']; ?>);
|
||
|
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
|
||
|
|
||
|
document.forms['theForm'].reset();
|
||
|
}
|
||
|
|
||
|
function validate(hs_id)
|
||
|
{
|
||
|
var validator = new Validator('theForm');
|
||
|
editor.sync();
|
||
|
editor2.sync();
|
||
|
|
||
|
validator.required('name', '名稱不能為空');
|
||
|
|
||
|
if(validator.passed())
|
||
|
{
|
||
|
document.forms['theForm'].submit();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function addSpec(obj)
|
||
|
{
|
||
|
var src = obj.parentNode.parentNode;
|
||
|
var idx = rowindex(src);
|
||
|
var tbl = document.getElementById('attrTable');
|
||
|
var row = tbl.insertRow(idx + 1);
|
||
|
var cell1 = row.insertCell(-1);
|
||
|
var cell2 = row.insertCell(-1);
|
||
|
var regx = /<a([^>]+)<\/a>/i;
|
||
|
|
||
|
cell1.className = 'label';
|
||
|
cell1.innerHTML = src.childNodes[0].innerHTML.replace(/(.*)(addSpec)(.*)(\[)(\+)/i, "$1removeSpec$3$4-");
|
||
|
cell2.innerHTML = src.childNodes[1].innerHTML.replace(/readOnly([^\s|>]*)/i, '');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鍒犻櫎瑙勬牸鍊
|
||
|
*/
|
||
|
function removeSpec(obj)
|
||
|
{
|
||
|
var row = rowindex(obj.parentNode.parentNode);
|
||
|
var tbl = document.getElementById('attrTable');
|
||
|
|
||
|
tbl.deleteRow(row);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 澶勭悊瑙勬牸
|
||
|
*/
|
||
|
function handleSpec()
|
||
|
{
|
||
|
var elementCount = document.forms['theForm'].elements.length;
|
||
|
for (var i = 0; i < elementCount; i++)
|
||
|
{
|
||
|
var element = document.forms['theForm'].elements[i];
|
||
|
if (element.id.substr(0, 5) == 'spec_')
|
||
|
{
|
||
|
var optCount = element.options.length;
|
||
|
var value = new Array(optCount);
|
||
|
for (var j = 0; j < optCount; j++)
|
||
|
{
|
||
|
value[j] = element.options[j].value;
|
||
|
}
|
||
|
|
||
|
var hiddenSpec = document.getElementById('hidden_' + element.id);
|
||
|
hiddenSpec.value = value.join(String.fromCharCode(13)); // 鐢ㄥ洖杞﹂敭闅斿紑姣忎釜瑙勬牸
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function handlePromote(checked)
|
||
|
{
|
||
|
document.forms['theForm'].elements['promote_price'].disabled = !checked;
|
||
|
document.forms['theForm'].elements['selbtn1'].disabled = !checked;
|
||
|
document.forms['theForm'].elements['selbtn2'].disabled = !checked;
|
||
|
}
|
||
|
|
||
|
function handleAutoThumb(checked)
|
||
|
{
|
||
|
document.forms['theForm'].elements['goods_thumb'].disabled = checked;
|
||
|
document.forms['theForm'].elements['goods_thumb_url'].disabled = checked;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 蹇?€熸坊鍔犲搧鐗
|
||
|
*/
|
||
|
function rapidBrandAdd(conObj)
|
||
|
{
|
||
|
var brand_div = document.getElementById("brand_add");
|
||
|
|
||
|
if(brand_div.style.display != '')
|
||
|
{
|
||
|
var brand =document.forms['theForm'].elements['addedBrandName'];
|
||
|
brand.value = '';
|
||
|
brand_div.style.display = '';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function hideBrandDiv()
|
||
|
{
|
||
|
var brand_add_div = document.getElementById("brand_add");
|
||
|
if(brand_add_div.style.display != 'none')
|
||
|
{
|
||
|
brand_add_div.style.display = 'none';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function goBrandPage()
|
||
|
{
|
||
|
if(confirm(go_brand_page))
|
||
|
{
|
||
|
window.location.href='brand.php?act=add';
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function rapidCatAdd()
|
||
|
{
|
||
|
var cat_div = document.getElementById("category_add");
|
||
|
|
||
|
if(cat_div.style.display != '')
|
||
|
{
|
||
|
var cat =document.forms['theForm'].elements['addedCategoryName'];
|
||
|
cat.value = '';
|
||
|
cat_div.style.display = '';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function addBrand()
|
||
|
{
|
||
|
var brand = document.forms['theForm'].elements['addedBrandName'];
|
||
|
if(brand.value.replace(/^\s+|\s+$/g, '') == '')
|
||
|
{
|
||
|
alert(brand_cat_not_null);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var params = 'brand=' + brand.value;
|
||
|
Ajax.call('brand.php?is_ajax=1&act=add_brand', params, addBrandResponse, 'GET', 'JSON');
|
||
|
}
|
||
|
|
||
|
function addBrandResponse(result)
|
||
|
{
|
||
|
if (result.error == '1' && result.message != '')
|
||
|
{
|
||
|
alert(result.message);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var brand_div = document.getElementById("brand_add");
|
||
|
brand_div.style.display = 'none';
|
||
|
|
||
|
var response = result.content;
|
||
|
|
||
|
var selCat = document.forms['theForm'].elements['brand_id'];
|
||
|
var opt = document.createElement("OPTION");
|
||
|
opt.value = response.id;
|
||
|
opt.selected = true;
|
||
|
opt.text = response.brand;
|
||
|
|
||
|
if (Browser.isIE)
|
||
|
{
|
||
|
selCat.add(opt);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
selCat.appendChild(opt);
|
||
|
}
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
function addCategory()
|
||
|
{
|
||
|
var parent_id = document.forms['theForm'].elements['cat_id'];
|
||
|
var cat = document.forms['theForm'].elements['addedCategoryName'];
|
||
|
if(cat.value.replace(/^\s+|\s+$/g, '') == '')
|
||
|
{
|
||
|
alert(category_cat_not_null);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var params = 'parent_id=' + parent_id.value;
|
||
|
params += '&cat=' + cat.value;
|
||
|
Ajax.call('category.php?is_ajax=1&act=add_category', params, addCatResponse, 'GET', 'JSON');
|
||
|
}
|
||
|
|
||
|
function hideCatDiv()
|
||
|
{
|
||
|
var category_add_div = document.getElementById("category_add");
|
||
|
if(category_add_div.style.display != null)
|
||
|
{
|
||
|
category_add_div.style.display = 'none';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function addCatResponse(result)
|
||
|
{
|
||
|
if (result.error == '1' && result.message != '')
|
||
|
{
|
||
|
alert(result.message);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var category_add_div = document.getElementById("category_add");
|
||
|
category_add_div.style.display = 'none';
|
||
|
|
||
|
var response = result.content;
|
||
|
|
||
|
var selCat = document.forms['theForm'].elements['cat_id'];
|
||
|
var opt = document.createElement("OPTION");
|
||
|
opt.value = response.id;
|
||
|
opt.selected = true;
|
||
|
opt.innerHTML = response.cat;
|
||
|
|
||
|
//鑾峰彇瀛愬垎绫荤殑绌烘牸鏁
|
||
|
var str = selCat.options[selCat.selectedIndex].text;
|
||
|
var temp = str.replace(/^\s+/g, '');
|
||
|
var lengOfSpace = str.length - temp.length;
|
||
|
if(response.parent_id != 0)
|
||
|
{
|
||
|
lengOfSpace += 4;
|
||
|
}
|
||
|
for (i = 0; i < lengOfSpace; i++)
|
||
|
{
|
||
|
opt.innerHTML = ' ' + opt.innerHTML;
|
||
|
}
|
||
|
|
||
|
for (i = 0; i < selCat.length; i++)
|
||
|
{
|
||
|
if(selCat.options[i].value == response.parent_id)
|
||
|
{
|
||
|
if(i == selCat.length)
|
||
|
{
|
||
|
if (Browser.isIE)
|
||
|
{
|
||
|
selCat.add(opt);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
selCat.appendChild(opt);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
selCat.insertBefore(opt, selCat.options[i + 1]);
|
||
|
}
|
||
|
//opt.selected = true;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
function goCatPage()
|
||
|
{
|
||
|
if(confirm(go_category_page))
|
||
|
{
|
||
|
window.location.href='category.php?act=add';
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 鍒犻櫎蹇?€熷垎绫
|
||
|
*/
|
||
|
function removeCat()
|
||
|
{
|
||
|
if(!document.forms['theForm'].elements['parent_cat'] || !document.forms['theForm'].elements['new_cat_name'])
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var cat_select = document.forms['theForm'].elements['parent_cat'];
|
||
|
var cat = document.forms['theForm'].elements['new_cat_name'];
|
||
|
|
||
|
cat.parentNode.removeChild(cat);
|
||
|
cat_select.parentNode.removeChild(cat_select);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鍒犻櫎蹇?€熷搧鐗
|
||
|
*/
|
||
|
function removeBrand()
|
||
|
{
|
||
|
if (!document.forms['theForm'].elements['new_brand_name'])
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var brand = document.theForm.new_brand_name;
|
||
|
brand.parentNode.removeChild(brand);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 娣诲姞鎵╁睍鍒嗙被
|
||
|
*/
|
||
|
function addOtherCat(conObj)
|
||
|
{
|
||
|
var sel = document.createElement("SELECT");
|
||
|
var selCat = document.forms['theForm'].elements['cat_id'];
|
||
|
|
||
|
for (i = 0; i < selCat.length; i++)
|
||
|
{
|
||
|
var opt = document.createElement("OPTION");
|
||
|
opt.text = selCat.options[i].text;
|
||
|
opt.value = selCat.options[i].value;
|
||
|
if (Browser.isIE)
|
||
|
{
|
||
|
sel.add(opt);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
sel.appendChild(opt);
|
||
|
}
|
||
|
}
|
||
|
conObj.appendChild(sel);
|
||
|
sel.name = "other_cat[]";
|
||
|
sel.onChange = function() {checkIsLeaf(this);};
|
||
|
}
|
||
|
|
||
|
/* 鍏宠仈鍟嗗搧鍑芥暟 */
|
||
|
function searchGoods(szObject, catId, brandId, keyword)
|
||
|
{
|
||
|
var filters = new Object;
|
||
|
|
||
|
filters.cat_id = elements[catId].value;
|
||
|
filters.brand_id = elements[brandId].value;
|
||
|
filters.keyword = Utils.trim(elements[keyword].value);
|
||
|
filters.exclude = document.forms['theForm'].elements['goods_id'].value;
|
||
|
|
||
|
szObject.loadOptions('get_goods_list', filters);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鍏宠仈鏂囩珷鍑芥暟
|
||
|
*/
|
||
|
function searchArticle()
|
||
|
{
|
||
|
var filters = new Object;
|
||
|
|
||
|
filters.title = Utils.trim(elements['article_title'].value);
|
||
|
|
||
|
sz3.loadOptions('get_article_list', filters);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鏂板?涓€涓?浘鐗
|
||
|
*/
|
||
|
function addImg(obj)
|
||
|
{
|
||
|
var src = obj.parentNode.parentNode;
|
||
|
var idx = rowindex(src);
|
||
|
var tbl = document.getElementById('gallery-table');
|
||
|
var row = tbl.insertRow(idx + 1);
|
||
|
var cell = row.insertCell(-1);
|
||
|
cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鍒犻櫎鍥剧墖涓婁紶
|
||
|
*/
|
||
|
function removeImg(obj)
|
||
|
{
|
||
|
var row = rowindex(obj.parentNode.parentNode);
|
||
|
var tbl = document.getElementById('gallery-table');
|
||
|
|
||
|
tbl.deleteRow(row);
|
||
|
}
|
||
|
|
||
|
function dropImg(imgId)
|
||
|
{
|
||
|
Ajax.call('room.php?is_ajax=1&act=drop_image', "img_id="+imgId, dropImgResponse, "GET", "JSON");
|
||
|
}
|
||
|
|
||
|
function dropImgResponse(result)
|
||
|
{
|
||
|
if (result.error == 0)
|
||
|
{
|
||
|
document.getElementById('gallery_' + result.content).style.display = 'none';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function integral_market_price()
|
||
|
{
|
||
|
document.forms['theForm'].elements['market_price'].value = parseInt(document.forms['theForm'].elements['market_price'].value);
|
||
|
}
|
||
|
|
||
|
function parseint_integral()
|
||
|
{
|
||
|
document.forms['theForm'].elements['integral'].value = parseInt(document.forms['theForm'].elements['integral'].value);
|
||
|
}
|
||
|
|
||
|
function addVolumePrice(obj)
|
||
|
{
|
||
|
var src = obj.parentNode.parentNode;
|
||
|
var tbl = document.getElementById('tbody-volume');
|
||
|
|
||
|
var validator = new Validator('theForm');
|
||
|
checkVolumeData("0",validator);
|
||
|
if (!validator.passed())
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
var row = tbl.insertRow(tbl.rows.length);
|
||
|
var cell = row.insertCell(-1);
|
||
|
cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addVolumePrice)(.*)(\[)(\+)/i, "$1removeVolumePrice$3$4-");
|
||
|
|
||
|
var number_list = document.getElementsByName("volume_number[]");
|
||
|
var price_list = document.getElementsByName("volume_price[]");
|
||
|
|
||
|
number_list[number_list.length-1].value = "";
|
||
|
price_list[price_list.length-1].value = "";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鍒犻櫎浼樻儬浠锋牸
|
||
|
*/
|
||
|
function removeVolumePrice(obj)
|
||
|
{
|
||
|
var row = rowindex(obj.parentNode.parentNode);
|
||
|
var tbl = document.getElementById('tbody-volume');
|
||
|
|
||
|
tbl.deleteRow(row);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 鏍¢獙浼樻儬鏁版嵁鏄?惁姝g‘
|
||
|
*/
|
||
|
function checkVolumeData(isSubmit,validator)
|
||
|
{
|
||
|
var volumeNum = document.getElementsByName("volume_number[]");
|
||
|
var volumePri = document.getElementsByName("volume_price[]");
|
||
|
var numErrNum = 0;
|
||
|
var priErrNum = 0;
|
||
|
|
||
|
for (i = 0 ; i < volumePri.length ; i ++)
|
||
|
{
|
||
|
if ((isSubmit != 1 || volumeNum.length > 1) && numErrNum <= 0 && volumeNum.item(i).value == "")
|
||
|
{
|
||
|
validator.addErrorMsg(volume_num_not_null);
|
||
|
numErrNum++;
|
||
|
}
|
||
|
|
||
|
if (numErrNum <= 0 && Utils.trim(volumeNum.item(i).value) != "" && ! Utils.isNumber(Utils.trim(volumeNum.item(i).value)))
|
||
|
{
|
||
|
validator.addErrorMsg(volume_num_not_number);
|
||
|
numErrNum++;
|
||
|
}
|
||
|
|
||
|
if ((isSubmit != 1 || volumePri.length > 1) && priErrNum <= 0 && volumePri.item(i).value == "")
|
||
|
{
|
||
|
validator.addErrorMsg(volume_price_not_null);
|
||
|
priErrNum++;
|
||
|
}
|
||
|
|
||
|
if (priErrNum <= 0 && Utils.trim(volumePri.item(i).value) != "" && ! Utils.isNumber(Utils.trim(volumePri.item(i).value)))
|
||
|
{
|
||
|
validator.addErrorMsg(volume_price_not_number);
|
||
|
priErrNum++;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
<?php echo $this->fetch('pagefooter.htm'); ?>
|