1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="content-Type" content="text/html; charset=windows-1250" />
  6. <title>Ra?un</title>
  7.  
  8. <meta id="Author" content="Sandi Verdev" />
  9. <meta id="Generator" content="Notepad++" />
  10. <script type="text/javascript" language="javascript">
  11. function poracun(theForm, id) {
  12. skupaj = eval(document.getElementById('enot_' + id).value) * eval(document.getElementById('cena_' + id).value);
  13. ddv = skupaj * eval(document.getElementById('ddv_' + id).value) / 100;
  14. skupaj += ddv;
  15. if(skupaj >= 0) {
  16. document.getElementById('skupaj_' + id).innerHTML = skupaj;
  17. } else {
  18. document.getElementById('skupaj_' + id).innerHTML = 0;
  19. ddv = 0;
  20. }
  21. return ddv;
  22. }
  23. function skupaj(theForm) {
  24. var skupaj = 0;
  25. var ddv = 0;
  26. for(i = 1; i <= 10; i++) {
  27. ddv += poracun(theForm, i);
  28. skupaj += eval(document.getElementById('skupaj_' + i).innerHTML);
  29. }
  30. skupaj += ddv;
  31. document.getElementById('skupaj').innerHTML = skupaj;
  32. document.getElementById('ddv').innerHTML = ddv;
  33. }
  34. function obroki() {
  35. skupaj = eval(document.getElementById('skupaj').innerHTML);
  36. if(eval(document.getElementById('obrokov').value) < 1) {
  37. document.getElementById('obrokov').value = 1;
  38. } else if(eval(document.getElementById('obrokov').value) > 1) {
  39. skupaj += skupaj * 5 / 100;
  40. }
  41. document.getElementById('obroki').innerHTML = skupaj / eval(document.getElementById('obrokov').value);
  42. }
  43. </script>
  44. </head>
  45. <body>
  46. <form id="racun" action="index.htm" method="post">
  47. <table cellpadding="0" cellspacing="0" border="1">
  48. <tr>
  49. <td>Zap. ?t.</td>
  50. <td>Opis storitve</td>
  51. <td>?tevilo enot</td>
  52. <td>Cena na enoto</td>
  53. <td>DDV</td>
  54. <td>Skupaj</td>
  55. </tr>
  56. <tr>
  57. <td>1.</td>
  58. <td><input type="text" size="80" id="opis_1" /></td>
  59. <td><input type="text" id="enot_1" /></td>
  60. <td><input type="text" id="cena_1" /></td>
  61. <td>
  62. <select id="ddv_1">
  63. <option value="8">8 %</option>
  64. <option value="20" selected="selected">20 %</option>
  65. </select>
  66. </td>
  67. <td id="skupaj_1" onclick="poracun(this, 1)"></td>
  68. </tr>
  69. <tr>
  70. <td>2.</td>
  71. <td><input type="text" size="80" id="opis_2" /></td>
  72. <td><input type="text" id="enot_2" /></td>
  73. <td><input type="text" id="cena_2" /></td>
  74. <td>
  75. <select id="ddv_2">
  76. <option value="8">8 %</option>
  77. <option value="20" selected="selected">20 %</option>
  78. </select>
  79. </td>
  80. <td id="skupaj_2" onclick="poracun(this, 2)"></td>
  81. </tr>
  82. <tr>
  83. <td>3.</td>
  84. <td><input type="text" size="80" id="opis_3" /></td>
  85. <td><input type="text" id="enot_3" /></td>
  86. <td><input type="text" id="cena_3" /></td>
  87. <td>
  88. <select id="ddv_3">
  89. <option value="8">8 %</option>
  90. <option value="20" selected="selected">20 %</option>
  91. </select>
  92. </td>
  93. <td id="skupaj_3" onclick="poracun(this, 3)"></td>
  94. </tr>
  95. <tr>
  96. <td>4.</td>
  97. <td><input type="text" size="80" id="opis_4" /></td>
  98. <td><input type="text" id="enot_4" /></td>
  99. <td><input type="text" id="cena_4" /></td>
  100. <td>
  101. <select id="ddv_4">
  102. <option value="8">8 %</option>
  103. <option value="20" selected="selected">20 %</option>
  104. </select>
  105. </td>
  106. <td id="skupaj_4" onclick="poracun(this, 4)"></td>
  107. </tr>
  108. <tr>
  109. <td>5.</td>
  110. <td><input type="text" size="80" id="opis_5" /></td>
  111. <td><input type="text" id="enot_5" /></td>
  112. <td><input type="text" id="cena_5" /></td>
  113. <td>
  114. <select id="ddv_5">
  115. <option value="8">8 %</option>
  116. <option value="20" selected="selected">20 %</option>
  117. </select>
  118. </td>
  119. <td id="skupaj_5" onclick="poracun(this, 5)"></td>
  120. </tr>
  121. <tr>
  122. <td>6.</td>
  123. <td><input type="text" size="80" id="opis_6" /></td>
  124. <td><input type="text" id="enot_6" /></td>
  125. <td><input type="text" id="cena_6" /></td>
  126. <td>
  127. <select id="ddv_6">
  128. <option value="8">8 %</option>
  129. <option value="20" selected="selected">20 %</option>
  130. </select>
  131. </td>
  132. <td id="skupaj_6" onclick="poracun(this, 6)"></td>
  133. </tr>
  134. <tr>
  135. <td>7.</td>
  136. <td><input type="text" size="80" id="opis_7" /></td>
  137. <td><input type="text" id="enot_7" /></td>
  138. <td><input type="text" id="cena_7" /></td>
  139. <td>
  140. <select id="ddv_7">
  141. <option value="8">8 %</option>
  142. <option value="20" selected="selected">20 %</option>
  143. </select>
  144. </td>
  145. <td id="skupaj_7" onclick="poracun(this, 7)"></td>
  146. </tr>
  147. <tr>
  148. <td>8.</td>
  149. <td><input type="text" size="80" id="opis_8" /></td>
  150. <td><input type="text" id="enot_8" /></td>
  151. <td><input type="text" id="cena_8" /></td>
  152. <td>
  153. <select id="ddv_8">
  154. <option value="8">8 %</option>
  155. <option value="20" selected="selected">20 %</option>
  156. </select>
  157. </td>
  158. <td id="skupaj_8" onclick="poracun(this, 8)"></td>
  159. </tr>
  160. <tr>
  161. <td>9.</td>
  162. <td><input type="text" size="80" id="opis_9" /></td>
  163. <td><input type="text" id="enot_9" /></td>
  164. <td><input type="text" id="cena_9" /></td>
  165. <td>
  166. <select id="ddv_9">
  167. <option value="8">8 %</option>
  168. <option value="20" selected="selected">20 %</option>
  169. </select>
  170. </td>
  171. <td id="skupaj_9" onclick="poracun(this, 9)"></td>
  172. </tr><tr>
  173. <td>10.</td>
  174. <td><input type="text" size="80" id="opis_10" /></td>
  175. <td><input type="text" id="enot_10" /></td>
  176. <td><input type="text" id="cena_10" /></td>
  177. <td>
  178. <select id="ddv_10">
  179. <option value="8">8 %</option>
  180. <option value="20" selected="selected">20 %</option>
  181. </select>
  182. </td>
  183. <td id="skupaj_10" onclick="poracun(this, 10)"></td>
  184. </tr>
  185. <tr>
  186. <td colspan="3"></td>
  187. <td align="right">Skupaj:</td>
  188. <td id="skupaj" colspan="2" onclick="skupaj(this)"></td>
  189. </tr>
  190. <tr>
  191. <td colspan="3"></td>
  192. <td align="right">od tega DDV:</td>
  193. <td id="ddv" colspan="2" onclick="skupaj(this)"></td>
  194. </tr>
  195. <tr>
  196. <td colspan="3"></td>
  197. <td align="right">na <input type="text" id="obrokov" size="2" value="1" /> obrokov:</td>
  198. <td id="obroki" colspan="2" onclick="obroki(this)"></td>
  199. </tr>
  200. </table>
  201. </form>
  202. </body>
  203. </html>