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

📄 info_sale_product.tpl

📁 渣渣网络商店系统ZZShop v1.0完整运行程序,MYSQL数据库,APACHE服务器
💻 TPL
字号:
<link rel='stylesheet' href='js/calendar/calendar-mos.css'>
<script language='javascript' src=js/calendar/calendar.js></script>
<script type="text/javascript" src="js/calendar/lang/calendar-en.js"></script>
<script language='javascript'>
<!--
	var calendar = null;
	
	function selected(cal, date)
	{
		cal.sel.value = date; // just update the value of the input field
	}
	
	function closeHandler(cal)
	{
		cal.hide();			// hide the calendar
	
		// don't check mousedown on document anymore (used to be able to hide the
		// calendar when someone clicks outside it, see the showCalendar function).
		Calendar.removeEvent(document, "mousedown", checkCalendar);
	}

	function checkCalendar(ev)
	{
		var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
		for (; el != null; el = el.parentNode)
		// FIXME: allow end-user to click some link without closing the
		// calendar.  Good to see real-time stylesheet change :)
		if (el == calendar.element || el.tagName == "A") break;
		if (el == null) {
			// calls closeHandler which should hide the calendar.
			calendar.callCloseHandler(); Calendar.stopEvent(ev);
		}
	}
	
	function showCalendar(id)
	{
		var el = document.getElementById(id);
		
		var cal = new Calendar(true, null, selected, closeHandler);

		calendar = cal;		// remember the calendar in the global
		cal.setRange(1900, 2070);	// min/max year allowed
		calendar.create();		// create a popup calendar
		
		calendar.sel = el;		// inform it about the input field in use
		calendar.showAtElement(el);	// show the calendar next to the input field

		Calendar.addEvent(document, "mousedown", checkCalendar);
	}
//-->	
</script>
<script language='javascript'>
<!--
	function checkValue()
	{
		var Obj = document.frmInfo;
		
		if(!Obj.ProductCoding.value)
		{
			alert('请先选择产品编码');
			
			Obj.ProductCoding.focus();
			
			return false;
		}
		
		if(!Obj.StartTime.value)
		{
			alert('请输入有效日期. ');

			Obj.StartTime.focus();
			return false;
		}
		
		if(!Obj.Expire.value)
		{
			alert('请输入有效日期. ');

			Obj.Expire.focus();
			return false;
		}
		
		for(var i = 0; i < Obj.StartQuantity.length; i ++)
		{
			if(!Obj.StartQuantity[i].value) continue;
			
			for(var j = 0; j < Obj.StartQuantity.length; j++)
			{
				if(i == j) continue;
				
				if(!Obj.StartQuantity[j].value || !Obj.EndQuantity[j].value) continue;
				
				if(parseInt(Obj.StartQuantity[i].value) >= parseInt(Obj.StartQuantity[j].value) && parseInt(Obj.StartQuantity[i].value) < parseInt(Obj.EndQuantity[j].value))
				{
					alert('促销规则不正确, 数量重叠, ' + (i + 1) + '和第 ' + (j+1) + '条规则重叠');
					
					Obj.StartQuantity[i].focus();
					Obj.StartQuantity[i].select();
					
					return false;
				}

				if(parseInt(Obj.EndQuantity[i].value) > parseInt(Obj.StartQuantity[j].value) && parseInt(Obj.EndQuantity[i].value) < parseInt(Obj.EndQuantity[j].value))
				{
					alert('促销规则不正确, 数量重叠, ' + (i + 1) + '和第 ' + (j+1) + '条规则重叠');
					
					Obj.EndQuantity[i].focus();
					Obj.EndQuantity[i].select();
					
					return false;
				}
				
			}
		}
		
		return true;
	}
	
	function selectProduct(obj)
	{
		var ID = 0;

		ID = showModalDialog('{PHP_SELF}?act=product&code=sel_product', document.frmInfo, 'resizable:yes;status:no;center:yes;help:no;dialogWidth:' + (screen.availWidth - 200) + 'px;dialogHeight:' + (screen.availHeight - 100) + 'px');
		
		if(ID.length > 0) obj.value = ID;
	}
	
//-->
</script>
<form action="{ACTION}" method='POST' name='frmInfo' onSubmit='return checkValue();' enctype='multipart/form-data'>
<table width="100%"  border="0"  cellspacing=0 cellpadding=5 class=adminform>
  <tr class='info_title'>
  	<td colspan="8"><strong>添加/修改促销商品</strong></td>
  </tr>
  <tr class='info_content'>
    <td width=100>产品编码:</td>
    <td>
    	<input type=text size=15 name=ProductCoding value='{ProductCoding}'> &nbsp;
    	<a href='#' onClick='selectProduct(frmInfo.ProductCoding);'>选择</a>
    </td>
    <td width=180>选择要设定的商品</td>
  </tr>
  <tr class='info_content'>
    <td width=100>产品名称:</td>
    <td>
    	<input type=text size=40 name=ProductName disabled value='{ProductName}'>
    </td>
    <td>产品对应的名称</td>
  </tr>
  <tr class='info_content'>
    <td width=100>有效日期:</td>
    <td>
    	<input name="StartTime" type="text" value="{strStartTime}" size=12>
    	<input type=button value='..' onClick='showCalendar("StartTime");'> 
    	-
    	<input name="Expire" type="text" value="{strExpire}" size=12>
    	<input type=button value='..' onClick='showCalendar("Expire");'> 
    </td>
    <td>此促销有效日期范围</td>
  </tr>
  <tr class='info_title'>
  	<td colspan="8"><strong>促销规则</strong></td>
  </tr>
  <!-- beginRow Rule -->
  <tr class='info_content'>
    <td colspan=3>
    	数量从 <input type=text name='StartQuantity[]' id='StartQuantity' size=6 value='{Rule.StartQuantity}'> 到 
    	<input type=text name='EndQuantity[]' id=EndQuantity size=6 value='{Rule.EndQuantity}'> (不含)
		
		&nbsp;
    	单价为: <input type=text name='Price[]' id='Price' size=6 value='{Rule.Price}'>
    </td>
  </tr>
  <!-- endRow Rule -->
  <tr>
    <td colspan=3>
    	<b>注意:</b> 请注意数量不要重叠.
  	</td>
  </tr>
  <tr align="center" class='info_bottom'>
    <td colspan="4">
		<input type="submit" value="{Caption}">
		<input type="button" onClick='doCancle();' value="取消(C)" accesskey="c">
		<input name="btnSubmit" type="hidden" id="btnSubmit" value="1">
	</td>
  </tr>
</table>
</form>
<script language='javascript'>
<!--
	document.frmInfo.ProductCoding.focus();
//-->
</script>

⌨️ 快捷键说明

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