I would like to know how in Codeigniter
to change the state of the activate button that is green, that when it is deactivated it is red, but when I give it to activate this green one.
Controller code:
if ($activos =='true'){
$actinomtest ='Activar';
$valoresacti ='1';
$colorbtn = 'class="btn btn success';
}else{
$actinomtest ='Desactivar';
$valoresacti ='0';
}
And in this line within the same Controller called those variables:
foreach ($data as $row){
$botones='<button class="btn btn-primary btn-sm btnedit text-center" onclick="botontest('.$row->idTest.')">Editar</button>
<a class="btn btn-warning" href="#">Editar tabla</a>
<button class="btn btn-danger btn-sm btnactest text-center" onclick="btnactivtest('.$row->idTest.', '. $valoresacti.', '.$colorbtn .')">'.$actinomtest.'</button>';
}