<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>管理ページ</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="?act=file&f=style.css">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="?act=file&f=openclose.js"></script>
</head>

<body>

<div id="container">

<header>
<h1>CMS管理ページ</h1>
</header>

<div id="contents">

<div id="main">

<section>

<h2 class="mb15"><?php @print nl2br($val["page_title"]); ?>
</h2>
<p>
<?php
		if(@x_count($val["list_menu"]) && (is_array($val["list_menu"]) || strlen($val["list_menu"]))){ ?>
<a href="?act=<?php @print nl2br($val["form"]["name"]); ?>
">一覧へ戻る</a>
<?php } ?>
<?php
		if(@x_count($val["form"]["preview"]) && (is_array($val["form"]["preview"]) || strlen($val["form"]["preview"]))){ ?>
<a href="<?php @print nl2br($val["form"]["preview"]); ?>
<?php @print nl2br($val["id"]); ?>
" target="_blank">[プレビュー]</a>&nbsp;&nbsp;
<?php } ?>
</p>

<form name="form1" enctype="multipart/form-data" method="post" action="?act=<?php @print nl2br($val["form"]["name"]); ?>
_update">
<input type="hidden" name="mode" value="<?php @print nl2br($val["mode"]); ?>
">
<input type="hidden" name="id" value="<?php @print nl2br($val["id"]); ?>
">

<?php
		if(@x_count($val["message"]) && (is_array($val["message"]) || strlen($val["message"]))){ ?>
<div class="error"><?php @print nl2br($val["message"]); ?>
</div>
<?php } ?>

<table class="ta1">
<tr>
<th colspan="2" class="midashi">設定項目追加</th>
</tr>
<?php
			for(@$cnt["list"]=0;@$cnt["list"]<x_count(@$val["list"]);@$cnt["list"]++){
				?>
<tr>
<?php
		if(@x_count($val["list"][$cnt["list"]]["comment"]) && (is_array($val["list"][$cnt["list"]]["comment"]) || strlen($val["list"][$cnt["list"]]["comment"]))){ ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["title"]) && (is_array($val["list"][$cnt["list"]]["title"]) || strlen($val["list"][$cnt["list"]]["title"]))){ ?>
<th colspan="2">
<?php @print nl2br($val["list"][$cnt["list"]]["title"]); ?>

</th>
<?php } ?>
<?php
		if(!(@x_count($val["list"][$cnt["list"]]["title"]) && (is_array($val["list"][$cnt["list"]]["title"]) || strlen($val["list"][$cnt["list"]]["title"])))){ ?>
<td colspan="2">
<hr>
</td>
<?php } ?>

