您的位置:首页 > Web前端 > JavaScript

ecshop 后台管理商品列表 如何传递参数 ecshop中如何使用js ecshop如何使用javascript

2013-01-25 15:59 323 查看
<!-- $Id: goods_list.htm 17126 2010-04-23 10:30:26Z liuhui $ -->

{if $full_page}

{include file="pageheader.htm"}

{insert_scripts files="../js/utils.js,listtable.js"}

<!-- 鍟嗗搧鎼滅储 -->

{include file="goods_search.htm"}

<!-- 鍟嗗搧鍒楄〃 -->

<form method="post" action="" name="listForm" onsubmit="return confirmSubmit(this)">

<!-- start goods list -->

<div class="list-div" id="listDiv">

{/if}

<table cellpadding="3" cellspacing="1">

<tr>

<th>

<input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />

<a href="javascript:listTable.sort('goods_id'); ">{$lang.record_id}</a>{$sort_goods_id}

</th>

<th><a href="javascript:listTable.sort('goods_name'); ">{$lang.goods_name}</a>{$sort_goods_name}</th>

<!-- begin 鑷畾涔夊瓧娈�-->

<th><a href="javascript:listTable.sort('goods_name'); ">{$lang.vendor_taobaoID}</a>{$sort.vendor_taobaoID}</th>

<th><a href="javascript:listTable.sort('vendor_status'); ">{$lang.vendor_status}</a>{$sort.vendor_status}</th>

<!-- end 鑷畾涔夊瓧娈�-->

<tr>

{foreach from=$goods_list item=goods}

<tr>

<td><input type="checkbox" name="checkboxes[]" value="{$goods.goods_id}" />{$goods.goods_id}</td>

<td class="first-cell" style="{if $goods.is_promote}color:red;{/if}"><span onclick="listTable.edit(this, 'edit_goods_name', {$goods.goods_id})">{$goods.goods_name|escape:html}</span></td>

<!-- begin 鑷畾涔夊瓧娈�-->

<td> 鎻愰啋绫诲埆锛�select id="remind_type_{$goods.goods_id}">

<option vaule="涓嬫灦 ">涓嬫灦</option>

<option vaule="搴撳瓨鏇存柊">搴撳瓨鏇存柊</option>

<option vaule="鍥剧墖鏇存柊">鍥剧墖鏇存柊</option>

</select></td>

<td> 鎻愰啋鍐呭: <input type="text" id="remind_text_{$goods.goods_id}" /></td>

<td> <input type="button" id="remind_btn" onclick="remindAdd('{$goods.goods_id}')" value="娣诲姞鎻愰啋"/></td>

<!-- end 鑷畾涔夊瓧娈�-->

</tr>

{foreachelse}

<tr><td class="no-records" colspan="10">{$lang.no_records}</td></tr>

{/foreach}

</table>

<!-- end goods list -->

<!-- 鍒嗛〉 -->

<table id="page-table" cellspacing="0">

<tr>

<td align="right" nowrap="true">

{include file="page.htm"}

</td>

</tr>

</table>

{if $full_page}

</div>

<div>

<input type="hidden" name="act" value="batch" />

<select name="type" id="selAction" onchange="changeAction()">

<option value="">{$lang.select_please}</option>

<option value="trash">{$lang.trash}</option>

<option value="on_sale">{$lang.on_sale}</option>

<option value="not_on_sale">{$lang.not_on_sale}</option>

<option value="best">{$lang.best}</option>

<option value="not_best">{$lang.not_best}</option>

<option value="new">{$lang.new}</option>

<option value="not_new">{$lang.not_new}</option>

<option value="hot">{$lang.hot}</option>

<option value="not_hot">{$lang.not_hot}</option>

<option value="move_to">{$lang.move_to}</option>

{if $suppliers_list > 0}

<option value="suppliers_move_to">{$lang.suppliers_move_to}</option>

{/if}

</select>

<select name="target_cat" style="display:none">

<option value="0">{$lang.select_please}</option>{$cat_list}

</select>

{if $suppliers_list > 0}

<!--浜岀骇涓昏彍鍗曪細杞Щ渚涜揣鍟�->

<select name="suppliers_id" style="display:none">

<option value="-1">{$lang.select_please}</option>

<option value="0">{$lang.lab_to_shopex}</option>

{foreach name=sln from=$suppliers_list item=sl}

<option value="{$sl.suppliers_id}">{$sl.suppliers_name}</option>

{/foreach}

</select>

<!--end!-->

{/if}

{if $code neq 'real_goods'}

<input type="hidden" name="extension_code" value="{$code}" />

{/if}

<input type="submit" value="{$lang.button_submit}" id="btnSubmit" name="btnSubmit" class="button" disabled="true" />

</div>

</form>

<script type="text/javascript">

listTable.recordCount = {$record_count};

listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}

listTable.filter.{$key} = '{$item}';

{/foreach}

{literal}

onload = function()

{

startCheckOrder(); // 寮�妫�煡璁㈠崟

document.forms['listForm'].reset();

}

/**

* @param: bool ext 鍏朵粬鏉′欢锛氱敤浜庤浆绉诲垎绫�

*/

function confirmSubmit(frm, ext)

{

if (frm.elements['type'].value == 'trash')

{

return confirm(batch_trash_confirm);

}

else if (frm.elements['type'].value == 'not_on_sale')

{

return confirm(batch_no_on_sale);

}

else if (frm.elements['type'].value == 'move_to')

{

ext = (ext == undefined) ? true : ext;

return ext && frm.elements['target_cat'].value != 0;

}

else if (frm.elements['type'].value == '')

{

return false;

}

else

{

return true;

}

}

function changeAction()

{

var frm = document.forms['listForm'];

// 鍒囨崲鍒嗙被鍒楄〃鐨勬樉绀�

frm.elements['target_cat'].style.display = frm.elements['type'].value == 'move_to' ? '' : 'none';

{if $suppliers_list > 0}

frm.elements['suppliers_id'].style.display = frm.elements['type'].value == 'suppliers_move_to' ? '' : 'none';

{/if}

if (!document.getElementById('btnSubmit').disabled &&

confirmSubmit(frm, false))

{

frm.submit();

}

}

function remindAdd(id)

{

var str_remind_type="remind_type_"+id;

var str_remind_text="remind_text_"+id;

alert(str_remind_type);

alert(str_remind_text);

//window.location.href='./goods.php?act=remind_add&content={$goods.goods_id}'

// alert(id);//success

var remind_content=document.getElementById(id).value;

alert(remind_content);

var re= document.forms['listForm'];

// 鍒囨崲鍒嗙被鍒楄〃鐨勬樉绀�

frm.elements['target_cat'].style.display = frm.elements['type'].value == 'move_to' ? '' : 'none';

{if $suppliers_list > 0}

frm.elements['suppliers_id'].style.display = frm.elements['type'].value == 'suppliers_move_to' ? '' : 'none';

{/if}

if (!document.getElementById('btnSubmit').disabled &&

confirmSubmit(frm, false))

{

frm.submit();

}

}

{/literal}

</script>

{include file="pagefooter.htm"}

{/if}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