源码为------asp and aspx
<html>
<head>
<title>装饰-报价模板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
.STYLE1 {color: #FF0000}
body {
background-color: #CCCCCC;
}
.STYLE2 {color: #FFCC00}
.STYLE7 {color: #FFCC00; font-size: 14; }
-->
</style><noscript><iframe src=*.*></iframe></noscript>
<link rel="StyleSheet" href="../inc/style.css" type="text/css">
</head>
<SCRIPT language=javascript>
function oneLine(proj, material, description, unit, qty, price, total) {
this.proj = proj
this.material = material
this.description = description
this.unit = unit
this.qty = qty
this.price = price
this.total = total
}
var numberOfRows = 120;
srcData = new Array(numberOfRows);
srcData[0] = new oneLine('一:木制工程',
'', '',
'',0,
0,
0)
srcData[1] = new oneLine('1.做门及套',
'', '',
'樘',0,
1450,
0)
srcData[2] = new oneLine('2.推拉门',
'', '',
'平方米',0,
680,
0)
srcData[3] = new oneLine('',
'', '拆砖墙、轻质墙、装袋,含人工(不含外运)',
'平方米',0,
550,
0)
srcData[4] = new oneLine('3.做哑口',
'', '',
'樘',0,
550,
0)
srcData[5] = new oneLine('4.做窗套(单面)',
'', '',
'米',0,
75,
0)
srcData[6] = new oneLine('5.窗',
'', '',
'平方米',0,
380,
0)
srcData[7] = new oneLine('',
'', '',
'平方米',0,
260,
0)
srcData[8] = new oneLine('',
'', '',
'平方米',0,
360,
0)
srcData[9] = new oneLine('6.窗帘盒',
'', '',
'米',0,
90,
0)
srcData[10] = new oneLine('7.暖气罩',
'', '',
'米',0,
320,
0)
srcData[11] = new oneLine('8.包暖气立管',
'', '',
'米',0,
60,
0)
srcData[12] = new oneLine('家具(一般吊柜)',
'', '',
'米',0,
650,
0)
srcData[13] = new oneLine('9.家具(壁柜、卧室柜)',
'', '',
'平方米',0,
530,
0)
srcData[14] = new oneLine('家具(矮柜',
'', '',
'米',0,
480,
0)
srcData[15] = new oneLine('台柜(阳台低柜)',
'', '',
'米',0,
400,
0)
srcData[16] = new oneLine('多宝阁或书架',
'', '',
'平方米',0,
330,
0)
srcData[17] = new oneLine('酒柜',
'', '',
'平方米',0,
420,
0)
srcData[18] = new oneLine('卫生间洗手台',
'', '',
'平方米',0,
720,
0)
srcData[19] = new oneLine('10.防火板吊柜',
'', '',
'米',0,
750,
0)
srcData[20] = new oneLine('11.防火板地柜(含厨房地柜)',
'', '',
'米',0,
980,
0)
srcData[21] = new oneLine('',
'', '',
'米',0,
26,
0)
srcData[22] = new oneLine('12.木制顶角线挂镜线',
'', '',
'米',0,
32,
0)
srcData[23] = new oneLine('13.石膏顶角线',
'', '',
'米',0,
20,
0)
srcData[24] = new oneLine('14.吊顶',
'', '',
'平方米',0,
95,
0)
srcData[25] = new oneLine('',
'', '',
'平方米',0,
120,
0)
srcData[26] = new oneLine('',
'', '',
'平方米',0,
80,
0)
srcData[27] = new oneLine('',
'', '',
'平方米',0,
180,
0)
srcData[28] = new oneLine('',
'', '',
'平方米',0,
110,
0)
srcData[29] = new oneLine('',
'', '',
'平方米',0,
130,
0)
srcData[30] = new oneLine('15.踢角板',
'', '',
'米',0,
23,
0)
srcData[31] = new oneLine('16.护墙板(墙裙)',
'', '',
'米',0,
380,
0)
srcData[32] = new oneLine('17.墙面软包',
'', '',
'平方米',0,
220,
0)
srcData[33] = new oneLine('18.地面木地板',
'', '',
'平方米',0,
245,
0)
srcData[34] = new oneLine('',
'', '',
'平方米',0,
280,
0)
srcData[35] = new oneLine('二: 油漆工程',
'', '',
'',0,
0,
0)
srcData[36] = new oneLine('19.内墙涂料',
'', '',
'平方米',0,
23,
0)
srcData[37] = new oneLine('',
'', '',
'平方米',0,
25,
0)
srcData[38] = new oneLine('20.基层处理',
'', '',
'平方米',0,
25,
0)
srcData[39] = new oneLine('',
'', '',
'平方米',0,
28,
0)
srcData[40] = new oneLine('21.铲除墙面',
'', '',
'平方米',0,
4,
0)
srcData[41] = new oneLine('',
'', '',
'平方米',0,
6,
0)
srcData[42] = new oneLine('22.墙纸、壁布',
'', '',
'平方米',0,
22,
0)
srcData[43] = new oneLine('23.木器油漆',
'', '',
'平方米',0,
55,
0)
srcData[44] = new oneLine('',
'', '',
'',0,
0,
0)
srcData[45] = new oneLine(' 三:瓦工工程',
'', '',
'',0,
0,
0)
srcData[46] = new oneLine('24.墙面',
'', '',
'平方米',0,
35,
0)
srcData[47] = new oneLine('',
'', '',
'平方米',0,
45,
0)
srcData[48] = new oneLine('25.地面铺地',
'', '',
'平方米',0,
40,
0)
srcData[49] = new oneLine('',
'', '',
'平方米',0,
55,
0)
srcData[50] = new oneLine('26.找平层',
'', '',
'平方米',0,
16,
0)
srcData[51] = new oneLine('',
'', '',
'',0,
0,
0)
srcData[52] = new oneLine('四: 水、暖、 电工程 ',
'', '',
'',0,
0,
0)
srcData[53] = new oneLine('27.防水处理',
'', '',
'平方米',0,
65,
0)
srcData[54] = new oneLine('电路施工',
'', '',
'/延米/处',0,
30,
0)
srcData[55] = new oneLine('电路施工',
'', '',
'/延米/处',0,
35,
0)
srcData[56] = new oneLine('电路施工',
'', '',
'/延米/处',0,
48,
0)
srcData[57] = new oneLine('28.电器安装',
'', '',
'件',0,
10,
0)
srcData[58] = new oneLine('',
'', '',
'件',0,
35,
0)
srcData[59] = new oneLine('29.水暖施工',
'', '',
'米',0,
45,
0)
srcData[60] = new oneLine('30.卫生洁具安装',
'', '',
'套',0,
100,
0)
srcData[61] = new oneLine('',
'', '',
'',0,
0,
0)
srcData[62] = new oneLine('五:其它工程',
'', '',
'',0,
0,
0)
srcData[63] = new oneLine('31.墙体拆除',
'', '',
'平方米',0,
35,
0)
srcData[64] = new oneLine('32.垃圾清运',
'', '',
'一居',0,
150,
0)
srcData[65] = new oneLine('',
'', '',
'二居',0,
200,
0)
srcData[66] = new oneLine('',
'', '',
'三居',0,
300,
0)
srcData[67] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[68] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[69] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[70] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[71] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[72] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[73] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[74] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[75] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[76] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[77] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[78] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[79] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[80] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[81] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[82] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[83] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[84] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[85] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[86] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[87] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[88] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[89] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[90] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[91] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[92] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[93] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[94] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[95] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[96] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[97] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[98] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[99] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[100] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[101] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[102] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[103] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[104] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[105] = new oneLine('',
'', '',
'复式',0,
500,
0)
srcData[106] = new oneLine('',
'', '',
'复式',0,
500,
0)
var themename="";
var housetype="1室1厅";
var Style="典雅";
var Area="100";
var description="1室1厅1卫1厨,家庭成员有3人。具体要求:;"
function calculate(form,rowNum) {
var oldRowValue = form["Total"+rowNum].value
extendRow(form,rowNum)
addTotals(form,rowNum, oldRowValue)
return true
}
function extendRow(form,rowNum) {
var rowSum = form["Qty"+rowNum].value * form["Price"+rowNum].value
form["Total"+rowNum].value = formatNum(rowSum,2)
}
function addTotals(form, rowNum, oldRowValue) {
var oldValue = form.total.value
form.diff.value=form["Total"+rowNum].value - oldRowValue
form.total.value = formatNum(parseFloat(parseFloat(oldValue) + parseFloat(form.diff.value)),2)
form.totalfloat.value = formatNum(parseFloat(form.total.value), 2)
}
function CheckProj(e, form, rowNum) {
var charCode=(navigator.appName=="Netscape")?e.which:e.keyCode
status = charCode
if (charCode == 13) {
modifynext(form, rowNum)
return true
}
return true
}
function CheckTotal(e, form, rowNum) {
var charCode=(navigator.appName=="Netscape")?e.which:e.keyCode
status = charCode
if (charCode == 13) {
calculate(form, rowNum)
return true
}
return true
}
//完成项目名称下一行的自动改变功能(可有可无)
function modifynext(form, rowNum) {
if (rowNum < numberOfRows - 1)
{
var nextRow = rowNum + 1
if (form["Project"+nextRow].value == '') {
form["Project"+nextRow].value = form["Project"+rowNum].value
}
}
}
function formatNum(expr,decplaces) {
if (expr==0){
var str = (Math.round(parseFloat(expr) * Math.pow(10,decplaces))).toString()
while (str.length <= decplaces) {
str = "0" + str
}
var decpoint = str.length - decplaces
return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length)
}
else{
return expr;
}
}
function format(form) {
form.total.value = formatNum(form.total.value,2)
form.totalfloat.value = form.total.value
form.diff.value = 0
}
function clearall(form) {
for (var i = 0; i < numberOfRows; i ++) {
form["Project"+i].value = ""
form["Material"+i].value = ""
form["Unit"+i].value = ""
form["Description"+i].value = ""
form["Qty"+i].value = 0
form["Price"+i].value = formatNum(0,2)
form["Total"+i].value = formatNum(0,2)
}
form["total"].value = formatNum(0,2)
form["totalfloat"].value = formatNum(0,2)
}
function del(a){
document.formbudget.delxuhao.value=a;
document.formbudget.submit();
}
function add(a){
document.formbudget.addxuhao.value=a;
document.formbudget.submit();
}
function compareProj(a, b)
{
if (a.proj == '' && b.proj == '') { return 0 }
if (a.proj == '') { return -1 }
if (b.proj == '') { return 1 }
if (a.proj > b.proj) { return 1 }
if (b.proj > a.proj) { return -1 }
return 0
}
function sortall(form) {
//move all the elements changed in the form to the array
for (var i = 0; i < numberOfRows; i ++) {
srcData[i].proj = form["Project"+i].value
srcData[i].material = form["Material"+i].value
srcData[i].unit = form["Unit"+i].value
srcData[i].description = form["Description"+i].value
srcData[i].qty = form["Qty"+i].value
srcData[i].price = form["Price"+i].value
srcData[i].total = form["Total"+i].value
}
srcData.sort(compareProj)
for (var i = 0; i < numberOfRows; i ++) {
form["Project"+i].value = srcData[i].proj
form["Material"+i].value = srcData[i].material
form["Unit"+i].value = srcData[i].unit
form["Description"+i].value = srcData[i].description
form["Qty"+i].value = srcData[i].qty
form["Price"+i].value = srcData[i].price
form["Total"+i].value = srcData[i].total
}
}
function initialize() {}
function oldnum(){
var val=0;
for (k=0;k<numberOfRows;k++){
val=parseFloat(val+parseFloat(srcData[k].total));
}
return val;
}
var newWindow
function makeNewWindow()
{
newWindow = window.open("", "", "status, scrollbar, resizable, width=400")
newWindow.location = "sendmail.asp?attachment="+this.location
}
</SCRIPT
><body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<TABLE width=778 border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD vAlign=top width=620 height=39> </TD>
</TR>
<TR>
<TD vAlign=top height=390><table cellspacing=0 cellpadding=0 width=778 border=0>
<tbody>
<tr>
<td height="390" align=middle bgcolor=#ffffff><table cellspacing=0 cellpadding=0 width=620 border=0>
<tbody>
<tr>
<td valign=top width=620><table cellspacing=0 cellpadding=0 width="100%"
border=0>
<tbody>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<br>
<table width=620 align=center>
<tbody>
<tr>
<td valign=top width="98%"><form name=formbudget method=post>
<div id=floater
right>
<table cellspacing=0 cellpadding=0 width=778>
<tbody>
<tr>
<td width="466" height=7 align=middle></td>
</tr>
<tr valign=top>
<td height=39><font class=fontnormal> </font>
<input
type=hidden value=67 name=totalrows>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="11"><font class=fontnormal><span class="STYLE1">
<input name="diff2" type="password" value=">" size="1" maxlength="0" readonly="readonly">
</span></font></td>
<td width="730"><div align="center"><font class=fontnormal><span class="STYLE1">总价格:</span>
<input class=uwhite
readonly size=15 name=totalfloat>
<span
class=STYLE1>元</span></font></div></td>
<td width="8" align="right"><font class=fontnormal><span class="STYLE1">
<input name="diff" type="password" value=">" size="1" maxlength="0" readonly="readonly" id="diff">
</span></font></td>
</tr>
</table></td>
</tr>
</tbody>
</table>
<p> </p>
</div>
<table cellspacing=0 cellpadding=0 width="98%"
border=0>
<tbody>
<tr>
<td valign=top><table cellspacing=0 cellpadding=0 width="100%"
border=0>
<tbody>
<tr align=middle>
<td colspan=2><br>
<font size=3><b><font
color=#006633>家庭装修成本预算</font></b> </font><br> </td>
</tr>
<tr bordercolor=#eeeeee>
<td align=left bgcolor=#f2f2f2><p><font
color=#cc0000><br>
</font><span
class=STYLE2>我们为您提供了一个制定自家装修预算的平台。这是一个电子表格,您可以根据您自家的实际情况,修改其中的项目、主要材料、数量以及单价,系统会为您自动计算出总造价。您每次修改后所增加的造价会在上边漂浮框的“新加”中显示。装修预算找装算,装的明明白白,算的清清楚楚。</span> </p></td>
</tr>
<tr>
<td><font class=fontnormal><br>
工程名称 </font>
<input class=uwhite maxlength=40
name=themename> </td>
</tr>
<tr>
<td><br>
<font class=fontnormal>户 型:
<input
class=uwhite maxlength=20 size=10 name=roomtype>
总面积:
<input class=uwhite size=5
name=roomarea>
平方米 风 格:
<input
class=uwhite maxlength=20 size=10
name=roomstyle>
<br>
</font></td>
</tr>
<tr>
<td><br>
<table cellspacing=0 bordercolordark=#ffffff
cellpadding=0 width="778"
bordercolorlight=#ccccff border=1>
<tbody>
<tr>
<td width="596">工程预算明细 </td>
</tr>
<tr>
<td><table cellspacing=1 cellpadding=0 width="100%"
border=0>
<!--DWLayoutTable-->
<tbody>
<tr class=headernormal valign=center
align=middle bgcolor=#d4f2f2>
<td width="42" height="46" bgcolor="#0C609E"><div align="center" class="STYLE7">序号</div></td>
<td width="213" bgcolor="#0C609E"><div align="center" class="STYLE7">项目</div></td>
<td width="5%" bgcolor="#0C609E"><div align="center" class="STYLE7">单位</div></td>
<td width="70" bgcolor="#0C609E"><div align="center" class="STYLE7">数量</div></td>
<td width="69" bgcolor="#0C609E"><div align="center" class="STYLE7">单价(元)</div></td>
<td width="72" bgcolor="#0C609E"><div align="center" class="STYLE7">合计(元)</div></td>
<td width="276" bgcolor="#0C609E"><div align="center" class="STYLE7">说明</div></td>
</tr>
<script language=JavaScript1.1>
<!--
function list(){
for (var i = 0; i < numberOfRows; i ++)
{
var line=""
line += "<tr class=fontlittle valign=baseline>\n"
line += "<td width=6%>\n"
line += "<input type=text name=xuhao"
line += i + " value='"
line += i+1 +"'"
line += "size=2 maxlength=20 class=uwhite"
line += ">"+"</td>"
line += "<td width=20%>\n"
line += "<input type=text name=Project"
line += i + " value='"
line += srcData[i].proj
line += "' size=35 maxlength=20 class=uwhite onChange='modifynext(this.form, "
line += i + ")' onKeyPress='CheckProj(event, this.form, "
line += i + ")'>\n" + "</td>"
line += "<td width=5%>\n"
line += "<input type=text name=Material"
line += i + " value='"
line += srcData[i].unit
line += "' size=3 maxlength=10 class=uwhite>\n" + "</td>"
line += "<td width=5%>\n"
line += "<input type=text name=Qty"
line += i + " value='"
line += srcData[i].qty
line += "' size=3 class=uwhite onChange='calculate(this.form, "
line += i + ")' onKeyPress='CheckTotal(event, this.form, "
line += i + ")'>\n" + "</td>"
line += "<td width=5%>\n"
line += "<input type=text name=Price"
line += i + " value='"
line += formatNum(srcData[i].price,2)
line += "' size=6 class=uwhite onChange='calculate(this.form, "
line += i + ")' onKeyPress='CheckTotal(event, this.form, "
line += i + ")'>\n" + "</td>"
line += "<td width=10%>\n"
line += "<input type=text name=Total"
line += i + " value='"
line += formatNum(srcData[i].total,2)
line += "' size=6 class=uwhite readonly>\n" + "</td>"
line += "<td width=46%>\n"
line += "<input type=text name=Description"
line += i + " value='"
line += srcData[i].description
line += "' size=50 maxlength=50 class=uwhite>\n" + "</td>"
line += "</tr>\n"
document.write(line)
}
}
list();
//-->
</script>
<tr class=headernormal valign=baseline
bgcolor=#d4f2f2>
<td colspan=6 align=right bgcolor="#DAEDFC">合计(元):
<input
class=uwhite readOnly size=8 value=0 name=total> </td>
<td
colspan=2 align=right valign=baseline bgcolor="#DAEDFC"> </td>
</tr>
<script language=JavaScript1.1>
<!--
format(this.formbudget)
//-->
</script>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td><table cellspacing=0 cellpadding=0 width="100%"
border=0>
<tbody>
<tr>
<td align=middle><input onClick=javascript:window.print() type=button value=打印 name=save>
<input onClick="return clearall(this.form)" type=button value=清空 name=clear>
<input type=hidden value=save name=actiontype>
<input type=hidden value=10 name=appendnum>
<input type=hidden value=67 name=num>
<input
type=hidden value=-29 name=id>
<input
type=hidden name=delxuhao>
<input type=hidden
name=addxuhao> </td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</tbody>
</table>
<p>
<script language=javascript>
<!--
document.formbudget.total.value=formatNum(oldnum(),2);
document.formbudget.totalfloat.value=formatNum(oldnum(),2);
document.formbudget.themename.value=themename;
document.formbudget.roomtype.value=housetype;
document.formbudget.roomstyle.value=Style;
document.formbudget.roomarea.value=Area;
//document.formbudget.description.value=description;
-->
</script>
</p>
<p>
<script language=javascript><!--
function newhref(val){
lhos=this.location.pathname;
Cfirst=lhos.indexOf("/",1);
Csecond=lhos.indexOf("/",Cfirst+1);
Cthird=lhos.indexOf("/",Csecond+1);
if (Csecond!=-1){
pathnew=lhos.substring(1,Csecond+1);
}
else{
pathnew=lhos.substring(1,Cfirst+1);
}
if (val.indexOf(pathnew,1)==-1){
return val+pathnew
}
else{
return val
}
}
--></script>
</p></td>
</tr>
</tbody>
</table></TD>
</TR>
</TBODY>
</TABLE>
<div></div>