<?php } ?>
<?php
		if(!(@x_count($val["list"][$cnt["list"]]["comment"]) && (is_array($val["list"][$cnt["list"]]["comment"]) || strlen($val["list"][$cnt["list"]]["comment"])))){ ?>
<th><?php @print nl2br($val["list"][$cnt["list"]]["title"]); ?>

<p class="subtitle" style="margin:0;padding:0"><?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
</p>
</th>
<?php } ?>
<?php
		if(!(@x_count($val["list"][$cnt["list"]]["comment"]) && (is_array($val["list"][$cnt["list"]]["comment"]) || strlen($val["list"][$cnt["list"]]["comment"])))){ ?>
<td>
<?php
		if(@x_count($val["list"][$cnt["list"]]["text"]) && (is_array($val["list"][$cnt["list"]]["text"]) || strlen($val["list"][$cnt["list"]]["text"]))){ ?>
<input type="text" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
" maxlength="<?php @print nl2br($val["list"][$cnt["list"]]["length"]); ?>
" size="70">
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["textarea"]) && (is_array($val["list"][$cnt["list"]]["textarea"]) || strlen($val["list"][$cnt["list"]]["textarea"]))){ ?>
<textarea name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" cols="50" rows="5">
<?php @print $val["list"][$cnt["list"]]["value"]; ?>
</textarea>
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["file"]) && (is_array($val["list"][$cnt["list"]]["file"]) || strlen($val["list"][$cnt["list"]]["file"]))){ ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["value"]) && (is_array($val["list"][$cnt["list"]]["value"]) || strlen($val["list"][$cnt["list"]]["value"]))){ ?>
<a href="<?php @print nl2br($val["top"]); ?>
?act=get_file&id=<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
"><?php @print nl2br($val["list"][$cnt["list"]]["filename"]); ?>
</a>
<br />
<input type="checkbox" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_del" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
"> このファイルを削除
<input type="hidden" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_old" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
">
<br />
<?php } ?>
<input type="file" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" size="50">
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["image"]) && (is_array($val["list"][$cnt["list"]]["image"]) || strlen($val["list"][$cnt["list"]]["image"]))){ ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["value"]) && (is_array($val["list"][$cnt["list"]]["value"]) || strlen($val["list"][$cnt["list"]]["value"]))){ ?>
<img src="<?php @print nl2br($val["top"]); ?>
?act=get_image&id=<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
&x=200">
<br />
<input type="checkbox" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_del" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
"> この画像を削除
<input type="hidden" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_old" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
">
<br />
<?php } ?>
<input type="file" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" size="50">
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["hidden"]) && (is_array($val["list"][$cnt["list"]]["hidden"]) || strlen($val["list"][$cnt["list"]]["hidden"]))){ ?>
<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>

<input type="hidden" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
">
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["image_ex"]) && (is_array($val["list"][$cnt["list"]]["image_ex"]) || strlen($val["list"][$cnt["list"]]["image_ex"]))){ ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["value"]) && (is_array($val["list"][$cnt["list"]]["value"]) || strlen($val["list"][$cnt["list"]]["value"]))){ ?>
<img src="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
" width="200"><br>
<?php } ?>
<input type="text" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
" size="50">(画像のURL)
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["select"]) && (is_array($val["list"][$cnt["list"]]["select"]) || strlen($val["list"][$cnt["list"]]["select"]))){ ?>
<select name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
"><?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>

<?php
			for(@$cnt["list/list"]=0;@$cnt["list/list"]<x_count(@$val["list"][$cnt["list"]]["list"]);@$cnt["list/list"]++){
				?>
<option value="<?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["value"]); ?>
" <?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["sel"]); ?>
><?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["name"]); ?>
</option>
<?php } ?>
</select>
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["radio"]) && (is_array($val["list"][$cnt["list"]]["radio"]) || strlen($val["list"][$cnt["list"]]["radio"]))){ ?>
<?php
			for(@$cnt["list/list"]=0;@$cnt["list/list"]<x_count(@$val["list"][$cnt["list"]]["list"]);@$cnt["list/list"]++){
				?>
<input type="radio" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["value"]); ?>
" <?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["sel"]); ?>
><?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["name"]); ?>
&nbsp;&nbsp;
<?php } ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["checkbox"]) && (is_array($val["list"][$cnt["list"]]["checkbox"]) || strlen($val["list"][$cnt["list"]]["checkbox"]))){ ?>
<?php
		if(@x_count($val["list"][$cnt["list"]]["list"]) && (is_array($val["list"][$cnt["list"]]["list"]) || strlen($val["list"][$cnt["list"]]["list"]))){ ?>
<?php
			for(@$cnt["list/list"]=0;@$cnt["list/list"]<x_count(@$val["list"][$cnt["list"]]["list"]);@$cnt["list/list"]++){
				?>
<input type="checkbox" id="<?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["key"]); ?>
" name="<?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["key"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["value"]); ?>
" <?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["sel"]); ?>
><?php @print nl2br($val["list"][$cnt["list"]]["list"][$cnt["list/list"]]["name"]); ?>
<br>
<?php } ?>
<?php } ?>
<?php
		if(!(@x_count($val["list"][$cnt["list"]]["list"]) && (is_array($val["list"][$cnt["list"]]["list"]) || strlen($val["list"][$cnt["list"]]["list"])))){ ?>
<input type="checkbox" id="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
" <?php @print nl2br($val["list"][$cnt["list"]]["checked"]); ?>
>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["date"]) && (is_array($val["list"][$cnt["list"]]["date"]) || strlen($val["list"][$cnt["list"]]["date"]))){ ?>
<input type="date" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
" value="<?php @print nl2br($val["list"][$cnt["list"]]["value"]); ?>
" size="50">
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["date_sel"]) && (is_array($val["list"][$cnt["list"]]["date_sel"]) || strlen($val["list"][$cnt["list"]]["date_sel"]))){ ?>
<select id="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_year" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_year"<?php
		if(@x_count($val["list"][$cnt["list"]]["disable"]) && (is_array($val["list"][$cnt["list"]]["disable"]) || strlen($val["list"][$cnt["list"]]["disable"]))){ ?> disabled="disabled"<?php } ?>>
<option value=""></option>
<?php
			for(@$cnt["list/years"]=0;@$cnt["list/years"]<x_count(@$val["list"][$cnt["list"]]["years"]);@$cnt["list/years"]++){
				?>
<option value="<?php @print nl2br($val["list"][$cnt["list"]]["years"][$cnt["list/years"]]["value"]); ?>
" <?php @print nl2br($val["list"][$cnt["list"]]["years"][$cnt["list/years"]]["sel"]); ?>
><?php @print nl2br($val["list"][$cnt["list"]]["years"][$cnt["list/years"]]["value"]); ?>
</option>
<?php } ?>
</select> 年&nbsp;
<select id="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_month" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_month"<?php
		if(@x_count($val["list"][$cnt["list"]]["disable"]) && (is_array($val["list"][$cnt["list"]]["disable"]) || strlen($val["list"][$cnt["list"]]["disable"]))){ ?> disabled="disabled"<?php } ?>>
<option value=""></option>
<option value="01" <?php @print nl2br($val["list"][$cnt["list"]]["month01"]); ?>
>1</option>
<option value="02" <?php @print nl2br($val["list"][$cnt["list"]]["month02"]); ?>
>2</option>
<option value="03" <?php @print nl2br($val["list"][$cnt["list"]]["month03"]); ?>
>3</option>
<option value="04" <?php @print nl2br($val["list"][$cnt["list"]]["month04"]); ?>
>4</option>
<option value="05" <?php @print nl2br($val["list"][$cnt["list"]]["month05"]); ?>
>5</option>
<option value="06" <?php @print nl2br($val["list"][$cnt["list"]]["month06"]); ?>
>6</option>
<option value="07" <?php @print nl2br($val["list"][$cnt["list"]]["month07"]); ?>
>7</option>
<option value="08" <?php @print nl2br($val["list"][$cnt["list"]]["month08"]); ?>
>8</option>
<option value="09" <?php @print nl2br($val["list"][$cnt["list"]]["month09"]); ?>
>9</option>
<option value="10" <?php @print nl2br($val["list"][$cnt["list"]]["month10"]); ?>
>10</option>
<option value="11" <?php @print nl2br($val["list"][$cnt["list"]]["month11"]); ?>
>11</option>
<option value="12" <?php @print nl2br($val["list"][$cnt["list"]]["month12"]); ?>
>12</option>
</select> 月&nbsp;
<select id="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_day" name="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_day"<?php
		if(@x_count($val["list"][$cnt["list"]]["disable"]) && (is_array($val["list"][$cnt["list"]]["disable"]) || strlen($val["list"][$cnt["list"]]["disable"]))){ ?> disabled="disabled"<?php } ?>>
<option value=""></option>
<option value="01" <?php @print nl2br($val["list"][$cnt["list"]]["day01"]); ?>
>1</option>
<option value="02" <?php @print nl2br($val["list"][$cnt["list"]]["day02"]); ?>
>2</option>
<option value="03" <?php @print nl2br($val["list"][$cnt["list"]]["day03"]); ?>
>3</option>
<option value="04" <?php @print nl2br($val["list"][$cnt["list"]]["day04"]); ?>
>4</option>
<option value="05" <?php @print nl2br($val["list"][$cnt["list"]]["day05"]); ?>
>5</option>
<option value="06" <?php @print nl2br($val["list"][$cnt["list"]]["day06"]); ?>
>6</option>
<option value="07" <?php @print nl2br($val["list"][$cnt["list"]]["day07"]); ?>
>7</option>
<option value="08" <?php @print nl2br($val["list"][$cnt["list"]]["day08"]); ?>
>8</option>
<option value="09" <?php @print nl2br($val["list"][$cnt["list"]]["day09"]); ?>
>9</option>
<option value="10" <?php @print nl2br($val["list"][$cnt["list"]]["day10"]); ?>
>10</option>
<option value="11" <?php @print nl2br($val["list"][$cnt["list"]]["day11"]); ?>
>11</option>
<option value="12" <?php @print nl2br($val["list"][$cnt["list"]]["day12"]); ?>
>12</option>
<option value="13" <?php @print nl2br($val["list"][$cnt["list"]]["day13"]); ?>
>13</option>
<option value="14" <?php @print nl2br($val["list"][$cnt["list"]]["day14"]); ?>
>14</option>
<option value="15" <?php @print nl2br($val["list"][$cnt["list"]]["day15"]); ?>
>15</option>
<option value="16" <?php @print nl2br($val["list"][$cnt["list"]]["day16"]); ?>
>16</option>
<option value="17" <?php @print nl2br($val["list"][$cnt["list"]]["day17"]); ?>
>17</option>
<option value="18" <?php @print nl2br($val["list"][$cnt["list"]]["day18"]); ?>
>18</option>
<option value="19" <?php @print nl2br($val["list"][$cnt["list"]]["day19"]); ?>
>19</option>
<option value="20" <?php @print nl2br($val["list"][$cnt["list"]]["day20"]); ?>
>20</option>
<option value="21" <?php @print nl2br($val["list"][$cnt["list"]]["day21"]); ?>
>21</option>
<option value="22" <?php @print nl2br($val["list"][$cnt["list"]]["day22"]); ?>
>22</option>
<option value="23" <?php @print nl2br($val["list"][$cnt["list"]]["day23"]); ?>
>23</option>
<option value="24" <?php @print nl2br($val["list"][$cnt["list"]]["day24"]); ?>
>24</option>
<option value="25" <?php @print nl2br($val["list"][$cnt["list"]]["day25"]); ?>
>25</option>
<option value="26" <?php @print nl2br($val["list"][$cnt["list"]]["day26"]); ?>
>26</option>
<option value="27" <?php @print nl2br($val["list"][$cnt["list"]]["day27"]); ?>
>27</option>
<option value="28" <?php @print nl2br($val["list"][$cnt["list"]]["day28"]); ?>
>28</option>
<option value="29" <?php @print nl2br($val["list"][$cnt["list"]]["day29"]); ?>
>29</option>
<option value="30" <?php @print nl2br($val["list"][$cnt["list"]]["day30"]); ?>
>30</option>
<option value="31" <?php @print nl2br($val["list"][$cnt["list"]]["day31"]); ?>
>31</option>
</select> 日
<?php
		if(@x_count($val["list"][$cnt["list"]]["message"]) && (is_array($val["list"][$cnt["list"]]["message"]) || strlen($val["list"][$cnt["list"]]["message"]))){ ?>
<div class="error"><?php @print nl2br($val["list"][$cnt["list"]]["message"]); ?>
</div>
<?php } ?>
<?php } ?>

<?php
		if(@x_count($val["list"][$cnt["list"]]["info"]) && (is_array($val["list"][$cnt["list"]]["info"]) || strlen($val["list"][$cnt["list"]]["info"]))){ ?>
<div class="comment" id="<?php @print nl2br($val["list"][$cnt["list"]]["name"]); ?>
_comment"><?php @print nl2br($val["list"][$cnt["list"]]["info"]); ?>
</div>
<?php } ?>

</td>
 <?php } ?>
</tr>
<?php } ?>
</table>

<p class="c">
<input type="submit" value="保存する" class="btn">
</p>
</form>

</section>

</div>
<!--/main-->

<div id="sub">

<h2 id="menubar_hdr" class="close">MENU</h2>

<div id="menubar">

<nav class="menu">
<ul>
<?php
			for(@$cnt["menu"]=0;@$cnt["menu"]<x_count(@$val["menu"]);@$cnt["menu"]++){
				?>
<?php
		if(@x_count($val["menu"][$cnt["menu"]]["act"]) && (is_array($val["menu"][$cnt["menu"]]["act"]) || strlen($val["menu"][$cnt["menu"]]["act"]))){ ?>
<li class="menu"><a href="?act=<?php @print nl2br($val["menu"][$cnt["menu"]]["act"]); ?>
"><?php @print nl2br($val["menu"][$cnt["menu"]]["title"]); ?>
</a></li>
<?php } ?>
<?php
		if(!(@x_count($val["menu"][$cnt["menu"]]["act"]) && (is_array($val["menu"][$cnt["menu"]]["act"]) || strlen($val["menu"][$cnt["menu"]]["act"])))){ ?>
<h2><?php @print nl2br($val["menu"][$cnt["menu"]]["title"]); ?>
</h2>
<?php } ?>
<?php } ?>
</ul>
</nav>

</div>
<!--/menubar-->

</div>
<!--/sub-->

<p id="pagetop"><a href="#">↑ PAGE TOP</a></p>

</div>
<!--/contents-->

<footer>
<small>Presented by Crytus</small>
</footer>

</div>
<!--/container-->

<script type="text/javascript" src="js/slide_simple_pack.js"></script>

<!--スマホ用メニューバー-->
<script type="text/javascript">
if (OCwindowWidth() < 800) {
	open_close("menubar_hdr", "menubar");
}
</script>

</body>
</html>
