My problem is the following I have a search field that brings data into a table via ajax, in this table there are buttons so that the user can get more information about the data that is searched, on these buttons I am trying to call this second information too via ajax the problem is that the second ajax is always returning blank do not know what acontence.
This is the table, the onclick goes to function show phase which I will post shortly below.
<td>'.$exf_obj->nom_req.'</td>
<td>'.$reg['descricao'].'</td>
<td>'.$reg['dtfase'].'</td>
<td>'.$exf_obj->n_proce.'</td>
<input type="hidden" value='.$reg['sql_rowid'].' id="id_fase">
<td><a href="" onclick="return mostrar_fase()" class="tiny button">Mostrar mais</a></td>
<td><a href="Busca/mostrar/'.$reg['sql_rowid'] .'" class="tiny button">Mostrar mais</a></td>
</tr>';
The function of ajax is this
function mostrar_fase(){
ajax = xmlhttp();
id_fase = document.getElementById('id_fase').value;
if(ajax)
{
ajax.open("POST",'http://localhost/sac/Ajax/mostrar_fase/' + id_fase, true);
alert(ajax.responseText);
ajax.onreadystatechange = function()
{
if (ajax.readyState == 4 && ajax.status == 200)
{
document.getElementById("tabela").innerHTML = ajax.responseText;
}
}
ajax.send();
}
}
case 'mostrar_fase':
echo 'chega';
$id_fase = Sistema::getKey();
Connection::open();
$dados_fase = Connection::select("select * from fases01 where sql_rowid = '".$id_fase."'");
$reg_fase = $dados_fase->fetchObject();
$dados_exf = Connection::select("select * from arq_exf where num_pro = '".$reg_fase->processo."'");
$reg_exf = $dados_exf->fetchObject();
$html = $html = new Html();
$nova = $html->carregar('view/mostrar.html');
$nova = str_replace('#NOME#', $reg_exf->nom_req, $nova);
$nova = str_replace('#DESCRICAO#', $reg_fase->descricao, $nova);
echo $nova;
break;
The first ajax code is practically the same as the one I posted, it only differs the link and the variable and the first works correctly. I hope I was clear in my question. Thank you in advance.