⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ct_product.jsp

📁 TurboCWCShop v1.6.7 is make in the Utility-LAYer Framework.
💻 JSP
字号:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../../include.jsp"%> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<link href="../../style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../common.js"></script>
<script language="javascript">
<!--
function del()
{
	if (confirm("确认操作吗?"))
	{
		return(true);
	}
	else
	{
		return(false);
	}
}

function a_sel(thebox)
{
	if ( del() )
	{
	if ( thebox.checked )
	{
		document.listForm.alive.value = 1;
	}
	else
	{
		document.listForm.alive.value = 0;
	}

	document.listForm.pid.value = thebox.value;
	document.listForm.action = "<%=ConfigBean.getStringValue("systenFolder")%>appController/markAlive";
	document.listForm.submit();
	}
	else
	{
		return(false);
	}
}

function selectOne()
{
	var flag = false;
	for (i=0; i<document.listForm.pid_batch.length; i++)
	{
		if(document.listForm.pid_batch[i].checked)
		{
			flag = true;
			break;
		}
	}
	
	return(flag);
}

function batchModPrice()
{
	if ( !selectOne() )
	{
		alert("请选择你要修改的商品");
	}
	else
	{
		if ( del() )
		{
			document.listForm.action = "<%=ConfigBean.getStringValue("systenFolder")%>appController/batchModPrice";
			document.listForm.submit();
		}
	}
}

function modPro(pid)
{
	document.temp_form.action = "mod_pro.jsp";
	document.temp_form.backurl.value = "<%=StringUtil.getCurrentURL(request)%>";
	document.temp_form.pid.value = pid;
	document.temp_form.submit();
}

function delPro(pid)
{
	if ( del() )
	{
		document.temp_form.action = "<%=ConfigBean.getStringValue("systenFolder")%>appController/delPro";
		document.temp_form.pid.value = pid;
		document.temp_form.submit();
	}
}

function rowSel(index)
{
	if ( document.listForm.pid_batch[index].checked )
	{
		document.listForm.pid_batch[index].checked = false;
	}
	else
	{
		document.listForm.pid_batch[index].checked = true;
	}
}

function onMOBg(row,cl,index)
{
	if ( !document.listForm.pid_batch[index].checked )
	{
		row.style.background=cl;
	}
}

