I have a table, which lists driver data, which when clicking on a table column triggers a modal.
But I want, when clicking, to call a function, which returns the modal, and not every time you load the page, already load the modal. Follow the snippet of code. This way, it works perfectly, but it's getting very slow, so I want to know if you have a%
<?php
if($PERMOT != 0)
{
echo "<td><a data-toggle='modal' data-target='#modal-$i'>".number_format($log[0], 3)."</a> </td>";//Gasto
echo "<td class=".$classTd."><a data-toggle='modal' data-arget='#modal-$i'>".number_format($log[5], 3)."</a></td>";//Diff
}
else
echo "<td><div>-</div><div>-</div><div>-</div></td>";
echo "</tr>";
echo "</tbody>";
echo "
<div class='modal fade' id='modal-$i'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title'>Documento ".$CODFIL."-".$SERDOC." - ".$NUMDOC." </h4>
</div>
<div class='modal-body'>
".$log[6]."
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-danger' data-dismiss='modal'>Fechar</button>
</div>
</div>
</div>
</div>
";
//echo "<button class='info plus ' id='".$i."' onclick='moreInf($i, $CODFIL, $SERDOC, $NUMDOC)'></button>";
$i++;
?>