Commit ab8fcb024e9eb424a7ba3431f96fd50bc4cfbbe0
1 parent
8d713df8
Exists in
master
and in
7 other branches
Correção no contador de registros na ferramenta de listagem da tabela de atributos de um tema
Showing
2 changed files
with
18 additions
and
10 deletions
Show diff stats
ferramentas/tabela/index.htm
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | </div> | 27 | </div> |
| 28 | <div id=contador style="position:relative;top:15px;left:0px;text-align:center"> | 28 | <div id=contador style="position:relative;top:15px;left:0px;text-align:center"> |
| 29 | listar: <img style=cursor:pointer onclick='menosf()' src=../../imagens/minus.gif /> | 29 | listar: <img style=cursor:pointer onclick='menosf()' src=../../imagens/minus.gif /> |
| 30 | - <input type=text class=digitar size=5 value=0 id=inicio /> | 30 | + <input type=text class=digitar size=5 value=1 id=inicio /> |
| 31 | até | 31 | até |
| 32 | <input type=text class=digitar size=5 value=20 id=fim /> | 32 | <input type=text class=digitar size=5 value=20 id=fim /> |
| 33 | <img style=cursor:pointer onclick='maisf()'src=../../imagens/plus.gif /> | 33 | <img style=cursor:pointer onclick='maisf()'src=../../imagens/plus.gif /> |
ferramentas/tabela/index.js
| @@ -77,19 +77,27 @@ YAHOO.example.init = function () | @@ -77,19 +77,27 @@ YAHOO.example.init = function () | ||
| 77 | //conta menos 20 | 77 | //conta menos 20 |
| 78 | function menosf() | 78 | function menosf() |
| 79 | { | 79 | { |
| 80 | - $i("inicio").value = ($i("inicio").value * 1) - 20 | ||
| 81 | - if ($i("inicio").value < 0) | ||
| 82 | - {$i("inicio").value = 0} | ||
| 83 | - $i("fim").value = ($i("fim").value * 1) - 20 | ||
| 84 | - if ($i("fim").value < 0) | ||
| 85 | - {$i("fim").value = 1} | 80 | + var i = $i("inicio").value * 1; |
| 81 | + var f = $i("fim").value * 1 | ||
| 82 | + var d = f - i; | ||
| 83 | + | ||
| 84 | + $i("inicio").value = i - d - 1 | ||
| 85 | + $i("fim").value = i - 1 | ||
| 86 | + if ($i("inicio").value < 1) | ||
| 87 | + { | ||
| 88 | + $i("inicio").value = 1 | ||
| 89 | + $i("fim").value = 1 + d | ||
| 90 | + } | ||
| 86 | registrosf() | 91 | registrosf() |
| 87 | } | 92 | } |
| 88 | //conta menos 20 | 93 | //conta menos 20 |
| 89 | function maisf() | 94 | function maisf() |
| 90 | { | 95 | { |
| 91 | - $i("inicio").value = ($i("inicio").value * 1) + 20 | ||
| 92 | - $i("fim").value = ($i("fim").value * 1) + 20 | 96 | + var i = $i("inicio").value * 1; |
| 97 | + var f = $i("fim").value * 1 | ||
| 98 | + var d = f - i; | ||
| 99 | + $i("inicio").value = f + 1 | ||
| 100 | + $i("fim").value = f + d + 1 | ||
| 93 | registrosf() | 101 | registrosf() |
| 94 | } | 102 | } |
| 95 | //lista os registros da tabela | 103 | //lista os registros da tabela |
| @@ -101,7 +109,7 @@ function registrosf() | @@ -101,7 +109,7 @@ function registrosf() | ||
| 101 | {tiporeg = "mapa"} | 109 | {tiporeg = "mapa"} |
| 102 | if ($i("tipolista").checked) | 110 | if ($i("tipolista").checked) |
| 103 | {tipolista = "selecionados"} | 111 | {tipolista = "selecionados"} |
| 104 | - var inicio=$i("inicio").value | 112 | + var inicio=$i("inicio").value - 1 |
| 105 | var fim=$i("fim").value | 113 | var fim=$i("fim").value |
| 106 | var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listaregistros&inicio="+inicio+"&fim="+fim+"&tema="+tema+"&tipo="+tiporeg+"&tipolista="+tipolista | 114 | var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listaregistros&inicio="+inicio+"&fim="+fim+"&tema="+tema+"&tipo="+tiporeg+"&tipolista="+tipolista |
| 107 | var cp = new cpaint(); | 115 | var cp = new cpaint(); |