Показать сообщение отдельно
  #1 (permalink)  
Старый 03.02.2013, 00:31
Интересующийся
Отправить личное сообщение для difurios Посмотреть профиль Найти все сообщения от difurios
 
Регистрация: 03.02.2013
Сообщений: 10

Нужна помощь в калькуляторе
Нужно взять количесво машын(count) и умножыть на результат (sumall)
<script type="text/javascript">
	<!--
		function toggle_visibility(id) {
		   var e = document.getElementById(id);
		   if(e.style.display == '')
			  e.style.display = 'none';
		   else
			  e.style.display = '';
		}
	//-->
</script>

                <style type='text/css'>
                        #i1,#i2,#i3{display:none}       
                </style>
        </head>
        <body>
               <td class="style1 style2" colspan="5" bgcolor="#666666" bordercolor="#FFFFFF"><font color="#ffffff"><b>GPS Терминалы</b></font></td> 
                <p>
                  <select name="items" onChange="toggle_visibility('Dop');">
                    <option value="0">Galileo :2830 грн.
                    </div>
                    <option value="2";>Teltonika 1100 :1800 грн.
                    <option value="2";>ADM :2830 грн.
                    <option value="3" >Выберите один из вариантов
                  </select>
                </p>
                <div class="holster b-main">
  <div class="block_container s3 b-text b-static-text user_css_132646442559 " id="e_13298576547"></div><div class="block_container s3 b-text b-static-text user_css_132640450644" id="e_132986132452"><div class="_pm_clear_img" style="clear: both;"></div>
</div><div class="block_container s3 b-counter b-widget user_css_132640450644 txt-left " id="e_132913133461">
<p><script> 
rubprice=new Array (3040,1480,1540,380,70,550,760,1050,1250,400,600,150,800,700,800,150,30,1500,100,150,5000,6000,9000,150,30,1300,200,400,400,300,100,300,200,150,100,300,100,1600,500,100,500,600,900,600,300,1500,150,20,250,400,400,1000,600,150,150,200,300,300,300,500,500,5700,2800,60,150,150,30,100,450,40); 
rubel=new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); 
rubelsum=new Array (0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00); 
</script> 
 
<script> 
 var minimum=900; 
  
 function u1(x) 
 { 
 x1="u["+x+"]"; 
 x2="s["+x+"]"; 
 if (document.send.elements[x1].value=="") {document.send.elements[x1].value=0;}; 
 rubel[x]=document.send.elements[x1].value; 
 rubelsum[x]=rubel[x]*rubprice[x]; 
 document.send.elements[x2].value=rubelsum[x]+""; 
 totalsum=0; 
 for (i=0;i<rubelsum.length;i++) 
 { 
 totalsum=totalsum+rubelsum[i]; 
 } 
 document.send.elements["sumall"].value=totalsum+".00"; 
 } 
 
 function calcc()
 { 
 totalsum=totalsum*count; 
 document.send.elements["result"].value=totalsum+".00"; 
 } 
 
 function i1(x) 
 { 
 x1="u["+x+"]"; 
 document.send.elements[x1].value++; 
 u1(x); 
 } 
  
  
 function d1(x) 
 { 
 x1="u["+x+"]"; 
 if (document.send.elements[x1].value>0) 
 { 
 document.send.elements[x1].value--; 
 } 
 u1(x);     
 }  
  
  
 function b1(x) 
 { 
 x1="u["+x+"]"; 
 if (document.send.elements[x1].value=="") {document.send.elements[x1].value=0;}; 
 u1(x);     
 return; 
 } 
 
 
 function b2(x) 
 { 
 x1="u["+x+"]"; 
 if (document.send.elements[x1].value==0) {document.send.elements[x1].value="";}; 
 return; 
 } 
 
 function checkalls() 
 { 
 
 totalsum=0; 
 for (i=0;i<rubelsum.length;i++) 
 { 
 totalsum=totalsum+rubelsum[i]; 
 } 
 if ((totalsum<minimum)&&(totalsum>0)) 
 { 
 alert("Сумма заказа = "+totalsum+" руб. Сумма заказа должна составлять не менее "+minimum+" руб."); 
 return false; 
 } 
 if (totalsum<=0) 
 { 
 alert("Итоговая Сумма заказа не может быть 0 руб."); 
 return false; 
 } 
 
 n=1; 

 
 
 } 
  
