<?php
//加载
require_once ("../manager_include.inc");

// 参数取得
$theme_id = ParamUtil::getRequestString("theme_id");
$key_word = ParamUtil::getRequestString("key_word");

$word_dat_list = WordHandler::searchWords($key_word);


ob_start()
?>
<?
	if(!empty($word_dat_list)) {
		$index = 0;
		foreach($word_dat_list as $word_dat) {
			$index++;
			$word_id = $word_dat["id"];
			$word = $word_dat["word"];
?>
<div class="theme_word_item" onClick="addWord('<?=$theme_id?>','<?=$word_id?>');"><?=$index?>.<?=$word?></div>
<?
		}
	}
?>
<?
$html = ob_get_contents();
ob_end_clean();
print json_encode(array("html"=>$html));


