1
I need a function to help me count certain Ivs in my php. I will explain better, I have a product checker, it works as follows, I insert the product codes in the textarea, put to search and it does a check in the database. The products that already have, it returns as failed, those that does not have it returns as approved.
<script type="text/javascript">
function buscarProdutosRepro(str) {
document.getElementById(\'listProdutosRepro\').innerHTML += \'<div>\' + str + \'</div>\';
}
function buscarProdutosApro(str) {
document.getElementById(\'listProdutosApro\').innerHTML += \'<div>\' + str + \'</div>\';
}
function FormatoInvalido(str) {
document.getElementById(\'FormatoInvalido\').innerHTML += \'<div>\' + str + \'</div>\';
}
</script>
This function, it is applied here
<center>
<p style="background: #54bd0e; padding: 6px 20px; width: 180px; font-size: 13px; border-radius: 15px; color: #F0F0F0;">Produtos Carregados ('.$conta.') </p>
</center>
<div class="panel panel-green">
</span>
<div class="alert alert-success"><small>✔ Produtos Aprovados</small></div>
<i class="fa fa-spinner fa-spin" style="font-size:24px"></i> Verificando...
<div class="panel-body">
<br/><div id="listProdutosApro"></div>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading"><small>✘ Produtos Reprovados</small></div>
<div class="panel-body">
<br/><div id="listProdutosRepro"></div>
</div>
</div>
<div class="panel panel-orange">
<div class="panel-heading">Invalidas</div>
<div class="panel-body">
<br/><div id="FormatoInvalido"></div>
</div>
</div>
It will print on the screen the results, div under div.
<br/><div id="listProdutosApro">
<br/><div id="listProdutosApro">
<br/><div id="listProdutosApro">
Upshot: http://image.prntscr.com/image/ebb07cbb7bf547d98406cad16ef39e2f.png
and I want to count these Ivs, as if they were lines, so:
Approved Products (80) <- this sum I need.
Disapproved Products (15) <- this sum I need.
If anyone can help me, since thank you.
is more or less that http://jsfiddle.net/t6Z5s/ only that this function counts the line break of a textarea
– AprendizdeCode