function isemail(txt){  
 dog = txt.indexOf("@");  
 if ( 
 (txt.indexOf(".") == -1)|| 
 (dog <1)|| 
 (dog>txt.length-5)|| 
 (txt.charAt(dog - 1) == '.')|| 
 (txt.charAt(dog + 1) == '.')|| 
 (/[^A-Za-z0-9_\.@\-]/.test(txt)) 
 ) {return(false)} else {return true}  
} 
</script>
</p>
<form name="send" action="kal%20el.html?action=send&day=1577" method="post"> 
 <table width="820" id="Dop" border="1" cellpadding="4" cellspacing="1" bordercolor="#d5d5d5" bordercolorlight="#d5d5d5" id="table87"> 
 <tbody> 
 <tr align="center" bgcolor="#ffcb8a"> 
 <td class="style1 style2" colspan="5" bgcolor="#666666" bordercolor="#FFFFFF"><font color="#ffffff"><b>Дополнительные датчики</b></font></td> 
 </tr> 
 <tr class="style4" align="center" bgcolor="#ffe2bf"> 
 <td bgcolor="#666666"><font color="#FFFBEC"><b>Наименование</b></font></td> 
 <td width="40" bgcolor="#666666"><font color="#FFFBEC"><b>Ед.</b></font></td> 
<td width="40" bgcolor="#666666"><font color="#FFFBEC"><b>Количество</b></font></td> 
 <td width="60" bgcolor="#666666"><font color="#FFFBEC"><b>Стоимость</b></font></td> 
 </tr> 
 <tr class="style4" align="center"bgcolor="#ffffff"> 
 <td class="bludo" align="left" bgcolor="#d5d5d5"><font color="">1. Датчик уровня топлива.</font></td> 
 <td class="style5" bgcolor="#d5d5d5"><font color="">шт.</font></td> 
 <td align="middle" bgcolor="#d5d5d5"><table border="0" cellpadding="0" cellspacing="0" id="table88"> 
 <tbody> 
 <tr> 
 <td rowspan="2"><input class="kolvo" onblur="b1(0)" onfocus="b2(0)" onchange="u1(0)" value="0" name="u[0]" /> 
 </td> 
 <td> </td> 
 </tr> 
 <tr> 
 <td> </td> 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5"><input class="sum" readonly="readonly" value="0.00" name="s[0]" /> 
 </td> 
 </tr> 
 <tr class="style4" align="center" bgcolor="#ffe2bf"> 
 <td class="bludo" align="left" bgcolor="#d5d5d5"><font color="">2. Датчик угла наклона.</font></td> 
 <td class="style5" bgcolor="#d5d5d5"><font color="">шт.</font></td> 
  <td align="middle" bgcolor="#d5d5d5"><table border="0" cellpadding="0" cellspacing="0" id="table89"> 
 <tbody> 
 <tr> 
 <td rowspan="2"><input class="kolvo" onblur="b1(1)" onfocus="b2(1)" onchange="u1(1)" value="0" name="u[1]" /> 
 </td> 
 <td> </td> 
 </tr> 
 <tr> 
 <td> </td> 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5"><input class="sum" readonly="readonly" value="0.00" name="s[1]" /> 
 </td> 
 </tr> 
 <tr class="style4" align="center" bgcolor="#ffe2bf"> 
 <td class="bludo" align="left" bgcolor="#d5d5d5"><font color="">3. Датчик вращения.</font></td> 
<td class="style5" bgcolor="#d5d5d5"><font color="">шт.</font></td> 

 <td align="middle" bgcolor="#d5d5d5"><table border="0" cellpadding="0" cellspacing="0" id="table89"> 
 <tbody> 
 <tr> 
 <td rowspan="2"><input class="kolvo" onblur="b1(2)" onfocus="b2(2)" onchange="u1(2)" value="0" name="u[2]" /> 
 </td> 
 <td> </td> 
 </tr> 
 <tr> 
 <td> </td> 
 </tr> 
 </tbody> 
 </table></td> 
<td bgcolor="#d5d5d5"><input class="sum" readonly="readonly" value="0.00" name="s[2]" /> 
 </td> 
 </tr> 
 <tr class="style4" align="center" bgcolor="#ffe2bf"> 
 <td class="bludo" align="left" bgcolor="#d5d5d5"><font color="">4.  
Датчик температуры.</font></td> 
 <td class="style5" bgcolor="#d5d5d5"><font color="">шт.</font></td> 

 <td align="middle" bgcolor="#d5d5d5"><table border="0" cellpadding="0" cellspacing="0" id="table91"> 
 <tbody> 
 <tr> 
 <td rowspan="2"><input class="kolvo" onblur="b1(3)" onfocus="b2(3)" onchange="u1(3)" value="0" name="u[3]" /> 
 </td> 
 <td> </td> 
 </tr> 
 <tr> 
 <td> </td> 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5"><input class="sum" readonly="readonly" value="0.00" name="s[3]" /></td>
 </tr>
 <tr class="style4" align="center" bgcolor="#ffffff">
   <td bgcolor="#d5d5d5">&nbsp;</td>
 </tr>
 <tr class="style4" align="center" bgcolor="#ffe2bf">
   <td bgcolor="#d5d5d5">&nbsp;</td>
 </tr>
 <tr class="style4" align="center" bgcolor="#ffffff">
   <td bgcolor="#d5d5d5">&nbsp;</td> 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5">&nbsp;</td> 
 </tr> 
 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5">&nbsp;</td> 
 </tr>
 <tr class="style4" align="center" bgcolor="#ffffff"> 
 <td class="bludo" align="left" bgcolor="#d5d5d5"><font color="">8.  
Количесво машын.</font> </td> 
 <td class="style5" bgcolor="#d5d5d5"><font color="">.</font></td> 

 <td align="middle" bgcolor="#d5d5d5"><table border="0" cellpadding="0" cellspacing="0" id="table92"> 
 <tbody> 
 <tr> 
 <td rowspan="2"><input class="count" id="2" value="1" name="count" /> 
 </td> 
 <td> </td> 
 </tr> 
 <tr> 
 <td> </td> 
 </tr> 
 </tbody> 
 </table></td> 
 <td bgcolor="#d5d5d5">&nbsp;</td> 
 </tr>  
 <tr bgcolor="#ffe2bf"> 
 <td class="itogo" colspan="3" align="right" bgcolor="#d5d5d5"><b> <font size="2">                                                Сумма<span lang="en-us"> </span>оборудования  
 системы ( без стоимости монтажа и GPS терминала):</font></b></td> 
 <td align="center" bgcolor="#d5d5d5"><input class="sum sumall" readonly="readonly" id="1" size="9" value="0.00" name="sumall" /><b>
   <input class="result" id='result' name="result" />  
   гривень</b></td> 
 </tr> 
 <tr bgcolor="#fffbec"> 
 <td colspan="4" class="shapka" bgcolor="#FFFFFF"><p><b> 
 <a title="Обнулить калькулятор видеонаблюдения" href="/ceny/kalkulyator"> 
 Обнулить калькулятор</a></b></p>  <img src="1351950660_calculator.png " alt="Посчитать" width="64" height="64"  onclick="calcc()" align="right"/>
 </td> <marquee> 
 </marquee> 
  
 </table></td> 
 </tr> 
 </tbody> 
 </table> 

</form> 
 
</script>

</div>
		</div>
</td>
Ответить с цитированием