function batchMoveProduct()
{
	if ( !selectOne() )
	{
		alert("请选择你要转移的商品");
	}
	else
	{
		if ( del() )
		{
			document.listForm.action = "<%=ConfigBean.getStringValue("systenFolder")%>appController/batchMoveProduct";
			document.listForm.cid.value=document.getElementById("move2cid").value;
			document.listForm.submit();
		}
	}
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<form action="" method="get" name="temp_form">
<input type="hidden" name="pid">
<input type="hidden" name="backurl">
</form>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" align="center" bgcolor="eeeeee">商品查询</td>
    <td width="4%" bgcolor="f8f8f8">&nbsp;</td>
    <form action="ct_product.jsp" method="get">
      <td width="21%" bgcolor="f8f8f8"> 
        <select name="cid" id="select">
          <%
DBRow treeRows[] = catalogMgr.getCatalogTree();
String qx;

for ( int i=0; i<treeRows.length; i++ )
{
	if ( treeRows[i].get("parentid",0) != 0 )
	 {
	 	qx = "├ ";
	 }
	 else
	 {
	 	qx = "";
	 }
%>
          <option value="<%=treeRows[i].getString("id")%>" <%=treeRows[i].get("id",0l)==StringUtil.getLong(request,"cid")?"selected":""%>> 
          <%=Tree.makeSpace("&nbsp;&nbsp;&nbsp;",treeRows[i].get("level",0))%>
          <%=qx%>
          <%=treeRows[i].getString("title")%>
          </option>
          <%
}
%>
        </select>
      </td>
      <td width="21%" bgcolor="f8f8f8">
<input type="submit" name="Submit4" value="  查 询  "></td>
    </form>
    <form name="form2" method="post" action="ct_product.jsp">
      <td width="39%" align="center" valign="middle" bgcolor="f8f8f8"> 输入商品名称 
        <input name="name" type="text"> <input type="submit" name="Submit" value="  搜 索  "> 
      </td>
    </form>
    <!--<td width="11%" align="center" valign="middle"><input type="button" name="Submit2" value="数据导出" onclick="data_out()"> 
      </td>-->
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" align="center" valign="middle" bgcolor="eeeeee">批量操作</td>
    <td width="14%"><input type="button" name="Submit2" value="批量修改价格" onClick="return batchModPrice()"></td>
    <td width="71%"><input type="button" name="Submit23" value="批量转移到" onClick="return batchMoveProduct()">
      &gt;
<select name="cid2" id="move2cid">
        <%
treeRows = catalogMgr.getCatalogTree();
for ( int i=0; i<treeRows.length; i++ )
{
	if ( treeRows[i].get("parentid",0) != 0 )
	 {
	 	qx = "├ ";
	 }
	 else
	 {
	 	qx = "";
	 }
%>
        <option value="<%=treeRows[i].getString("id")%>" <%=treeRows[i].get("id",0l)==StringUtil.getLong(request,"cid")?"selected":""%>> 
        <%=Tree.makeSpace("&nbsp;&nbsp;&nbsp;",treeRows[i].get("level",0))%>
        <%=qx%>
        <%=treeRows[i].getString("title")%>
        </option>
        <%
}
%>
      </select></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="thetable">
  <form name="listForm" method="post">
    <input type="hidden" name="pid">
    <input type="hidden" name="alive">
	<input type="hidden" name="cid">
	  <thead>
    <tr> 
        <td colspan="2" align="center" valign="middle">商品ID</td>
        <td valign="middle">商品名称</td>
        <td width="14%" align="center" valign="middle">商品货架</td>
        <td width="9%" align="center" valign="middle">商品价格</td>
        <td width="13%" align="center" valign="middle">所属群组</td>
        <td width="7%" align="center" valign="middle">上/下架</td>
        <td width="9%" align="center" valign="middle">点 击</td>
        <td width="7%" align="center" valign="middle">操 作</td>
    </tr>
	</thead>
    <%
PageCtrl pc = new PageCtrl();
pc.setPageNo(StringUtil.getInt(request,"p"));
pc.setPageSize(30);
long cid = StringUtil.getLong(request,"cid");
String name = StringUtil.getString(request,"name");
long pgid = StringUtil.getLong(request,"pgid",0l);

DBRow rows[];
if ( cid>0 )
{
	rows = productMgr.getNewProductByCid(cid,pc);
}
else if ( !name.equals(""))
{
	rows = productMgr.getNewProductByName(name,pc);
}
else if ( pgid>0 )
{	
	rows = productMgr.getNewProductByPgid(pgid,pc);
}
else
{
	rows = productMgr.getAllProduct(pc);
}

String lineBg;
DBRow proGroup[];
for ( int i=0; i<rows.length; i++ )
{
	if ( i%2==0 )
	{
		lineBg = "#ffffff";
	}
	else
	{
		lineBg = "#eeeeee";
	}
%>
    <tr bgcolor="<%=lineBg%>" onMouseOut="onMOBg(this,'<%=lineBg%>',<%=i%>)" onMouseOver="onMOBg(this,'#F4E088',<%=i%>)" onClick="rowSel(<%=i%>)"> 
      <td width="3%" height="46" align="center" valign="middle"> 
        <input name="pid_batch" id="pid_x<%=i%>" type="checkbox" value="<%=rows[i].getString("pid")%>"> 
      </td>
      <td width="6%" align="center" valign="middle"> 
        <%=rows[i].getString("pid")%>
      </td>
      <td width="22%" valign="middle" style='word-break:break-all;' ><a class="blue" href="../../product/detail-<%=rows[i].getString("pid")%>.html" target="_blank"> 
        <%=rows[i].getString("name")%>
        </a> </td>
      <td align="center" valign="middle" ><a class="blue"  href="?cid=<%=rows[i].getString("id")%>"> 
        <%=rows[i].getString("title")%>
        </a></td>
      <td align="center" valign="middle" > 
        <input name="shop_price_<%=rows[i].getString("pid")%>" type="text" value="<%=rows[i].getString("shop_price")%>" size="5"> 
      </td>
      <td align="center" valign="middle" style='word-break:break-all;'> 
        <%
proGroup = productMgr.getPGroupsByPid(rows[i].get("pid",0l),null);
for (int j=0; j<proGroup.length; j++)
{
	out.println("<a href='?pgid="+proGroup[j].getString("pgid")+"'>"+proGroup[j].getString("title")+"</a> |");
}
%>
      </td>
      <td align="center" valign="middle"> 
        <%
String alive_sl;
if ( rows[i].get("alive",0) == 1 )
{
	alive_sl = "checked";
}
else
{
	alive_sl = "";
}
%>
        <input type="checkbox" name="alive_x" id="alive_x<%=i%>" value="<%=rows[i].getString("pid")%>" onClick="return a_sel(this)" <%=alive_sl%>> 
      </td>
      <td width="2%" align="center" valign="middle" > 
        <%=rows[i].getString("click")%>
      </td>
      <td width="8%" align="center" valign="middle" ><input type="button" name="Submit3" value="修改" onClick="modPro(<%=rows[i].getString("pid")%>)">
        <input type="button" name="Submit5" value="删除" onClick="delPro(<%=rows[i].getString("pid")%>)"> </td>
    </tr>
    <%
}
%>
  </form>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
  <form name="dataForm">
          <input type="hidden" name="p">
          <input type="hidden" name="name" value="<%=name%>">
          <input type="hidden" name="cid" value="<%=cid%>">
		  <input type="hidden" name="pgid" value="<%=pgid%>">
        </form>
        <tr> 
          
    <td height="28" align="right" valign="middle"> 
      <%
int pre = pc.getPageNo() - 1;
int next = pc.getPageNo() + 1;
out.println("页数:" + pc.getPageNo() + "/" + pc.getPageCount() + " &nbsp;&nbsp;总数:" + pc.getAllCount() + " &nbsp;&nbsp;");
out.println(HtmlUtil.aStyleLink("catalog","首页","javascript:go(1)",null,pc.isFirst()));
out.println(HtmlUtil.aStyleLink("catalog","上一页","javascript:go(" + pre + ")",null,pc.isFornt()));
out.println(HtmlUtil.aStyleLink("catalog","下一页","javascript:go(" + next + ")",null,pc.isNext()));
out.println(HtmlUtil.aStyleLink("catalog","末页","javascript:go(" + pc.getPageCount() + ")",null,pc.isLast()));
%>
      跳转到 
      <input name="jump_p2" type="text" id="jump_p" style="width=28px;" value="<%=StringUtil.getInt(request,"p")%>"> 
      <input type="button" name="Submit22" value="GO" style="width:28px;padding-top:0px;" onClick="javascript:go(document.getElementById('jump_p2').value)"> 
    </td>
        </tr>
      </table> 
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -