<?php
	require("__include-common.php");
	require("../account/__logincheck.php");
	$con = my_mysql_connect(_DB_SCHEMA);
	html_header(HTML_TITLE, '', '#ffffff');
	page_header();
	contents_header();
	$sql = 'select * from v_category_valid where c_delete = 0 order by c_categoryDisplayOrder, id_category';
	$rs = my_mysql_query($sql);
	$row = mysql_num_rows($rs);
	if ($row == 0) {
		error_msg('現在、登録されたカテゴリがありません。');
	}
?>
	<table id="study_index_table"><tr><td>
	<ul class="study_index">
<?php
	$half = ($row + 1) / 2;
	$cnt = 1;
	if ($half > study_INDEX_MENU_COLUMN_BREAK) {
		$break = 0;
	} else {
		$break = 1;
	}
	while ($rec=mysql_fetch_array($rs)) {
		if ($cnt > $half and $break == 0) {
			$break = 1;
?>
			</ul>
			</td>
			<td>
			<ul class="study_index">
<?php
	 	}
?>
		<li>
		<span class="study_index_mark">■</span><a href="mycheck.php?cat=<?= $rec['id_category'] ?>"><?= $rec['c_categoryName'] ?></a>
		</li>
<?php
		$cnt++;
	}
?>
	</ul>
	</td></tr></table>
<?php
	$con = mysql_close($con);
	page_footer();
	html_footer();
?>
