<?php
	session_start();
	require('includes/config.php');	
	if( !empty( $_REQUEST["keyword"] ) )
	{
		$service_id = $_REQUEST["service_id"];
		$query = "SELECT id, title FROM parameter_title WHERE title like '%" . $_REQUEST["keyword"] . "%' and service_id = ".$service_id." ORDER BY id LIMIT 0,10";
		$result = mysqli_query( $con,$query );
		if( !empty($result) ) {
			echo '<ul id="search-list">';
			foreach( $result as $titles ) {
			?>
				<li onClick="selectTitle('<?php echo $titles["title"]; ?>', <?php echo $titles["id"]; ?>);"><?php echo $titles["title"]; ?></li>			
			<?php
			} 
			echo '</ul>';
		}
	}
?>