this is the text box into a index.php:
Code:
<input name="search-q2" id="search-q2" type="text" onkeyup="javascript:autosuggest2()"/>
and into the consultas.php, the case E:
Code:
case 'E':
$queEmp = "select `pkey`, `created`, `UPDATED`, `reporter`, `assignee`, `summary`, `description` from `jiraissue` where project = 10040 and `pkey` like ???VARIABLE???? ";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
if ($totEmp> 0) {
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
echo "<strong>Incidencia:</strong> <u>".$rowEmp['pkey']."</u><br>";
echo "<strong>Data:</strong> ".$rowEmp['created']." / ".$rowEmp['UPDATED']."<br>";
echo "<strong>Tecnic Obre:</strong> ".$rowEmp['reporter']."<br>";
echo "<strong>Tecnic Actual:</strong> ".$rowEmp['assignee']."<br>";
echo "<strong>Descripcio incidencia:</strong> ".$rowEmp['summary']."<br>";
echo "<strong>Intervencions:</strong> ".$rowEmp['description']."<br><br>";
}
}
break;
mysql_close($conexion);
and I have a Framework:
Code:
function autosuggest1() {
q = document.getElementById('search-q2').value;
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'lib/search_incidencias.php?q='+q+'&nocache = '+nocache);
http.onreadystatechange = autosuggestReply;
http.send(null);
}
function autosuggestReply() {
if(http.readyState == 4){
var response = http.responseText;
e = document.getElementById('results');
if(response!=""){
e.innerHTML=response;
e.style.display="block";
} else {
e.style.display="none";
}
}
}
and, search_incidencias.php:
Code:
<?php
$searchq = strip_tags($_GET['q']);
$getRecord_sql = 'SELECT `pkey` FROM `jiraissue` WHERE project = "10040" and `pkey` LIKE "%'.$searchq.'%"';
$getRecord = mysql_query($getRecord_sql);
if(strlen($searchq)>0){
echo '<ul>';
while ($row = mysql_fetch_array($getRecord)) {
?>
<li><a href="lib/consultas.php?accion=E" onclick="load('lib/consultas.php?accion=E','consulta');return false;">
<?php
echo $row['pkey'];
?>
here is all my code...
Bookmarks