here is the javascript:
Code:
<script>
function searchemppay(queryString) {
//alert(queryString);
var ajaxRequest = remoteRequestObject();
ajaxRequest.onreadystatechange = function() {
if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
var result = ajaxRequest.responseText;
//alert(result);
document.getElementById('searchpayroll').innerHTML = result;
}
}
var url = "search.php?query=" + queryString;
ajaxRequest.open("GET", url, true);
ajaxRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
ajaxRequest.send(null);
}
function changeEmployeePay(queryID) {
window.location = "SearchData.php?queryEmpID=" + queryID;
}
</script>
search.php
Code:
<?php
session_start();
include 'config.php';
$queryString = $_GET["query"];
if ($queryString == "" || $queryString == null) {
$sql = "SELECT EMP_ID, CONCAT(LNAME, ', ', FNAME, ' ', MI, '.') AS FULLNAME FROM PERSONAL
ORDER BY FULLNAME ASC";
}
else {
$sql = "SELECT EMP_ID, CONCAT(LNAME, ', ', FNAME, ' ', MI, '.') AS FULLNAME FROM PERSONAL WHERE LNAME LIKE '" . $queryString . "%' ORDER BY FULLNAME ASC";
}
$recPersonalQuery = $conn->Execute($sql);
if (!$recPersonalQuery->BOF) {
$recPersonalQuery->MoveFirst();
}
echo "<hr />";
echo "<ul id='searchpayroll'>";
while (!$recPersonalQuery->EOF) {
$empID = $recPersonalQuery->fields["EMP_ID"];
$empFullName = $recPersonalQuery->fields["FULLNAME"];
//echo "<li onclick=changeEmployeePay('$empID'); style= 'font-family:'Times New Roman',Times,serif; font-size:10%;'>$empFullName</li>";
echo "<a href='SearchData.php?queryEmpID=$empID'; style= 'font-family:'Times New Roman',Times,serif; font-size:10%;'>$empFullName</li>";
echo "<hr />";
$recPersonalQuery->MoveNext();
}
echo "</ul>";
$recPersonalQuery->Close();
exit();
?>
SearchData.php
Code:
<?php
session_start();
$queryStr = trim($_GET["queryEmpID"]);
$_SESSION['empID'] = $queryStr;
session_write_close();
header("Location:DisplayEmpPayroll.php");
exit();
?>
Thank you so much..
my problem is in typing textarea...I think it cause from my script in keycode for up and down?
Bookmarks