<?php
/**
 * 单词列表
 * $Id: product_category_list.inc,v 1.1 2015/10/08 11:18:53 wanggb Exp $
 * @author zhouhj
 * @access public
 * @package manager.templates
 */

?>

<b>单词列表</b><br /><br />
<a class="flatbutton" href="word_dat_edit.php">单个单词</a>
<a class="flatbutton" href="word_dat_batch.php">批量上传</a>
<br /><br />
<div id="result_list">
	<table>
		<tr>
			<th class="contents_title" width="10%">单词</th>
			<th class="contents_title" width="12%">平假名</th>
			<th class="contents_title" width="15%">中文翻译</th>
			<th class="contents_title" width="5%">MP3</th>
			<th class="contents_title" width="25%">例句</th>
			<th class="contents_title" width="25%">用法描述</th>
			<th class="contents_title">操作</th>
		</tr>

		<?
		if (count($word_dat_list) > 0) {
			foreach ($word_dat_list as $word_dat) {
		?>
				<tr>
					<td align="center"><?=$word_dat->word ?></td>
					<td align="center"><?=htmlspecialchars($word_dat->hira_kana) ?></td>
					<td align="center"><?=htmlspecialchars($word_dat->chinese) ?></td>
					<td align="left">
					<?
						if(!empty($word_dat->mp3)) {
					?>
					<audio controls="controls">
						<source src="play_mp3.php?file_name=<?=urlencode($word_dat->mp3) ?>" type="audio/mpeg">
						您的浏览器不支持该音频格式。
					</audio>
					<?
						}
					?>
					</td>
					<td align="left"><?=htmlspecialchars($word_dat->sample) ?></td>
					<td align="left"><?=htmlspecialchars($word_dat->comment) ?></td>
					<td align="center">
						<a class="flatbutton" href="word_dat_edit.php?id=<?=$word_dat->id ?>">编集</a>
					</td>
				</tr>
				<?
			}
		}
		?>
	</table>
</div>