Exemple #1
0
function out_html($gc) {

	$gc->anken_no = $_GET["anken_no"];

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " i.item_no,";
	$sql.= " i.anken_no,";
	$sql.= " i.buken_sbt,";
	$sql.= " i.menseki,";
	$sql.= " i.rank_no,";
	$sql.= " i.buken_shikucyouson_no,";
	$sql.= " i.mukou_flg,";
	$sql.= " i.moushikomibi, ";
	$sql.= " c.y_cnt, ";
	$sql.= " c.m_cnt ";
	$sql.= "FROM";
	$sql.= " t_item i ";
	$sql.= "INNER JOIN";
	$sql.= " m_shikucyouson s ";
	$sql.= "ON";
	$sql.= " i.buken_shikucyouson_no = s.shikucyouson_no ";
	$sql.= "LEFT JOIN";
	$sql.= " (select item_no,sum(case when c_mukou_flg='0' then 1 else 0 end) as y_cnt,sum(case when c_mukou_flg='1' then 1 else 0 end) as m_cnt from t_item_company group by item_no) as c ";
	$sql.= "ON";
	$sql.= " i.item_no = c.item_no ";
	$sql.= "WHERE 0 = 0 ";
	if($gc->anken_no != ""){
		$sql.= "and i.anken_no like '%".$gc->anken_no."%' ";
	}


	$sql.= "ORDER BY";

	switch($_GET["si"]) {
	case "ank":
		$sql.= " i.anken_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "mbi":
		$sql.= " i.moushikomibi".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "sbt":
		$sql.= " i.buken_sbt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "men":
		$sql.= " i.menseki".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "tod":
		$sql.= " s.todoufuken_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "shi":
		$sql.= " s.shikucyouson_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "yuk":
		$sql.= " c.y_cnt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "muk":
		$sql.= " c.m_cnt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	default:
		$sql.= " i.item_no DESC ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();
	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("item_l.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["ank"] = "";
	$sort_mode["mbi"] = "";
	$sort_mode["sbt"] = "";
	$sort_mode["men"] = "";
	$sort_mode["tod"] = "";
	$sort_mode["shi"] = "";
	$sort_mode["yuk"] = "";
	$sort_mode["muk"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>申込/対応状況</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script> 
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 1) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="item_l.php">案件管理</a>
			<span>&gt;</span>
			申込み/対応状況
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Form -->
					<div class="form">

						<form name="form_search" action="item_l.php" method="get" onsubmit="return false">
							<input name="mode" type="hidden" value="">

							<div class="box-size2 left">
								<p class="inline-field">
									<label style="display:inline;">案件番号:</label>
									<input name="anken_no" type="text" class="field size3" value="<?php echo f_hsc($gc->anken_no) ?>" />
									<button type="button" class="button color silver ml05" onclick="run_submit('form_search', 'search');">検索</button>
								</p>
							</div>

							<div class="cl">&nbsp;</div>

						</form>

					</div>
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">申込み/対応状況</h2>
						<div class="right">
							<a href="item_csv.php" class="custom-button"><span>CSV出力</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th width="80" class="ac"><a href="item_l.php<?php echo f_sq("ank") ?>">案件番号</a><?php echo $sort_mode["ank"] ?></th>
								<th width="80" class="ac"><a href="item_l.php<?php echo f_sq("mbi") ?>">申込日</a><?php echo $sort_mode["mbi"] ?></th>
								<th width="80" class="ac"><a href="item_l.php<?php echo f_sq("sbt") ?>">種別</a><?php echo $sort_mode["sbt"] ?></th>
								<th width="80" class="ac"><a href="item_l.php<?php echo f_sq("men") ?>">延床面積</a><?php echo $sort_mode["men"] ?><br />(平米)</th>
								<th width="100" class="ac"><a href="item_l.php<?php echo f_sq("tod") ?>">都道府県</a><?php echo $sort_mode["tod"] ?></th>
								<th><a href="item_l.php<?php echo f_sq("shi") ?>">市区町村</a><?php echo $sort_mode["shi"] ?></th>
								<th width="50" class="ac"><a href="item_l.php<?php echo f_sq("yuk") ?>">有効</a><?php echo $sort_mode["yuk"] ?></th>
								<th width="50" class="ac"><a href="item_l.php<?php echo f_sq("muk") ?>">無効</a><?php echo $sort_mode["muk"] ?></th>
								<th width="70" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$item_no = $rs->fields["item_no"];
		$anken_no = $rs->fields["anken_no"];
		$buken_sbt = $rs->fields["buken_sbt"];
		$menseki = $rs->fields["menseki"];
		$rank_no = $rs->fields["rank_no"];
		$buken_shikucyouson_no = $rs->fields["buken_shikucyouson_no"];
		$mukou_flg = $rs->fields["mukou_flg"];
		$m_cnt = $rs->fields["m_cnt"];
		$y_cnt = $rs->fields["y_cnt"];
		$moushikomibi = $rs->fields["moushikomibi"];

		$menseki = (float)$menseki;

		$moushikomi_d = substr($moushikomibi, 0, 4)."/".substr($moushikomibi, 5, 2)."/".substr($moushikomibi, 8, 2);
		$moushikomi_t = substr($moushikomibi, 11);

		$arr = fdiv_set_buken_sbt_array();
		$buken_sbt_nm = $arr[$buken_sbt];

		$arr = fdiv_set_rank_array();
		$rank_nm = $arr[$rank_no];

		$buken_shikucyouson_nm = fdb_get_name($gc, "m_shikucyouson", "shikucyouson_nm", "shikucyouson_no", $buken_shikucyouson_no);
		$todoufuken_no = fdb_get_name($gc, "m_shikucyouson", "todoufuken_no", "shikucyouson_no", $buken_shikucyouson_no);
		$todoufuken_nm = fdb_get_name($gc, "m_todoufuken", "todoufuken_nm", "todoufuken_no", $todoufuken_no);

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td class=\"ac\">".f_hsc($anken_no)."</td>";
		echo "<td class=\"ac\">".$moushikomi_d."<br />".$moushikomi_t."</td>";
		echo "<td class=\"ac\">".f_hsc($buken_sbt_nm)."</td>";
		echo "<td class=\"ac\">".f_hsc($menseki)."</td>";
		echo "<td class=\"ac\">".f_hsc($todoufuken_nm)."</td>";
		echo "<td>".f_hsc($buken_shikucyouson_nm)."</td>";
		echo "<td class=\"ac\" >".f_hsc($y_cnt)."</td>";
		echo "<td class=\"ac\" >".f_hsc($m_cnt)."</td>";
//		echo "<td class=\"ac\" style=\"color: ".($mukou_flg==1?"red":"blue").";\">".f_hsc($mukou_flg==1?"無効":"有効")."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='item_e.php?mode=edit&item_no=".$item_no."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"8\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>

						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	$gc->company_nm = $_GET["company_nm"];

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " u.user_no,";
	$sql.= " u.user_nm,";
	$sql.= " u.user_kn,";
	$sql.= " u.user_id,";
	$sql.= " u.e_mail,";
	$sql.= " u.last_login_time,";
	$sql.= " u.ltime,";
	$sql.= " u.auth,";
	$sql.= " c.company_no,";
	$sql.= " c.company_nm,";
	$sql.= " c.ddir ";
	$sql.= "FROM";
	$sql.= " m_company_user u ";
	$sql.= "LEFT JOIN";
	$sql.= " m_company c ";
	$sql.= "ON";
	$sql.= " u.company_no = c.company_no ";
	$sql.= "WHERE 0 = 0 ";
	if($gc->company_nm != ""){
		$sql.= "and c.company_nm like '%".$gc->company_nm."%' ";
	}

	$sql.= "ORDER BY";

	switch($_GET["si"]) {
	case "user_no":
		$sql.= " u.user_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "user_nm":
		$sql.= " u.user_nm".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "user_kn":
		$sql.= " u.user_kn".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "user_id":
		$sql.= " u.user_id".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "e_mail":
		$sql.= " u.e_mail".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "last_login_time":
		$sql.= " u.last_login_time".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "company_nm":
		$sql.= " c.company_nm".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "auth":
		$sql.= " u.auth".(($_GET["sa"]=="desc") ? " DESC" : "").", auth ";
		break;
	case "ddir":
		$sql.= " c.ddir".(($_GET["sa"]=="desc") ? " DESC" : "").", ddir ";
		break;
	default:
		$sql.= " u.user_no desc ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("c_user_l.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["user_no"] = "";
	$sort_mode["user_nm"] = "";
	$sort_mode["user_kn"] = "";
	$sort_mode["user_id"] = "";
	$sort_mode["e_mail"] = "";
	$sort_mode["company_nm"] = "";
	$sort_mode["last_login_time"] = "";
	$sort_mode["auth"] = "";
	$sort_mode["ddir"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>提携会社ユーザー一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script> 
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 7) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="c_user_l.php">提携会社ユーザー</a>
			<span>&gt;</span>
			提携会社ユーザー一覧
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>提携会社ユーザー一覧</b></h2>
						<div class="right">
							<a href="c_user_e.php?mode=add" class="add-button"><span>新規追加</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<form name="form_search" action="c_user_l.php" method="get" onsubmit="return false">
							<input name="mode" type="hidden" value="">

							<div class="box-size2 left">
								<p class="inline-field">
									<label style="display:inline;">提携会社名:</label>
									<input name="company_nm" type="text" class="field size3" value="<?php echo f_hsc($gc->company_nm) ?>" />
									<button type="button" class="button color silver ml05" onclick="run_submit('form_search', 'search');">検索</button>
								</p>
							</div>

							<div class="cl">&nbsp;</div>

						</form>

					</div>
					<!-- End Form -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th width="60" class="ac"><a href="c_user_l.php<?php echo f_sq("user_no") ?>">No.</a><?php echo $sort_mode["user_no"] ?></th>
								<th width="150"><a href="c_user_l.php<?php echo f_sq("company_nm") ?>">提携会社名</a><?php echo $sort_mode["company_nm"] ?></th>
								<th width="150"><a href="c_user_l.php<?php echo f_sq("ddir") ?>">固有ID</a><?php echo $sort_mode["ddir"] ?></th>
								<th width="150"><a href="c_user_l.php<?php echo f_sq("user_nm") ?>">ユーザー名</a><?php echo $sort_mode["user_nm"] ?></th>
								<th width="120" class="ac"><a href="c_user_l.php<?php echo f_sq("user_id") ?>">ログインID</a><?php echo $sort_mode["user_id"] ?></th>
								<th width="120" class="ac"><a href="c_user_l.php<?php echo f_sq("auth") ?>">管理者</a><?php echo $sort_mode["auth"] ?></th>
								<th width="120" class="ac"><a href="c_user_l.php<?php echo f_sq("last_login_time") ?>">最終ログイン日時</a><?php echo $sort_mode["last_login_time"] ?></th>
								<th width="70" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$company_nm = $rs->fields["company_nm"];
		$user_no = $rs->fields["user_no"];
		$user_nm = $rs->fields["user_nm"];
		$user_kn = $rs->fields["user_kn"];
		$user_id = $rs->fields["user_id"];
		$e_mail = $rs->fields["e_mail"];
		$last_login_time = $rs->fields["last_login_time"];
		$auth = $rs->fields["auth"];
		$ddir = $rs->fields["ddir"];

		if($last_login_time != ""){
			$last_login_time_d = substr($last_login_time, 0, 4)."/".substr($last_login_time, 5, 2)."/".substr($last_login_time, 8, 2);
			$last_login_time_t = substr($last_login_time, 11);
		}else{
			$last_login_time_d = "";
			$last_login_time_t = "";
		}

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td class=\"ac\">".f_hsc($user_no)."</td>";
		echo "<td>".f_hsc($company_nm)."</td>";
		echo "<td>".f_hsc($ddir)."</td>";
		echo "<td>".f_hsc($user_nm)."</td>";
		echo "<td class=\"ac\">".f_hsc($user_id)."</td>";
		echo "<td class=\"ac\">".f_hsc($auth==1?"○":"")."</td>";
		echo "<td class=\"ac\">".f_hsc($last_login_time_d)."<br />".f_hsc($last_login_time_t)."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='c_user_e.php?mode=edit&user_no=".$user_no."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"6\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>
						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	if($gc->form_mode == "confirm"){
		if($gc->act == "i"){
			$gc->mode_title = "[追加・確認]";
		}else{
			$gc->mode_title = "[編集・確認]";
		}
	}elseif($gc->form_mode == "message"){
		$gc->mode_title = "[完了]";
	}else{
		if($gc->act == "i"){
			$gc->mode_title = "[追加]";
		}else{
			$gc->mode_title = "[編集]";
		}
	}
	//表示方法
	fdiv_set_display_radio($gc, $gc->display_flg, "display_flg");

	//ラジオボタン設定
	fdiv_set_company_kbn_radio($gc, $gc->company_kbn, "company_kbn");

	//チェックボックス設定
	fdiv_set_checkbox($gc, "賃貸仲介", ($gc->chintai_flg=="1"), "chintai_flg");
	fdiv_set_checkbox($gc, "サブリース", ($gc->sublease_flg=="1"), "sublease_flg");
	fdiv_set_checkbox($gc, "リロケーション", ($gc->relocation_flg=="1"), "relocation_flg");
	fdiv_set_checkbox($gc, "掲載する", ($gc->keisai_flg=="1"), "keisai_flg");
	fdiv_set_checkbox($gc, "企業ロゴをTOP画面に表示しない", ($gc->keisai_logo_flg=="1"), "keisai_logo_flg");
	fdiv_set_checkbox($gc, "掲載会社一覧に表示しない", ($gc->keisai_comment_flg=="1"), "keisai_comment_flg");
	fdiv_set_checkbox($gc, "分譲マンション", ($gc->buken_mansion_flg=="1"), "buken_mansion_flg");
	fdiv_set_checkbox($gc, "一戸建て", ($gc->buken_kodate_flg=="1"), "buken_kodate_flg");
	fdiv_set_checkbox($gc, "一棟アパート・マンション", ($gc->buken_ittou_flg=="1"), "buken_ittou_flg");
	fdiv_set_checkbox($gc, "", ($gc->light_flg=="1"), "light_flg");

	//郵便番号
	$gc->zip = $gc->zip1."-".$gc->zip2;
	if (!preg_match("/^\d{3}\-\d{4}$/", $gc->zip)) {
		$gc->zip = "";
	}

	//郵便番号
	$gc->sk_zip = $gc->sk_zip1."-".$gc->sk_zip2;
	if (!preg_match("/^\d{3}\-\d{4}$/", $gc->sk_zip)) {
		$gc->sk_zip = "";
	}

	//ロゴ画像
	if (strlen($gc->img_nm.$gc->img_tmp_nm) > 0) {
		$gc->img_show = true;
	}else{
		$gc->img_show = false;
	}

	if (strlen($gc->img_tmp_nm) > 0) {
		$gc->img_src = fimg_img_src_ssl($gc->img_tmp_nm, "tmp");
	}else{
		$gc->img_src = fimg_img_src_ssl($gc->img_nm, "logo");
	}

	if($gc->img_del=="y"){
		$gc->img_del_checked = " checked";
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>基本情報<?php echo f_hsc($gc->mode_title)?></title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script src="../js/jquery-1.9.1.js"></script>
<script src="../js/jquery-ui-1.10.3.custom.min.js"></script>
<!-- *** javascript *** -->
<script language="JavaScript">
<!--
$(function() {

	if($('#plan_flg').val() == 0 || $('#plan_flg').val() == 2){
		$('#light_ritu').attr('disabled', 'disabled');
		$("#light_ritu").css('backgroundColor', '#F2F2F2');
	}else{
		$('#light_ritu').attr('disabled', false);
		$("#light_ritu").css('backgroundColor', '');
	}

	light_check();
});

function plan(){
	if($('#plan_flg').val() == 0 || $('#plan_flg').val() == 2){
		$('#light_ritu').attr('disabled', 'disabled');
		$("#light_ritu").css('backgroundColor', '#F2F2F2');
		$("#light_ritu").val("");
	}else{
		$('#light_ritu').attr('disabled', false);
		$("#light_ritu").css('backgroundColor', '');

	}
}

function editnm(){
	$(".company_nm2").html($("#company_nm").val());
}

var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}

function light_check(){
	if($('#light_flg').prop('checked')){
		$('#kingaku_light').attr('disabled', false);
		$("#kingaku_light").css('backgroundColor', '');
	}else{
		$('#kingaku_light').attr('disabled', 'disabled');
		$("#kingaku_light").css('backgroundColor', '#F2F2F2');
	}
}

function copy_add(){
	$("#sk_zip1").val($("#zip1").val());
	$("#sk_zip2").val($("#zip2").val());
	$("#sk_todoufuken_no").val($("#todoufuken_no").val());
	$("#sk_add1").val($("#add1").val());
	$("#sk_add2").val($("#add2").val());
}


window.onunload = unload_page;
// -->
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 2) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="company_l.php">提携会社管理</a>
			<span>&gt;</span>
			<a href="company_l.php">提携会社一覧</a>
			<span>&gt;</span>
			<a href="company_r.php?company_no=<?php echo $gc->company_no ?>">詳細</a>
			<span>&gt;</span>
			基本情報<?php echo f_hsc($gc->mode_title)?>
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

<?php
	if($gc->form_mode=="confirm"){
?>

				<form name="form_data" action="company_e.php" method="POST" onsubmit="return false">
					<input name="mode" type="hidden" value="">
					<input name="act" type="hidden" value="<?php echo $gc->act?>">
					<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>">
					<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>">
					<input name="company_nm" type="hidden" value="<?php echo f_hsc($gc->company_nm)?>">
					<input name="company_sh" type="hidden" value="<?php echo f_hsc($gc->company_sh)?>">
					<input name="company_kn" type="hidden" value="<?php echo f_hsc($gc->company_kn)?>">
					<input name="company_kbn" type="hidden" value="<?php echo f_hsc($gc->company_kbn)?>">
					<input name="tantou" type="hidden" value="<?php echo f_hsc($gc->tantou)?>">
					<input name="tel" type="hidden" value="<?php echo f_hsc($gc->tel)?>">
					<input name="fax" type="hidden" value="<?php echo f_hsc($gc->fax)?>">
					<input name="e_mail" type="hidden" value="<?php echo f_hsc($gc->e_mail)?>">
					<input name="e_mail_2" type="hidden" value="<?php echo f_hsc($gc->e_mail_2)?>">
					<input name="e_mail_3" type="hidden" value="<?php echo f_hsc($gc->e_mail_3)?>">
					<input name="e_mail_4" type="hidden" value="<?php echo f_hsc($gc->e_mail_4)?>">
					<input name="e_mail_5" type="hidden" value="<?php echo f_hsc($gc->e_mail_5)?>">
					<input name="e_mail_6" type="hidden" value="<?php echo f_hsc($gc->e_mail_6)?>">
					<input name="e_mail_7" type="hidden" value="<?php echo f_hsc($gc->e_mail_7)?>">
					<input name="e_mail_8" type="hidden" value="<?php echo f_hsc($gc->e_mail_8)?>">
					<input name="e_mail_9" type="hidden" value="<?php echo f_hsc($gc->e_mail_9)?>">
					<input name="e_mail_10" type="hidden" value="<?php echo f_hsc($gc->e_mail_10)?>">
					<input name="url" type="hidden" value="<?php echo f_hsc($gc->url)?>">
					<input name="zip1" type="hidden" value="<?php echo f_hsc($gc->zip1)?>">
					<input name="zip2" type="hidden" value="<?php echo f_hsc($gc->zip2)?>">
					<input name="todoufuken_no" type="hidden" value="<?php echo f_hsc($gc->todoufuken_no)?>">
					<input name="add1" type="hidden" value="<?php echo f_hsc($gc->add1)?>">
					<input name="add2" type="hidden" value="<?php echo f_hsc($gc->add2)?>">
					<input name="sk_zip1" type="hidden" value="<?php echo f_hsc($gc->sk_zip1)?>">
					<input name="sk_zip2" type="hidden" value="<?php echo f_hsc($gc->sk_zip2)?>">
					<input name="sk_todoufuken_no" type="hidden" value="<?php echo f_hsc($gc->sk_todoufuken_no)?>">
					<input name="sk_add1" type="hidden" value="<?php echo f_hsc($gc->sk_add1)?>">
					<input name="sk_add2" type="hidden" value="<?php echo f_hsc($gc->sk_add2)?>">
					<input name="sk_jigyoubu" type="hidden" value="<?php echo f_hsc($gc->sk_jigyoubu)?>">
					<input name="sk_tantou" type="hidden" value="<?php echo f_hsc($gc->sk_tantou)?>">
					<input name="jyougen" type="hidden" value="<?php echo f_hsc($gc->jyougen)?>">
					<input name="light_flg" type="hidden" value="<?php echo f_hsc($gc->light_flg)?>">
					<input name="kingaku_light" type="hidden" value="<?php echo f_hsc($gc->kingaku_light)?>">
					<input name="kingaku_kotei" type="hidden" value="<?php echo f_hsc($gc->kingaku_kotei)?>">
					<input name="kakuritsu" type="hidden" value="<?php echo f_hsc($gc->kakuritsu)?>">
					<input name="chintai_flg" type="hidden" value="<?php echo f_hsc($gc->chintai_flg)?>">
					<input name="relocation_flg" type="hidden" value="<?php echo f_hsc($gc->relocation_flg)?>">
					<input name="keisai_flg" type="hidden" value="<?php echo f_hsc($gc->keisai_flg)?>">
					<input name="keisai_logo_flg" type="hidden" value="<?php echo f_hsc($gc->keisai_logo_flg)?>">
					<input name="keisai_comment_flg" type="hidden" value="<?php echo f_hsc($gc->keisai_comment_flg)?>">
					<input name="img_nm" type="hidden" value="<?php echo f_hsc($gc->img_nm)?>">
					<input name="img_tmp_nm" type="hidden" value="<?php echo f_hsc($gc->img_tmp_nm)?>">
					<input name="img_del" type="hidden" value="<?php echo f_hsc($gc->img_del)?>">

					<input name="sublease_flg" type="hidden" value="<?php echo f_hsc($gc->sublease_flg)?>">
					<input name="chintai_ritu" type="hidden" value="<?php echo f_hsc($gc->chintai_ritu)?>">
					<input name="sublease_ritu" type="hidden" value="<?php echo f_hsc($gc->sublease_ritu)?>">
					<input name="relocation_ritu" type="hidden" value="<?php echo f_hsc($gc->relocation_ritu)?>">
					<input name="comment" type="hidden" value="<?php echo f_hsc($gc->comment)?>">
					<input name="plan_flg" type="hidden" value="<?php echo f_hsc($gc->plan_flg)?>">
					<input name="light_ritu" type="hidden" value="<?php echo f_hsc($gc->light_ritu)?>">
					<input name="display_flg" type="hidden" value="<?php echo f_hsc($gc->display_flg)?>">
					<input name="buken_mansion_flg" type="hidden" value="<?php echo f_hsc($gc->buken_mansion_flg)?>">
					<input name="buken_kodate_flg" type="hidden" value="<?php echo f_hsc($gc->buken_kodate_flg)?>">
					<input name="buken_ittou_flg" type="hidden" value="<?php echo f_hsc($gc->buken_ittou_flg)?>">
				</form>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;次の内容でよろしいですか?</strong></p>
				</div>
				<!-- End Message OK -->

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>基本情報</h2>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-field">
							<label>会社名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_nm)?>
							</div>
						</div>

						<div class="box-field">
							<label>支店名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_sh)?>
							</div>
						</div>

						<div class="box-field">
							<label>フリガナ</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_kn)?>
							</div>
						</div>
<!--
						<div class="box-field">
							<label>区分</label>
							<div class="box-confirm">
								<?php //echo f_hsc($gc->company_kbn_str)?>
							</div>
						</div>
 -->
						<div class="box-field">
							<label>物件種別選択</label>
							<div class="box-confirm">
								<?php if($gc->buken_mansion_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_mansion_flg_str)?></span><?php } ?>
								<?php if($gc->buken_kodate_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_kodate_flg_str)?></span><?php } ?>
								<?php if($gc->buken_ittou_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_ittou_flg_str)?></span><?php } ?>
							</div>
						</div>

 						<div class="box-field">
							<label>表示方法</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->display_flg_str)?>
							</div>
						</div>

						<div class="box-field">
							<label>サービス選択</label>
							<div class="box-confirm">
								<span class="mr10"><?php if($gc->chintai_flg == 1){ echo f_hsc($gc->chintai_flg_str).":".f_hsc($gc->chintai_ritu);}?></span>
								<span class="mr10"><?php if($gc->sublease_flg == 1){ echo f_hsc($gc->sublease_flg_str).":".f_hsc($gc->sublease_ritu);}?></span>
								<span class="mr10"><?php if($gc->relocation_flg == 1){ echo f_hsc($gc->relocation_flg_str).":".f_hsc($gc->relocation_ritu);}?></span>
							</div>
						</div>

						<div class="box-field">
								<label>プラン</label>
								<div class="box-confirm">
									<?php echo fsel_get_plan($gc,$gc->plan_flg,true)?>
								</div>
							</div>

						<div class="box-field">
							<label>ライトプラン出現率</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->light_ritu)?>
							</div>
						</div>

						<div class="box-field">
							<label>担当者</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->tantou)?>
							</div>
						</div>

						<div class="box-field">
							<label>TEL</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->tel)?>
							</div>
						</div>

						<div class="box-field">
							<label>FAX</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->fax)?>
							</div>
						</div>

						<div class="box-field">
							<label>E-mail</label>
							<div class="box-confirm">
								01: <?php echo f_hsc($gc->e_mail)?><br />
								02: <?php echo f_hsc($gc->e_mail_2)?><br />
								03: <?php echo f_hsc($gc->e_mail_3)?><br />
								04: <?php echo f_hsc($gc->e_mail_4)?><br />
								05: <?php echo f_hsc($gc->e_mail_5)?><br />
								06: <?php echo f_hsc($gc->e_mail_6)?><br />
								07: <?php echo f_hsc($gc->e_mail_7)?><br />
								08: <?php echo f_hsc($gc->e_mail_8)?><br />
								09: <?php echo f_hsc($gc->e_mail_9)?><br />
								10: <?php echo f_hsc($gc->e_mail_10)?><br />
							</div>
						</div>

						<div class="box-field">
							<label>URL</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->url)?>
							</div>
						</div>

						<div class="box-field">
							<label>所在地</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->zip)?><br />
								<?php echo fsel_get_todoufuken($gc, $gc->todoufuken_no, true) ?><br />
								<?php echo f_hsc($gc->add1)?><br />
								<?php echo f_hsc($gc->add2)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求先住所</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_zip)?><br />
								<?php echo fsel_get_todoufuken($gc, $gc->sk_todoufuken_no, true) ?><br />
								<?php echo f_hsc($gc->sk_add1)?><br />
								<?php echo f_hsc($gc->sk_add2)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求事業所名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_jigyoubu)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求担当者名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_tantou)?>
							</div>
						</div>

						<div class="box-field">
							<label>固定金額</label>
							<div class="box-confirm">
<?php if($gc->kingaku_kotei > 0){ ?>
								<?php echo f_hsc(number_format($gc->kingaku_kotei))?>
<?php } ?>
							</div>
							<label>ライトプラン金額</label>
							<div class="box-confirm">
<?php if($gc->light_flg == "1"){ ?>
								<?php echo f_hsc(number_format($gc->kingaku_light))?>
<?php }else{ ?>
								- (エリア毎に設定した金額を適用する)
<?php } ?>
							</div>
							<label>月の利用限度額</label>
							<div class="box-confirm">
<?php if($gc->jyougen > 0){ ?>
								<?php echo f_hsc(number_format($gc->jyougen))?>
<?php } ?>
							</div>
						</div>
<!--
						<div class="box-field">
							<label>出現率</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->kakuritsu)?>
							</div>
						</div>
 -->
						<div class="box-field">
							<label>ロゴ画像</label>
							<div class="box-confirm">
<?php if($gc->img_show){ ?>
							<?php echo ($gc->img_del_checked?"削除<br />":"") ?>
							<img src="<?php echo $gc->img_src ?>" alt="" width="200">
<?php } ?>
							<label><?php echo f_hsc($gc->company_nm)?></label>
							<label>コメント欄</label>
							<textarea name="comment" class="field" cols=50 rows= 4  readonly><?php echo $gc->comment?></textarea><br>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_logo_flg_str)?>
							</div>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_comment_flg_str)?>
							</div>
							</div>
						</div>

						<div class="box-field">
							<label>掲載</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_flg_str)?>
							</div>
						</div>

					</div>
					<!-- End Form -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="alignleft">
							<button type="button" class="button color green" onclick="run_submit('form_data', 'entry')">はい</button>
							<button type="button" class="button color blue" onclick="run_submit('form_data', 'revision')">修正</button>
						</div>
						<div class="alignright">
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->

<?php
	}elseif($gc->form_mode=="message"){
?>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;<?php echo f_hsc($gc->message) ?></strong></p>
				</div>
				<!-- End Message OK -->

<?php

		switch ($gc->db_act) {
		case "i":
			echo "<div class=\"ac\">";
			echo "<a href=\"company_e.php?mode=add\">続けて新規登録</a>";
			echo "&nbsp;&nbsp;&nbsp;&nbsp;";
			echo "<a href=\"company_l.php\" class=\"ml10\">提携会社一覧へ</a>";
			echo "</div>";
			break;
		case "u":
		case "d":
			echo "<div class=\"ac\"><a href=\"company_l.php\">提携会社一覧へ</a></div>";
			break;
		}

	}else{

		for ($i=0; $i<$gc->msg->count; $i++) {
?>
				<!-- Message Error -->
				<div class="msg msg-error">
					<p><strong>&nbsp;<?php echo f_hsc($gc->msg->list[$i]) ?></strong></p>
				</div>
				<!-- End Message Error -->
<?php
		}
?>

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>基本情報</h2>
					</div>
					<!-- End Box Head -->

					<form name="form_edit" action="company_e.php" method="POST" onsubmit="return false" enctype="multipart/form-data">
						<input name="mode" type="hidden" value="" />
						<input name="act" type="hidden" value="<?php echo $gc->act?>" />
						<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>" />
						<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>" />
						<input name="img_nm" type="hidden" value="<?php echo f_hsc($gc->img_nm)?>">
						<input name="img_tmp_nm" type="hidden" value="<?php echo f_hsc($gc->img_tmp_nm)?>">

						<!-- Form -->
						<div class="form">

							<div class="box-field">
								<label>会社名<span>(必須)</span></label>
								<input type="text" name="company_nm" id="company_nm" class="field size4" onchange="editnm()" value="<?php echo f_hsc($gc->company_nm)?>" />
							</div>

							<div class="box-field">
								<label>支店名</label>
								<input type="text" name="company_sh" class="field size4" value="<?php echo f_hsc($gc->company_sh)?>" />
							</div>

							<div class="box-field">
								<label>フリガナ<span>(必須)</span></label>
								<input type="text" name="company_kn" class="field size4" value="<?php echo f_hsc($gc->company_kn)?>" />
							</div>
<!--
							<div class="box-field inline-field">
								<label>区分<span>(必須)</span></label>
								<div class="ml10 mt05">
									<input id="company_kbn_1" type="radio" name="company_kbn" value="1"<?php //echo $gc->company_kbn_1_checked ?> />
									<label class="mr10" for="company_kbn_1" style="display:inline;font-weight: normal;">大手</label>
									<input id="company_kbn_2" type="radio" name="company_kbn" value="2"<?php //echo $gc->company_kbn_2_checked ?> />
									<label class="mr10" for="company_kbn_2" style="display:inline;font-weight: normal;">地場</label>
								</div>
							</div>
 -->

							<div class="box-field">
								<label>物件種別選択<span>(どれか必須)</span></label>
								<div class="ml10 mt05">
									<input type="checkbox" name="buken_mansion_flg" id="buken_mansion_flg" value="1"<?php echo $gc->buken_mansion_flg_checked?>>
									<label for="buken_mansion_flg" class="check" style="display:inline;font-weight: normal; margin-right: 8px;">分譲マンション</label>
									<input type="checkbox" name="buken_kodate_flg" id="buken_kodate_flg" value="1"<?php echo $gc->buken_kodate_flg_checked?>>
									<label for="buken_kodate_flg" class="check" style="display:inline;font-weight: normal; margin-right: 8px;">一戸建て</label>
									<input type="checkbox" name="buken_ittou_flg" id="buken_ittou_flg" value="1"<?php echo $gc->buken_ittou_flg_checked?>>
									<label for="buken_ittou_flg" class="check" style="display:inline;font-weight: normal; margin-right: 8px;">一棟アパート・マンション</label>
								</div>
							</div>

 							<div class="box-field inline-field">
								<label>表示方法<span>(必須)</span></label>
								<div class="ml10 mt05">
									<p><input type="radio" name="display_flg" id="display_flg_0" value="0"<?php echo $gc->display_flg_0_checked?>>
									<label for="display_flg_0" class="check mr10" style="display:inline;font-weight: normal;">通常表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_1" value="1"<?php echo $gc->display_flg_1_checked?>>
									<label for="display_flg_1" class="check mr10" style="display:inline;font-weight: normal;">ご希望サービスの賃貸募集・賃貸管理を選択した場合のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_2" value="2"<?php echo $gc->display_flg_2_checked?>>
									<label for="display_flg_2" class="check mr10" style="display:inline;font-weight: normal;">築年数が15年以下で延床面積が35㎡以上の場合のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_3" value="3"<?php echo $gc->display_flg_3_checked?>>
									<label for="display_flg_3" class="check mr10" style="display:inline;font-weight: normal;">延床面積が40平米以上のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_4" value="4"<?php echo $gc->display_flg_4_checked?>>
									<label for="display_flg_4" class="check mr10" style="display:inline;font-weight: normal;">ご希望のサービスのサブリースを選択した場合のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_5" value="5"<?php echo $gc->display_flg_5_checked?>>
									<label for="display_flg_5" class="check mr10" style="display:inline;font-weight: normal;">延床面積10平米以上25平米以下の物件の場合のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_6" value="6"<?php echo $gc->display_flg_6_checked?>>
									<label for="display_flg_6" class="check mr10" style="display:inline;font-weight: normal;">賃貸管理会社を探しているにチェックが入った場合のみ表示</label></p>
									<p><input type="radio" name="display_flg" id="display_flg_7" value="7"<?php echo $gc->display_flg_7_checked?>>
									<label for="display_flg_7" class="check mr10" style="display:inline;font-weight: normal;">築年数が20年以下の物件の場合のみ表示</label></p>
								</div>
							</div>

							<div class="box-field inline-field">
								<label>サービス選択<span>(どれか必須)</span></label>
								<div class="ml10 mt05">
									<input type="checkbox" name="chintai_flg" id="chintai_flg" value="1"<?php echo $gc->chintai_flg_checked?>>
									<label for="chintai_flg" class="check mr10" style="display:inline;font-weight: normal;">賃貸仲介</label>
									<input type="checkbox" name="sublease_flg" id="sublease_flg" value="1"<?php echo $gc->sublease_flg_checked?>>
									<label for="sublease_flg" class="check mr10" style="display:inline;font-weight: normal;">サブリース</label>
									<input type="checkbox" name="relocation_flg" id="relocation_flg" value="1"<?php echo $gc->relocation_flg_checked?>>
									<label for="relocation_flg" class="check mr10" style="display:inline;font-weight: normal;">リロケーション</label>
									<br/>
									<input type="text" name="chintai_ritu" class="field inlineR" style="ime-mode: disabled;width:50px;" value="<?php echo f_hsc($gc->chintai_ritu)?>" />
									<input type="text" name="sublease_ritu" class="field inlineR" style="ime-mode: disabled;width:50px;margin-left:20px;" value="<?php echo f_hsc($gc->sublease_ritu)?>" />
									<input type="text" name="relocation_ritu" class="field inlineR" style="ime-mode: disabled;width:50px;margin-left:29px;" value="<?php echo f_hsc($gc->relocation_ritu)?>" />
								</div>
							</div>

							<div class="box-field">
								<label>プラン<span>(必須)</span></label>
								<div class="inline-field">
									<select id="plan_flg" name="plan_flg" onchange="plan()" class="field">
										<?php echo fsel_get_plan($gc,$gc->plan_flg)?>
									</select>
								</div>
							</div>

							<div class="box-field">
								<label>ライトプラン出現率<span>(数値)</span></label>
								<input type="text" name="light_ritu" id="light_ritu" style="ime-mode: disabled;" class="field size2 inlineR" value="<?php echo f_hsc($gc->light_ritu)?>" />							</div>

							<div class="box-field">
								<label>担当者</label>
								<input type="text" name="tantou" class="field size4" value="<?php echo f_hsc($gc->tantou)?>" />
							</div>

							<div class="box-field">
								<label>TEL</label>
								<input type="text" name="tel" class="field size4" value="<?php echo f_hsc($gc->tel)?>" />
							</div>

							<div class="box-field">
								<label>FAX</label>
								<input type="text" name="fax" class="field size4" value="<?php echo f_hsc($gc->fax)?>" />
							</div>

							<div class="box-field">
								<label>E-mail<span>(1つ目は必須)</span></label>
								<div class="inline-field">
									01:<input style="margin-bottom:4px;" type="text" name="e_mail" class="field size4" value="<?php echo f_hsc($gc->e_mail)?>" /><br />
									02:<input style="margin-bottom:4px;" type="text" name="e_mail_2" class="field size4" value="<?php echo f_hsc($gc->e_mail_2)?>" /><br />
									03:<input style="margin-bottom:4px;" type="text" name="e_mail_3" class="field size4" value="<?php echo f_hsc($gc->e_mail_3)?>" /><br />
									04:<input style="margin-bottom:4px;" type="text" name="e_mail_4" class="field size4" value="<?php echo f_hsc($gc->e_mail_4)?>" /><br />
									05:<input style="margin-bottom:4px;" type="text" name="e_mail_5" class="field size4" value="<?php echo f_hsc($gc->e_mail_5)?>" /><br />
									06:<input style="margin-bottom:4px;" type="text" name="e_mail_6" class="field size4" value="<?php echo f_hsc($gc->e_mail_6)?>" /><br />
									07:<input style="margin-bottom:4px;" type="text" name="e_mail_7" class="field size4" value="<?php echo f_hsc($gc->e_mail_7)?>" /><br />
									08:<input style="margin-bottom:4px;" type="text" name="e_mail_8" class="field size4" value="<?php echo f_hsc($gc->e_mail_8)?>" /><br />
									09:<input style="margin-bottom:4px;" type="text" name="e_mail_9" class="field size4" value="<?php echo f_hsc($gc->e_mail_9)?>" /><br />
									10:<input style="margin-bottom:4px;" type="text" name="e_mail_10" class="field size4" value="<?php echo f_hsc($gc->e_mail_10)?>" /><br />
								</div>
							</div>

							<div class="box-field">
								<label>URL</label>
								<input type="text" name="url" class="field size4" value="<?php echo f_hsc($gc->url)?>" />
							</div>

							<div class="box-field">
									<label style="width: 200px; display:inline;">所在地</label> 
									<button type="button" class="button" style="margin: 3px;" onclick="copy_add()">請求先住所にコピーする</button>

								<div class="inline-field">
									<input type="text" name="zip1" id="zip1" class="field size2" value="<?php echo f_hsc($gc->zip1)?>" />
									-
									<input type="text" name="zip2" id="zip2" class="field size2" value="<?php echo f_hsc($gc->zip2)?>" />
								</div>
								<select name="todoufuken_no" id="todoufuken_no" class="field size3 mt05">
									<option value=""></option>
									<?php echo fsel_get_todoufuken($gc, $gc->todoufuken_no) ?>
								</select>
								<input type="text" name="add1" id="add1" class="field size4 mt05" value="<?php echo f_hsc($gc->add1)?>" />
								<input type="text" name="add2" id="add2" class="field size4 mt05" value="<?php echo f_hsc($gc->add2)?>" />
							</div>


							<div class="box-field">
								<label>請求先住所<span>必須</span></label>
								<div class="inline-field">
									<input type="text" name="sk_zip1" id="sk_zip1" class="field size2" value="<?php echo f_hsc($gc->sk_zip1)?>" />
									-
									<input type="text" name="sk_zip2" id="sk_zip2" class="field size2" value="<?php echo f_hsc($gc->sk_zip2)?>" />
								</div>
								<select name="sk_todoufuken_no" id="sk_todoufuken_no" class="field size3 mt05">
									<option value=""></option>
									<?php echo fsel_get_todoufuken($gc, $gc->sk_todoufuken_no) ?>
								</select>
								<input type="text" name="sk_add1" id="sk_add1" class="field size4 mt05" value="<?php echo f_hsc($gc->sk_add1)?>" />
								<input type="text" name="sk_add2" id="sk_add2" class="field size4 mt05" value="<?php echo f_hsc($gc->sk_add2)?>" />
							</div>

							<div class="box-field">
								<label>請求事業部名</label>
								<input type="text" name="sk_jigyoubu" class="field size4 mt05" value="<?php echo f_hsc($gc->sk_jigyoubu)?>" />
							</div>

							<div class="box-field">
								<label>請求担当者名<span>必須</span></label>
								<input type="text" name="sk_tantou" class="field size4 mt05" value="<?php echo f_hsc($gc->sk_tantou)?>" />
							</div>

							<div class="box-field">
								<div>
									<label>固定金額<span>(優先されます)</span></label>
									<input type="text" name="kingaku_kotei" class="field size2 inlineR" value="<?php echo f_hsc($gc->kingaku_kotei)?>" />
								</div>
							</div>
							<div class="box-field inline-field">
								<div>
									<label>ライトプラン金額<span>(1件あたり)</span></label>
									<input type="checkbox" name="light_flg" id="light_flg" value="1"<?php echo $gc->light_flg_checked?>  onclick="light_check()"> 
									<input type="text" name="kingaku_light" id="kingaku_light" class="field size2 inlineR" value="<?php echo f_hsc($gc->kingaku_light)?>" />
									<br>チェックが入っていない場合はエリア毎に設定した金額が適用されます。
								</div>
							</div>
							<div class="box-field">
								<div>
									<label>月の利用限度額<span>(数値)</span></label>
									<input type="text" name="jyougen" class="field size2 inlineR" value="<?php echo f_hsc($gc->jyougen)?>" />
								</div>
								<div style="clear:both;">
								</div>
							</div>
<!--
							<div class="box-field">
								<label>出現率<span>(数値)</span></label>
								<input type="text" name="kakuritsu" class="field size2 inlineR" value="<?php echo f_hsc($gc->kakuritsu)?>" />
								<?php //out_html_kakuritsu_list($gc); ?>
							</div>
 -->
							<div class="box-field">
								<label>ロゴ画像<span>(横200ピクセル・縦60ピクセル)</span></label>
<?php if($gc->img_show){ ?>
								<input type=checkbox name="img_del" id="img_del" value="y"<?php echo $gc->img_del_checked?>><label for="img_del" style="margin-left: 4px;display:inline;font-weight: normal;">削除</label>&nbsp;
<?php } ?>
								<input type=file name="img_file" style="width:300;"><br />
<?php if($gc->img_show){ ?>
								<img src="<?php echo $gc->img_src?>" alt="" width="200">
<?php } ?>
								<label class="company_nm2"><?php echo f_hsc($gc->company_nm)?></label>
								<label>コメント欄<span>最大3行毎行24文字以内入力してください</span></label>
								<textarea name="comment" class="field" cols=50 rows= 4 ><?php echo $gc->comment?></textarea><br>
								<div class="ml10 mt05">
									<input type="checkbox" name="keisai_logo_flg" id="keisai_logo_flg" value="1"<?php echo $gc->keisai_logo_flg_checked?>>
									<label for="keisai_logo_flg" class="check" style="display:inline;font-weight: normal;">企業ロゴをTOP画面に表示しない</label>
								</div>
								<div class="ml10 mt05">
									<input type="checkbox" name="keisai_comment_flg" id="keisai_comment_flg" value="1"<?php echo $gc->keisai_comment_flg_checked?>>
									<label for="keisai_comment_flg" class="check" style="display:inline;font-weight: normal;">掲載会社一覧に表示しない</label>
								</div>
							</div>

							<div class="box-field">
								<label>掲載</label>
								<div class="ml10 mt05">
									<input type="checkbox" name="keisai_flg" id="keisai_flg" value="1"<?php echo $gc->keisai_flg_checked?>>
									<label for="keisai_flg" class="check" style="display:inline;font-weight: normal;">掲載する</label>
								</div>
							</div>

						</div>
						<!-- End Form -->

						<!-- Form Buttons -->
						<div class="buttons">
							<div class="alignleft">
								<button type="button" class="button color green" onclick="run_submit('form_edit', 'confirm')">入力確認へ</button>
							</div>
<?php
		if($gc->act=="u"){
?>
							<div class="alignright">
								<button type="button" class="button color red" onclick="run_submit('form_edit', 'delete')">削除</button>
							</div>
							<div class="alignright pos-top2">
								<input id="del" name="delete_check" type="checkbox" value="1" class="pos-top2" /><label for="del">削除する</label>
							</div>
<?php
		}
?>
						</div>
						<!-- End Form Buttons -->

					</form>

				</div>
				<!-- End Box -->

<?php
	}
?>
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
Exemple #4
0
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>対応エリア</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<style>
/* IEでソートするときの対応 */
.group { zoom: 1 }
</style>
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script>
$(function() {

	$("#tabs").tabs();

	$('.group h3').click(function(){

		if( $(this).attr("panelmode") == "open" ){

			//閉じる処理

			$(this).attr("panelmode", "close");

			$(this).removeClass("ui-accordion-header-active");
			$(this).removeClass("ui-state-active");
			$(this).removeClass("ui-corner-top");
			$(this).addClass("ui-corner-all");

			$('span', this).removeClass("ui-icon-triangle-1-s");
			$('span', this).addClass("ui-icon-triangle-1-e");

			$('+div', this).removeClass("ui-accordion-content-active");

			$('+div:not(:animated)',this).slideUp('normal');

		}else{

			//開く処理

			$(this).attr("panelmode", "open");

			$(this).removeClass("ui-corner-all");
			$(this).addClass("ui-accordion-header-active");
			$(this).addClass("ui-state-active");
			$(this).addClass("ui-corner-top");

			$('span', this).removeClass("ui-icon-triangle-1-e");
			$('span', this).addClass("ui-icon-triangle-1-s");

			$('+div', this).addClass("ui-accordion-content-active");

			var d = {height:'toggle', opacity:'toggle'};
			$('+div',this).animate(d);

		}

	});

});
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 3) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="area_r.php">エリア管理</a>
			<span>&gt;</span>
			対応エリア
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>対応エリア</b></h2>
						<div class="right">
							<a href="area_csv.php" class="custom-button"><span>CSV出力</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Tabs -->
					<div id="tabs" style="margin:15px 10px;">

						<ul>
						<li><a href="#tabs-1">Sランク</a></li>
						<li><a href="#tabs-2">Aランク</a></li>
						<li><a href="#tabs-3">Bランク</a></li>
						<li><a href="#tabs-4">Cランク</a></li>
						<li><a href="#tabs-0">&nbsp;な し&nbsp;</a></li>
						</ul>

						<div id="tabs-1">
							<?php out_html_todoufuken($gc, 1) ?>
						</div>

						<div id="tabs-2">
							<?php out_html_todoufuken($gc, 2) ?>
						</div>

						<div id="tabs-3">
							<?php out_html_todoufuken($gc, 3) ?>
						</div>

						<div id="tabs-4">
							<?php out_html_todoufuken($gc, 4) ?>
						</div>

						<div id="tabs-0">
							<?php out_html_todoufuken($gc, 0) ?>
						</div>

					</div>
					<!-- End Tabs -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="ac">
							<button type="button" class="button color green" onclick="location.href='area_l.php'">地域ランクを編集</button>
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
Exemple #5
0
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>メニュー</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 0) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">メニュー</h2>
						<div class="right">
							<div class="cl">&nbsp;</div>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php

	$wk["name"] = "案件管理";
	$wk["href"] = "item_l.php";
	$items[] = $wk;

	$wk["name"] = "提携会社管理";
	$wk["href"] = "company_l.php";
	$items[] = $wk;

	$wk["name"] = "エリア管理";
	$wk["href"] = "area_r.php";
	$items[] = $wk;

	$wk["name"] = "管理者";
	$wk["href"] = "user_l.php";
	$items[] = $wk;

	$wk["name"] = "手数料管理";
	$wk["href"] = "tesuryo_l.php";
	$items[] = $wk;

	$wk["name"] = "提携会社ユーザー";
	$wk["href"] = "c_user_l.php";
	$items[] = $wk;

	$i = 0;

	foreach ($items as $item) {

		$name = $item["name"];
		$href = $item["href"];

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td><h3><a href=\"".$href."\">".f_hsc($name)."</a></h3></td>";
		echo "<td width=\"70\" class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='".$href."';\">Go</button></td>";
		echo "</tr>";

		$i++;

	}

?>
						</table>
					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- End Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

//	$gc->sum_tesuryou = get_sum_tesuryou($gc);
	$gc->sum_tesuryou = get_sum_tesuryou_d($gc);

	$gc->company_nm = fdb_get_name($gc, "m_company", "company_nm", "company_no", $gc->company_no);

	$arr_todoufuken = fsel_get_arr_todoufuken($gc);

	$arr_buken_sbt = fdiv_set_buken_sbt_array();

	$sql = sql_text_create_d($gc);

	switch($_GET["si"]) {
	case "ank":
		$sql.= " p.anken_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "mbi":
		$sql.= " p.moushikomibi".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "sbt":
		$sql.= " p.buken_sbt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "men":
		$sql.= " p.menseki".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "ran":
		$sql.= " p.rank_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "tod":
		$sql.= " s.todoufuken_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "shi":
		$sql.= " p.buken_shikucyouson_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "yuk":
		$sql.= " c2.y_cnt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "muk":
		$sql.= " c2.m_cnt".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "tes":
		$sql.= " p.tesuryou".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	default:
		$sql.= " p.item_no ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("tesuryo_d.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["ank"] = "";
	$sort_mode["mbi"] = "";
	$sort_mode["sbt"] = "";
	$sort_mode["men"] = "";
	$sort_mode["ran"] = "";
	$sort_mode["tod"] = "";
	$sort_mode["shi"] = "";
	$sort_mode["muk"] = "";
	$sort_mode["yuk"] = "";
	$sort_mode["tes"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>手数料内訳</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 5) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="tesuryo_l.php">手数料管理</a>
			<span>&gt;</span>
			<a href="tesuryo_l.php">手数料一覧</a>
			<span>&gt;</span>
			手数料内訳
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><?php echo f_hsc($gc->company_nm) ?></h2>
						<div class="right">&nbsp;</div>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-size4 left">
							<p class="inline-field">
								<label style="display:inline;">集計期間:</label>
									<?php echo substr($gc->mbif, 0, 4) ?>年<?php echo substr($gc->mbif, 4, 2) ?>月<?php echo substr($gc->mbif, 6, 2) ?>日
									~
									<?php echo substr($gc->mbit, 0, 4) ?>年<?php echo substr($gc->mbit, 4, 2) ?>月<?php echo substr($gc->mbit, 6, 2) ?>日
							</p>
						</div>

						<div style="float:right;">
							<label class="ml40" style="display:inline;">手数料合計:</label>
							<?php echo number_format($gc->sum_tesuryou) ?>円
						</div>

						<div class="cl">&nbsp;</div>

					</div>
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">内訳</h2>
						<div class="right">
							<a href="tesuryo_excel.php?mode=2&mbif=<?php echo f_hsc($gc->mbif) ?>&mbit=<?php echo f_hsc($gc->mbit) ?>&company_no=<?php echo f_hsc($gc->company_no) ?>" class="custom-button" style="margin-right:15px;"><span>請求書出力</span></a>
							<a href="tesuryo_csv.php?mode=2&mbif=<?php echo f_hsc($gc->mbif) ?>&mbit=<?php echo f_hsc($gc->mbit) ?>&company_no=<?php echo f_hsc($gc->company_no) ?>" class="custom-button"><span>CSV出力</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th width="80" class="ac"><a href="tesuryo_d.php<?php echo f_sq("ank") ?>">案件番号</a><?php echo $sort_mode["ank"] ?></th>
								<th width="80" class="ac"><a href="tesuryo_d.php<?php echo f_sq("mbi") ?>">申込日</a><?php echo $sort_mode["mbi"] ?></th>
								<th width="80" class="ac"><a href="tesuryo_d.php<?php echo f_sq("sbt") ?>">種別</a><?php echo $sort_mode["sbt"] ?></th>
								<th width="80" class="ac"><a href="tesuryo_d.php<?php echo f_sq("men") ?>">延床面積</a><?php echo $sort_mode["men"] ?><br />(平米)</th>
								<th width="50" class="ac"><a href="tesuryo_d.php<?php echo f_sq("ran") ?>">ランク</a><?php echo $sort_mode["ran"] ?></th>
								<th width="70"><a href="tesuryo_d.php<?php echo f_sq("tod") ?>">都道府県</a><?php echo $sort_mode["tod"] ?></th>
								<th><a href="tesuryo_d.php<?php echo f_sq("shi") ?>">市区町村</a><?php echo $sort_mode["shi"] ?></th>
								<th width="40" class="ac"><a href="tesuryo_d.php<?php echo f_sq("yuk") ?>">有効</a><?php echo $sort_mode["yuk"] ?></th>
								<th width="40" class="ac"><a href="tesuryo_d.php<?php echo f_sq("muk") ?>">無効</a><?php echo $sort_mode["muk"] ?></th>
								<th width="70" class="ac"><a href="tesuryo_d.php<?php echo f_sq("tes") ?>">手数料</a><?php echo $sort_mode["tes"] ?></th>
								<th width="60" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$item_no = $rs->fields["item_no"];
		$anken_no = $rs->fields["anken_no"];
		$buken_sbt = $rs->fields["buken_sbt"];
		$purpose_flg = $rs->fields["purpose_flg"];
		$menseki = $rs->fields["menseki"];
		$rank_no = get_rank_d($rs);
//		$rank_no = $rs->fields["rank_no"];
		$todoufuken_no = $rs->fields["todoufuken_no"];
		$buken_shikucyouson_no = $rs->fields["buken_shikucyouson_no"];
		$shikucyouson_nm = $rs->fields["shikucyouson_nm"];
		$mukou_flg = $rs->fields["mukou_flg"];
		$c_mukou_flg = $rs->fields["c_mukou_flg"];
		$m_cnt = $rs->fields["m_cnt"];
		$y_cnt = $rs->fields["y_cnt"];
		$tesuryou = get_tesuryo_d($rs);
//		$tesuryou = $rs->fields["tesuryou"];
		$moushikomibi = $rs->fields["moushikomibi"];

		$menseki = (float)$menseki;

		$moushikomi_d = substr($moushikomibi, 0, 4)."/".substr($moushikomibi, 5, 2)."/".substr($moushikomibi, 8, 2);
		$moushikomi_t = substr($moushikomibi, 11);

		$todoufuken_nm = $arr_todoufuken[$todoufuken_no];

		$buken_sbt_nm = $arr_buken_sbt[$buken_sbt];

		$arr = fdiv_set_rank_array();


		if($rank_no != "L"){
			$rank_nm = $arr[$rank_no];
		}else{
			$rank_nm = "L";
		}

		if($c_mukou_flg > 0){
			$cmf_style = " style=\"text-decoration:line-through;\"";
		}else{
			$cmf_style = "";
		}
/*
		if($purpose_flg == 1){
			$rank_nm = "L";
		}
*/
		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td class=\"ac\"".$cmf_style.">".$anken_no."</td>";
		echo "<td class=\"ac\"".$cmf_style.">".$moushikomi_d."<br />".$moushikomi_t."</td>";
		echo "<td class=\"ac\"".$cmf_style.">".f_hsc($buken_sbt_nm)."</td>";
		echo "<td class=\"ac\"".$cmf_style.">".f_hsc($menseki)."</td>";
		echo "<td class=\"ac\"".$cmf_style.">".f_hsc($rank_nm)."</td>";
		echo "<td".$cmf_style.">".f_hsc($todoufuken_nm)."</td>";
		echo "<td".$cmf_style.">".f_hsc($shikucyouson_nm)."</td>";
		echo "<td class=\"ac\" ".$cmf_style.">".f_hsc($y_cnt)."</td>";
		echo "<td class=\"ac\" ".$cmf_style.">".f_hsc($m_cnt)."</td>";
//		echo "<td class=\"ac\" style=\"color: ".($mukou_flg==1?"red":"blue").";\">".f_hsc($mukou_flg==1?"無効":"有効")."</td>";
		echo "<td class=\"ar\"".$cmf_style.">".f_hsc($mukou_flg==1?"0":$tesuryou)."</td>";
//		echo "<td class=\"ar\">".f_hsc($mukou_flg==1?"0":number_format($tesuryou))."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='item_e.php?item_no=".$item_no."&referrer=tesuryo_d&company_no=".$gc->company_no."&mbif=".$gc->mbif."&mbit=".$gc->mbit."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"10\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>

						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>郵便番号設定</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 0) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			郵便番号設定
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>郵便番号設定</b></h2>
						<div class="right">
							&nbsp;
						</div>
					</div>
					<!-- End Box Head -->

					<div class="ac" style="padding:20px;">
						<?php db_entry($gc) ?> 件登録しました。
					</div>

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>請求書ダウンロード</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 5) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="tesuryo_l.php">手数料管理</a>
			<span>&gt;</span>
			<a href="tesuryo_l.php">手数料一覧</a>
			<span>&gt;</span>
			請求書ダウンロード
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>請求書ダウンロード</b></h2>
						<div class="right">
							&nbsp;
						</div>
					</div>
					<!-- End Box Head -->

					<div class="ac" style="padding:20px;">
						ダウンロードに失敗しました。
					</div>

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="ac">
							<button type="button" class="button color green" onclick="history.back();">戻る</button>
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	if(is_numeric($gc->company_no)){
		$gc->company_nm = fdb_get_name($gc, "m_company", "company_nm", "company_no", $gc->company_no);
		set_cpage_info($gc);
	}

	if($gc->form_mode == "confirm"){
		if($gc->act == "i"){
			$gc->mode_title = "[追加・確認]";
		}else{
			$gc->mode_title = "[編集・確認]";
		}
	}elseif($gc->form_mode == "message"){
		$gc->mode_title = "[完了]";
	}else{
		if($gc->act == "i"){
			$gc->mode_title = "[追加]";
		}else{
			$gc->mode_title = "[編集]";
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>提携会社ユーザー<?php echo f_hsc($gc->mode_title)?></title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 7) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="c_user_l.php">提携会社ユーザー</a>
			<span>&gt;</span>
			<a href="c_user_l.php">提携会社ユーザー一覧</a>
			<span>&gt;</span>
			提携会社ユーザー<?php echo f_hsc($gc->mode_title)?>
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

<?php
	if($gc->form_mode=="confirm"){
?>

				<form name="form_data" action="c_user_e.php" method="POST" onsubmit="return false">
					<input name="mode" type="hidden" value="">
					<input name="act" type="hidden" value="<?php echo $gc->act?>">
					<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>">
					<input name="user_no" type="hidden" value="<?php echo f_hsc($gc->user_no)?>">
					<input name="user_nm" type="hidden" value="<?php echo f_hsc($gc->user_nm)?>">
					<input name="user_kn" type="hidden" value="<?php echo f_hsc($gc->user_kn)?>">
					<input name="user_id" type="hidden" value="<?php echo f_hsc($gc->user_id)?>">
					<input name="password" type="hidden" value="<?php echo f_hsc($gc->password)?>">
					<input name="e_mail" type="hidden" value="<?php echo f_hsc($gc->e_mail)?>">
					<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>" />
				</form>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;次の内容でよろしいですか?</strong></p>
				</div>
				<!-- End Message OK -->

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>提携会社ユーザー <?php echo f_hsc($gc->company_nm)?></h2>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-field">
							<label>提携会社名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_nm)?>
							</div>
						</div>
						<div class="box-field">
							<label>ユーザー名称</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->user_nm)?>
							</div>
						</div>
						<div class="box-field">
							<label>フリガナ</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->user_kn)?>
							</div>
						</div>
						<div class="box-field">
							<label>ユーザーID</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->user_id)?>
							</div>
						</div>
						<div class="box-field">
							<label>パスワード</label>
							<div class="box-confirm">
								セキュリティ保護のため、パスワードは表示されません
							</div>
						</div>
						<div class="box-field">
							<label>E-mail</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->e_mail)?>
							</div>
						</div>

					</div>
					<!-- End Form -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="alignleft">
							<button type="button" class="button color green" onclick="run_submit('form_data', 'entry')">はい</button>
							<button type="button" class="button color blue" onclick="run_submit('form_data', 'revision')">修正</button>
						</div>
						<div class="alignright">
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->

<?php
	}elseif($gc->form_mode=="message"){
?>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;<?php echo f_hsc($gc->message) ?></strong></p>
				</div>
				<!-- End Message OK -->

<?php

		switch ($gc->db_act) {
		case "i":
			echo "<div class=\"ac\">";
			echo "<a href=\"c_user_l.php\" class=\"ml10\">提携会社ユーザー一覧へ</a>";
			echo "</div>";
			break;
		case "u":
		case "d":
			echo "<div class=\"ac\"><a href=\"c_user_l.php\">提携会社ユーザー一覧へ</a></div>";
			break;
		}

	}else{

		for ($i=0; $i<$gc->msg->count; $i++) {
?>
				<!-- Message Error -->
				<div class="msg msg-error">
					<p><strong>&nbsp;<?php echo f_hsc($gc->msg->list[$i]) ?></strong></p>
				</div>
				<!-- End Message Error -->
<?php
		}
?>

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>提携会社ユーザー <?php echo f_hsc($gc->company_nm)?></h2>
					</div>
					<!-- End Box Head -->

					<form name="form_edit" action="c_user_e.php" method="POST" onsubmit="return false" enctype="multipart/form-data">
						<input name="mode" type="hidden" value="" />
						<input name="act" type="hidden" value="<?php echo $gc->act?>" />
						<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>" />
						<input name="user_no" type="hidden" value="<?php echo f_hsc($gc->user_no)?>" />
						<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>" />

						<!-- Form -->
						<div class="form">

							<div class="box-field">
								<label>提携会社<span>(必須)</span></label>
								<select name="company_no" class="field">
									<?php echo fsel_get_company($gc, $gc->company_no) ?>
								</select>
							</div>

							<div class="box-field">
								<label>ユーザー名称<span>(必須)</span></label>
								<input type="text" name="user_nm" class="field size4" value="<?php echo f_hsc($gc->user_nm)?>" />
							</div>

							<div class="box-field">
								<label>フリガナ<span>(必須)</span></label>
								<input type="text" name="user_kn" class="field size4" value="<?php echo f_hsc($gc->user_kn)?>" />
							</div>

							<div class="box-field">
								<label>ユーザーID<span>(必須)</span></label>
								<input type="text" name="user_id" class="field size4" value="<?php echo f_hsc($gc->user_id)?>" />
							</div>

							<div class="box-field">
								<label>パスワード<span>(必須)</span></label>
								<input type="password" name="password" class="field size4" value="<?php echo f_hsc($gc->password)?>" />
							</div>

							<div class="box-field">
								<label>E-mail</label>
								<input type="text" name="e_mail" class="field size4" value="<?php echo f_hsc($gc->e_mail)?>" />
							</div>

						</div>
						<!-- End Form -->

						<!-- Form Buttons -->
						<div class="buttons">
							<div class="alignleft">
								<button type="button" class="button color green" onclick="run_submit('form_edit', 'confirm')">入力確認へ</button>
							</div>
<?php
		if($gc->act=="u"){
?>
							<div class="alignright">
								<button type="button" class="button color red" onclick="run_submit('form_edit', 'delete')">削除</button>
							</div>
							<div class="alignright pos-top2">
								<input id="del" name="delete_check" type="checkbox" value="1" class="pos-top2" /><label for="del">削除する</label>
							</div>
<?php
		}
?>
						</div>
						<!-- End Form Buttons -->

					</form>

				</div>
				<!-- End Box -->

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>提携会社専用ページ情報</h2>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-field">
							<label>URL及びアカウント情報</label>
							<div class="box-confirm" style='font-family: "MS ゴシック",monospace;'>
								<?php echo nl2br(str_replace(" ", "&nbsp;", f_hsc($gc->pjouhou))) ?>
							</div>
						</div>

					</div>
					<!-- End Form -->
				</div>
				<!-- End Box -->

<?php
	}
?>
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>都道府県ソート</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<style>
/* IEでソートするときの対応 */
.group { zoom: 1 }
</style>
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript">
$(function() {
	var elList = $("#sortable");
	elList.sortable({
		items:".sort-item",
		axis: "y",
		handle: ".handle",
		scroll: true,
		distance: 7,
		update: function(event, ui) {
			var order = elList.sortable("serialize");
			set_area(order);
		}
	});
});

function set_area(order){

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=todoufuken";
	query += "&" + order;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("ソート処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 3) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="area_r.php">エリア管理</a>
			<span>&gt;</span>
			<a href="area_r.php">対応エリア</a>
			<span>&gt;</span>
			<a href="area_l.php">地域ランク編集</a>
			<span>&gt;</span>
			都道府県ソート
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>都道府県ソート</b></h2>
						<div class="right">
							<a href="area_l.php" class="custom-button"><span>地域ランク編集</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table" id="sortable">

						<table class="group" width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th width="20" class="ac">&nbsp;</th>
								<th width="60" class="ac">No.</th>
								<th>都道府県</th>
							</tr>
							<tbody>
<?php

	$sql = "SELECT";
	$sql.= " todoufuken_no,";
	$sql.= " todoufuken_nm,";
	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " m_todoufuken ";
	$sql.= "ORDER BY";
	$sql.= " sort_no";

	$rs = $gc->db->query($sql);

	while ($rs->eof==false) {

		$todoufuken_no = $rs->fields["todoufuken_no"];
		$todoufuken_nm = $rs->fields["todoufuken_nm"];

		echo "<tr id=\"item-".$todoufuken_no."\" class=\"sort-item\">";
		echo "<td class=\"ac\"><span class=\"handle ui-icon ui-icon-arrowthick-2-n-s\" style=\"float:left;cursor:ns-resize;\"></span></td>";
		echo "<td class=\"ac\">".f_hsc($todoufuken_no)."</td>";
		echo "<td>".f_hsc($todoufuken_nm)."</td>";
		echo "</tr>";

		$rs->move_next();

	}

	$rs->free_result();

?>
							</tbody>
						</table>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
Exemple #11
0
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>案件[詳細]</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
$(function() {

	//確認ダイアログ設定
	$('#dialog_confirm').dialog({
		autoOpen: false,
		resizable: false,
		modal: true,
		width: 600
	});
	//企業ごと確認ダイアログ設定
	$('#dialog_confirm_c').dialog({
		autoOpen: false,
		resizable: false,
		modal: true,
		width: 600
	});

});
function open_dialog_confirm(){

	$('#dialog_confirm').dialog('open');

}
function update_confirm_cancel() {

	$("#dialog_confirm").dialog("close");

}

function open_dialog_confirm_c(flg,c_no){

	$('#dcc_flg').text(flg);
	$('#dcc_cno').text(c_no);
	if(flg==1){
		$('#dcc_msg').text('選択した企業を無効にしますか?');
	}else{
		$('#dcc_msg').text('選択した企業を有効にしますか?');
	}
	$('#dialog_confirm_c').dialog('open');

}
function update_confirm_cancel_c() {

	$("#dialog_confirm_c").dialog("close");

}
function update_confirm_ok(){

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=mukou_flg";
	query += "&item_no=<?php echo $gc->item_no ?>";
	query += "&flg=<?php echo ($gc->mukou_flg==0?"1":"0") ?>";

	$.ajax({
		type: "POST",
		url: "ajx_item.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}else{
					location.reload();
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
function update_confirm_ok_c(){
	var edit_flg = $('#dcc_flg').text();
	var edit_cno = $('#dcc_cno').text();

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=c_mukou_flg";
	query += "&item_no=<?php echo $gc->item_no ?>";
	query += "&company_no=" + edit_cno;
	query += "&flg=" + edit_flg;

	$.ajax({
		type: "POST",
		url: "ajx_item.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}else{
					location.reload();
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, ($gc->referrer=="tesuryo_d"?5:1)) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

<?php if($gc->referrer=="tesuryo_d"){ ?>
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="tesuryo_l.php">手数料管理</a>
			<span>&gt;</span>
			<a href="tesuryo_l.php">手数料一覧</a>
			<span>&gt;</span>
			<a href="tesuryo_d.php?company_no=<?php echo $gc->company_no ?>&mbif=<?php echo $gc->mbif ?>&mbit=<?php echo $gc->mbit ?>">手数料内訳</a>
			<span>&gt;</span>
			詳細
		</div>
		<!-- End Small Nav -->
<?php }else{ ?>
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="item_l.php">案件管理</a>
			<span>&gt;</span>
			<a href="item_l.php">申込み/対応状況</a>
			<span>&gt;</span>
			詳細
		</div>
		<!-- End Small Nav -->
<?php } ?>

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>案件詳細</h2>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-field">
							<label>物件情報及び個人情報</label>
							<div class="box-confirm" style='font-family: "MS ゴシック",monospace;'>
								<?php echo nl2br(str_replace(" ", "&nbsp;", f_hsc($gc->naiyou))) ?>
							</div>
						</div>

					</div>
					<!-- End Form -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="al">
<?php if($gc->referrer=="tesuryo_d"){ ?>
<?php 	if($gc->mukou_flg==0){ ?>
							現在、有効です。
<?php 	}else{ ?>
							現在、無効です。
<?php 	} ?>
<?php }else{ ?>
<?php 	if($gc->mukou_flg==0){ ?>
							現在、有効です。<button type="button" class="button color red" onclick="open_dialog_confirm()">無効にする</button>
<?php 	}else{ ?>
							現在、無効です。<button type="button" class="button color green" onclick="open_dialog_confirm()">有効にする</button>
<?php 	} ?>
<?php } ?>

						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>




				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>対応不動産会社</b></h2>
						<div class="right">
							&nbsp;
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

						<table width="100%" border="0" cellspacing="0" cellpadding="0">

<?php

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " c.company_no,";
	$sql.= " c.company_nm ,";
	$sql.= " i.kubun_nm, ";
	$sql.= " i.c_mukou_flg ";
	$sql.= "FROM";
	$sql.= " m_company c ";
	$sql.= "INNER JOIN";
	$sql.= " t_item_company i ";
	$sql.= "ON";
	$sql.= " c.company_no = i.company_no ";
	$sql.= "WHERE";
	$sql.= " i.item_no = ".$gc->item_no." ";
	$sql.= "ORDER BY";
	$sql.= " c.company_no";

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	$i = 0;

	while ($rs->eof==false) {

		$company_no = $rs->fields["company_no"];
		$company_nm = $rs->fields["company_nm"];
		$kubun_nm = $rs->fields["kubun_nm"];
		$c_mukou_flg = $rs->fields["c_mukou_flg"];
		$src = "";
		if(file_exists(C_IMG_PATH."logo/".$company_no)){
			$src = C_IMG_ROOT_URL."logo/".$company_no;
		}

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td style=\"width:210px;\"><img src=\"".$src."\" alt=\"".f_hsc($company_nm)."\"></td><td style=\"text-align: left;\">".f_hsc($company_nm)."</td>";
		echo "<td style=\"text-align: left;\">".f_hsc($kubun_nm)."</td>";
		if($gc->mukou_flg==0){
			if($c_mukou_flg==0){
				echo "<td style=\"text-align: left;width:100px;\">現在、有効です。</td>";
				echo "<td style=\"text-align: left;width:80px;\"><button type=\"button\" class=\"button color red\" onclick=\"open_dialog_confirm_c(1,".f_hsc($company_no).")\">無効にする</button></td>";
			}else{
				echo "<td style=\"text-align: left;width:100px;\">現在、無効です。</td>";
				echo "<td style=\"text-align: left;width:80px;\"><button type=\"button\" class=\"button color blue\" onclick=\"open_dialog_confirm_c(0,".f_hsc($company_no).")\">有効にする</button></td>";
			}
		}
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

?>

						</table>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

<div id="dialog_confirm" title="確認">
	<p class="ac mt20">更新してよろしいですか?</p>
	<p class="ac mt20">
		<button type="button" class="button color green" onclick="update_confirm_ok()">はい</button>
		&nbsp;&nbsp;
		<button type="button" class="button color blue" onclick="update_confirm_cancel()">いいえ</button>
	</p>
</div>

<div id="dialog_confirm_c" title="確認">
	<p class="ac mt20" id="dcc_msg"></p>
	<p class="ac mt20">
		<button type="button" class="button color green" onclick="update_confirm_ok_c()">はい</button>
		&nbsp;&nbsp;
		<button type="button" class="button color blue" onclick="update_confirm_cancel_c()">いいえ</button>
	</p>
	<div style="display:none;" id="dcc_flg"></div><div style="display:none;" id="dcc_cno"></div>
</div>

</body>
</html>
<?php
}
function out_html($gc) {

	//表示方法
	fdiv_set_display_radio($gc, $gc->display_flg, "display_flg");

	//ラジオボタン設定
	fdiv_set_company_kbn_radio($gc, $gc->company_kbn, "company_kbn");

	//チェックボックス設定
	fdiv_set_checkbox($gc, "賃貸仲介", ($gc->chintai_flg=="1"), "chintai_flg");
	fdiv_set_checkbox($gc, "サブリース", ($gc->sublease_flg=="1"), "sublease_flg");
	fdiv_set_checkbox($gc, "リロケーション", ($gc->relocation_flg=="1"), "relocation_flg");
	fdiv_set_checkbox($gc, "掲載する", ($gc->keisai_flg=="1"), "keisai_flg");
	fdiv_set_checkbox($gc, "企業ロゴをTOP画面に表示しない", ($gc->keisai_logo_flg=="1"), "keisai_logo_flg");
	fdiv_set_checkbox($gc, "掲載会社一覧に表示しない", ($gc->keisai_comment_flg=="1"), "keisai_comment_flg");
	fdiv_set_checkbox($gc, "分譲マンション", ($gc->buken_mansion_flg=="1"), "buken_mansion_flg");
	fdiv_set_checkbox($gc, "一戸建て", ($gc->buken_kodate_flg=="1"), "buken_kodate_flg");
	fdiv_set_checkbox($gc, "一棟アパート・マンション", ($gc->buken_ittou_flg=="1"), "buken_ittou_flg");

	$gc->zip = $gc->zip1."-".$gc->zip2;
	if (!preg_match("/^\d{3}\-\d{4}$/", $gc->zip)) {
		$gc->zip = "";
	}

	$gc->sk_zip = $gc->sk_zip1."-".$gc->sk_zip2;
	if (!preg_match("/^\d{3}\-\d{4}$/", $gc->sk_zip)) {
		$gc->sk_zip = "";
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>提携会社[詳細]</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
$(function() {

	$('.group h3').click(function(){

		if( $(this).attr("panelmode") == "open" ){

			//閉じる処理

			$(this).attr("panelmode", "close");

			$(this).removeClass("ui-accordion-header-active");
			$(this).removeClass("ui-state-active");
			$(this).removeClass("ui-corner-top");
			$(this).addClass("ui-corner-all");

			$('span', this).removeClass("ui-icon-triangle-1-s");
			$('span', this).addClass("ui-icon-triangle-1-e");

			$('+div', this).removeClass("ui-accordion-content-active");

			$('+div:not(:animated)',this).slideUp('normal');

		}else{

			//開く処理

			get_area($('+div', this), $(this).attr("todoufuken_no"));

			$(this).attr("panelmode", "open");

			$(this).removeClass("ui-corner-all");
			$(this).addClass("ui-accordion-header-active");
			$(this).addClass("ui-state-active");
			$(this).addClass("ui-corner-top");

			$('span', this).removeClass("ui-icon-triangle-1-e");
			$('span', this).addClass("ui-icon-triangle-1-s");

			$('+div', this).addClass("ui-accordion-content-active");

			var d = {height:'toggle', opacity:'toggle'};
			$('+div',this).animate(d);

		}

	});

});
function get_area(pnl, todoufuken_no){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=company_r";
	query += "&company_no=" + company_no;
	query += "&todoufuken_no=" + todoufuken_no;

	$.ajax({
		type: "POST",
		url: "get_area.php",
		dataType: "html",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				pnl.empty();
				pnl.html(XMLHttpRequest.responseText);
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 2) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="company_l.php">提携会社管理</a>
			<span>&gt;</span>
			<a href="company_l.php">提携会社一覧</a>
			<span>&gt;</span>
			詳細
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<form name="form_data" action="company_e.php" method="GET" onsubmit="return false">
					<input name="mode" type="hidden" value="">
					<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>">
				</form>

				<form name="form_area" action="company_area_e.php" method="GET" onsubmit="return false">
					<input name="mode" type="hidden" value="">
					<input name="company_no" type="hidden" value="<?php echo f_hsc($gc->company_no)?>">
				</form>

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>基本情報</h2>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-field">
							<label>会社名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_nm)?>
							</div>
						</div>

						<div class="box-field">
							<label>支店名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_sh)?>
							</div>
						</div>

						<div class="box-field">
							<label>フリガナ</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->company_kn)?>
							</div>
						</div>
<!--
						<div class="box-field">
							<label>区分</label>
							<div class="box-confirm">
								<?php //echo f_hsc($gc->company_kbn_str)?>
							</div>
						</div>
 -->
						<div class="box-field">
							<label>物件種別選択</label>
							<div class="box-confirm">
								<?php if($gc->buken_mansion_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_mansion_flg_str)?></span><?php } ?>
								<?php if($gc->buken_kodate_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_kodate_flg_str)?></span><?php } ?>
								<?php if($gc->buken_ittou_flg == 1){ ?><span class="mr10"><?php echo f_hsc($gc->buken_ittou_flg_str)?></span><?php } ?>
							</div>
						</div>

 						<div class="box-field">
							<label>表示方法</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->display_flg_str)?>
							</div>
						</div>

						<div class="box-field">
							<label>サービス選択</label>
							<div class="box-confirm">
								<span class="mr10"><?php if($gc->chintai_flg == 1){ echo f_hsc($gc->chintai_flg_str).":".f_hsc($gc->chintai_ritu);}?></span>
								<span class="mr10"><?php if($gc->sublease_flg == 1){ echo f_hsc($gc->sublease_flg_str).":".f_hsc($gc->sublease_ritu);}?></span>
								<span class="mr10"><?php if($gc->relocation_flg == 1){ echo f_hsc($gc->relocation_flg_str).":".f_hsc($gc->relocation_ritu);}?></span>
							</div>
						</div>

						<div class="box-field">
							<label>プラン</label>
							<div class="box-confirm">
								<?php echo fsel_get_plan($gc,$gc->plan_flg,true)?>
							</div>
						</div>

						<div class="box-field">
							<label>ライトプラン出現率</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->light_ritu)?>
							</div>
						</div>

						<div class="box-field">
							<label>担当者</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->tantou)?>
							</div>
						</div>

						<div class="box-field">
							<label>TEL</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->tel)?>
							</div>
						</div>

						<div class="box-field">
							<label>FAX</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->fax)?>
							</div>
						</div>

						<div class="box-field">
							<label>E-mail</label>
							<div class="box-confirm">
								01: <?php echo f_hsc($gc->e_mail)?><br />
								02: <?php echo f_hsc($gc->e_mail_2)?><br />
								03: <?php echo f_hsc($gc->e_mail_3)?><br />
								04: <?php echo f_hsc($gc->e_mail_4)?><br />
								05: <?php echo f_hsc($gc->e_mail_5)?><br />
								06: <?php echo f_hsc($gc->e_mail_6)?><br />
								07: <?php echo f_hsc($gc->e_mail_7)?><br />
								08: <?php echo f_hsc($gc->e_mail_8)?><br />
								09: <?php echo f_hsc($gc->e_mail_9)?><br />
								10: <?php echo f_hsc($gc->e_mail_10)?><br />
							</div>
						</div>

						<div class="box-field">
							<label>URL</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->url)?>
							</div>
						</div>

						<div class="box-field">
							<label>所在地</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->zip)?><br />
								<?php echo fsel_get_todoufuken($gc, $gc->todoufuken_no, true) ?><br />
								<?php echo f_hsc($gc->add1)?><br />
								<?php echo f_hsc($gc->add2)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求先住所</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_zip)?><br />
								<?php echo fsel_get_todoufuken($gc, $gc->sk_todoufuken_no, true) ?><br />
								<?php echo f_hsc($gc->sk_add1)?><br />
								<?php echo f_hsc($gc->sk_add2)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求事業所名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_jigyoubu)?>
							</div>
						</div>

						<div class="box-field">
							<label>請求担当者名</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->sk_tantou)?>
							</div>
						</div>

						<div class="box-field">
							<label>固定金額</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->kingaku_kotei)?>
							</div>
							<label>ライトプラン金額</label>
							<div class="box-confirm">
<?php if($gc->light_flg == "1"){ ?>
								<?php echo f_hsc($gc->kingaku_light)?>
<?php }else{ ?>
								- (エリア毎に設定した金額を適用する)
<?php } ?>

							</div>
							<label>月の利用限度額</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->jyougen)?>
							</div>
						</div>
<!--
						<div class="box-field">
							<label>出現率</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->kakuritsu)?>
							</div>
						</div>
 -->
						<div class="box-field">
							<label>ロゴ画像</label>
							<div class="box-confirm">
<?php if(file_exists(C_IMG_PATH."logo/".$gc->company_no)){ ?>
							<img src="<?php echo C_IMG_ROOT_URL."logo/".$gc->company_no ?>" alt="" width="200">
<?php } ?>
							<label><?php echo f_hsc($gc->company_nm)?></label>
							<label>コメント欄</label>
							<textarea name="comment" class="field" cols=50 rows= 4  readonly><?php echo $gc->comment?></textarea><br>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_logo_flg_str)?>
							</div>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_comment_flg_str)?>
							</div>
							</div>
						</div>

						<div class="box-field">
							<label>掲載</label>
							<div class="box-confirm">
								<?php echo f_hsc($gc->keisai_flg_str)?>
							</div>
						</div>

					</div>
					<!-- End Form -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="ac">
							<button type="button" class="button color green" onclick="run_submit('form_data', 'edit')">基本情報を編集</button>
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>




				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>対応エリア</b></h2>
						<div class="right">
							&nbsp;
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Accordion -->
					<div class="Accordion" style="padding:15px 10px;">

						<!-- Accordion -->
						<div class="ui-accordion ui-widget ui-helper-reset">

<?php

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " t.todoufuken_no,";
	$sql.= " t.todoufuken_nm ";
	$sql.= "FROM";
	$sql.= " m_todoufuken t ";
	$sql.= "INNER JOIN";
	$sql.= " (";
	$sql.= " SELECT";
	$sql.= "  s.todoufuken_no";
	$sql.= " FROM";
	$sql.= "  m_company_area a";
	$sql.= " INNER JOIN";
	$sql.= "  m_shikucyouson s";
	$sql.= " ON";
	$sql.= "  a.shikucyouson_no = s.shikucyouson_no";
	$sql.= " WHERE";
	$sql.= "  a.company_no = ".$gc->company_no;
	$sql.= " GROUP BY";
	$sql.= "  s.todoufuken_no";
	$sql.= " ) c ";
	$sql.= "ON";
	$sql.= " t.todoufuken_no = c.todoufuken_no ";
	$sql.= "ORDER BY";
	$sql.= " t.sort_no";

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	$i = 0;

	while ($rs->eof==false) {

		$todoufuken_no = $rs->fields["todoufuken_no"];
		$todoufuken_nm = $rs->fields["todoufuken_nm"];

?>
		<div class="group">
			<h3 panelmode="close" todoufuken_no="<?php echo f_hsc($todoufuken_no) ?>" class="ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all">
				<span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-e"></span>
				<?php echo f_hsc($todoufuken_nm) ?></h3>
			<div style="display: none;" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
				&nbsp;
			</div>
		</div>
<?php

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<div class=\"ac\">";
		echo "対応エリアは未登録です。";
		echo "</div>";
	}

?>

						</div>

					</div>
					<!-- Accordion -->

					<!-- Form Buttons -->
					<div class="buttons">
						<div class="ac">
							<button type="button" class="button color green" onclick="run_submit('form_area', 'edit')">対応エリアを編集</button>
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	$gc->company_sh = $_GET["company_sh"];
	$gc->todoufuken_no = $_GET["todoufuken_no"];
	$gc->company_no = $_GET["company_no"];
	$gc->company_kbn = $_GET["company_kbn"];
	$gc->relocation_flg = $_GET["relocation_flg"];

	$arr_todoufuken = fsel_get_arr_todoufuken($gc);

	$arr_company_kbn = fdiv_set_company_kbn_array();

	//ラジオボタン設定
	fdiv_set_company_kbn_radio($gc, $gc->company_kbn, "company_kbn");

	//チェックボックス設定
	fdiv_set_checkbox($gc, "リロケーション", ($gc->relocation_flg=="1"), "relocation_flg");

	if(is_numeric($gc->company_no)){
		$gc->joken_company_nm = fdb_get_name($gc, "m_company", "company_nm", "company_no", $gc->company_no);
	}
	if($gc->joken_company_nm==""){
		$gc->joken_company_nm = "指定なし";
	}

	if($gc->company_sh==""){
		$gc->joken_company_sh = "指定なし";
	}else{
		$gc->joken_company_sh = $gc->company_sh;
	}

	if(is_numeric($gc->todoufuken_no)){
		$gc->joken_todoufuken_nm = $arr_todoufuken[$gc->todoufuken_no];
	}
	if($gc->joken_todoufuken_nm==""){
		$gc->joken_todoufuken_nm = "指定なし";
	}

	if($gc->relocation_flg=="1"){
		$gc->joken_relocation_flg_nm = "あり";
	}else{
		$gc->joken_relocation_flg_nm = "指定なし";
	}

	if(is_numeric($gc->company_kbn)){
		if($gc->company_kbn > 0){
			$gc->joken_company_kbn_nm = $arr_company_kbn[$gc->company_kbn];
		}else{
			$gc->joken_company_kbn_nm = "全て";
		}
	}else{
		$gc->joken_company_kbn_nm = "指定なし";
	}

	//ベースSQLの作成
	$base_sql = sql_text_create_l($gc);

	//手数料合計の取得
/*
	$sql = "SELECT";
	$sql.= " COALESCE(rl.sum_tesuryou, 0) AS sum_tesuryou_l,";
	$sql.= " COALESCE(rs.sum_tesuryou, 0) AS sum_tesuryou_s,";
	$sql.= " COALESCE(ra.sum_tesuryou, 0) AS sum_tesuryou_a,";
	$sql.= " COALESCE(rb.sum_tesuryou, 0) AS sum_tesuryou_b,";
	$sql.= " COALESCE(rc.sum_tesuryou, 0) AS sum_tesuryou_c ";
	$sql.= $base_sql;

	$rs = $gc->db->query($sql);

	$gc->sum_tesuryou = 0;

	while ($rs->eof==false) {

		$sum_tesuryou_l = $rs->fields["sum_tesuryou_l"];
		$sum_tesuryou_s = $rs->fields["sum_tesuryou_s"];
		$sum_tesuryou_a = $rs->fields["sum_tesuryou_a"];
		$sum_tesuryou_b = $rs->fields["sum_tesuryou_b"];
		$sum_tesuryou_c = $rs->fields["sum_tesuryou_c"];

		$gc->sum_tesuryou += $sum_tesuryou_l + $sum_tesuryou_s + $sum_tesuryou_a + $sum_tesuryou_b + $sum_tesuryou_c;

		$rs->move_next();

	}
	$rs->free_result();
	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " mc.company_no,";
	$sql.= " mc.company_nm,";
	$sql.= " mc.company_kn,";
	$sql.= " mc.company_sh,";
	$sql.= " mc.company_kbn,";
	$sql.= " mc.todoufuken_no,";
	$sql.= " mc.add1,";
	$sql.= " mc.jyougen,";
	$sql.= " COALESCE(rl.cnt_rank, 0) AS cnt_rank_l,";
	$sql.= " COALESCE(rl.sum_tesuryou, 0) AS sum_tesuryou_l,";
	$sql.= " COALESCE(rs.cnt_rank, 0) AS cnt_rank_s,";
	$sql.= " COALESCE(rs.sum_tesuryou, 0) AS sum_tesuryou_s,";
	$sql.= " COALESCE(ra.cnt_rank, 0) AS cnt_rank_a,";
	$sql.= " COALESCE(ra.sum_tesuryou, 0) AS sum_tesuryou_a,";
	$sql.= " COALESCE(rb.cnt_rank, 0) AS cnt_rank_b,";
	$sql.= " COALESCE(rb.sum_tesuryou, 0) AS sum_tesuryou_b,";
	$sql.= " COALESCE(rc.cnt_rank, 0) AS cnt_rank_c,";
	$sql.= " COALESCE(rc.sum_tesuryou, 0) AS sum_tesuryou_c ";
	$sql.= $base_sql;
*/
	$sql= $base_sql;

	$sql.= " ORDER BY";

	switch($_GET["si"]) {
	case "ckn":
		$sql.= " c.company_kn".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "kbn":
		$sql.= " c.company_kbn".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "tod":
		$sql.= " c.todoufuken_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "crl":
		$sql.= " sr_l".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "crs":
		$sql.= " sr_1".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "cra":
		$sql.= " sr_2".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "crb":
		$sql.= " sr_3".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "crc":
		$sql.= " sr_4".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "tes":
		$sql.= " s_t".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "jog":
		$sql.= " c.jyougen".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	default:
		$sql.= " c.company_no ";
	}

	$rs = $gc->db->query($sql);
	while ($rs->eof==false) {
		$gc->sum_tesuryou += $rs->fields["s_t"];
		$rs->move_next();
	}
	$rs->free_result();

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);
	$row_count = $gc->db->get_row_count();


	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("tesuryo_l.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["ckn"] = "";
	$sort_mode["kbn"] = "";
	$sort_mode["tod"] = "";
	$sort_mode["crl"] = "";
	$sort_mode["crs"] = "";
	$sort_mode["cra"] = "";
	$sort_mode["crb"] = "";
	$sort_mode["crc"] = "";
	$sort_mode["tes"] = "";
	$sort_mode["jog"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>手数料一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
function search_run(){
	var o;
	o = document.getElementById('mbif_y');
	var mbif_y = o.options[ o.selectedIndex ].value;
	o = document.getElementById('mbif_m');
	var mbif_m = o.options[ o.selectedIndex ].value;
	o = document.getElementById('mbif_d');
	var mbif_d = o.options[ o.selectedIndex ].value;
	o = document.getElementById('mbit_y');
	var mbit_y = o.options[ o.selectedIndex ].value;
	o = document.getElementById('mbit_m');
	var mbit_m = o.options[ o.selectedIndex ].value;
	o = document.getElementById('mbit_d');
	var mbit_d = o.options[ o.selectedIndex ].value;
	document.forms['form_search'].mbif.value = mbif_y + mbif_m + mbif_d;
	document.forms['form_search'].mbit.value = mbit_y + mbit_m + mbit_d;
	run_submit('form_search', 'search');
}
// -->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 5) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="tesuryo_l.php">手数料管理</a>
			<span>&gt;</span>
			手数料一覧
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Form -->
					<div class="form">

						<form name="form_search" action="tesuryo_l.php" method="get" onsubmit="return false">
							<input name="mode" type="hidden" value="">
							<input name="mbif" type="hidden" value="">
							<input name="mbit" type="hidden" value="">

							<div class="box-size4 left">
								<p class="inline-field">
									<label style="display:inline;">集計期間:</label>
									<select id="mbif_y" class="field">
										<?php echo fsel_get_date_y($gc, $gc->mbif_y) ?>
									</select><span class="ml05">年</span>
									<select id="mbif_m" class="field">
										<?php echo fsel_get_date_m($gc, $gc->mbif_m) ?>
									</select><span class="ml05">月</span>
									<select id="mbif_d" class="field">
										<?php echo fsel_get_date_d($gc, $gc->mbif_d) ?>
									</select><span class="ml05">日</span>
									~
									<select id="mbit_y" class="field">
										<?php echo fsel_get_date_y($gc, $gc->mbit_y) ?>
									</select><span class="ml05">年</span>
									<select id="mbit_m" class="field">
										<?php echo fsel_get_date_m($gc, $gc->mbit_m) ?>
									</select><span class="ml05">月</span>
									<select id="mbit_d" class="field">
										<?php echo fsel_get_date_d($gc, $gc->mbit_d) ?>
									</select><span class="ml05">日</span>

									<label class="ml20" style="display:inline;">区分:</label>
									<input id="company_kbn_0" type="radio" name="company_kbn" value="0"<?php echo $gc->company_kbn_0_checked ?> />
									<label class="mr10" for="company_kbn_0" style="display:inline;font-weight: normal;">全て</label>
									<input id="company_kbn_1" type="radio" name="company_kbn" value="1"<?php echo $gc->company_kbn_1_checked ?> />
									<label class="mr10" for="company_kbn_1" style="display:inline;font-weight: normal;">大手</label>
									<input id="company_kbn_2" type="radio" name="company_kbn" value="2"<?php echo $gc->company_kbn_2_checked ?> />
									<label class="mr10" for="company_kbn_2" style="display:inline;font-weight: normal;">地場</label>

								</p>
							</div>

							<div class="box-size4 left">
								<p class="inline-field">
									<label style="display:inline;">提携会社:</label>
									<select name="company_no" class="field">
										<option value=""></option>
										<?php echo fsel_get_company($gc, $gc->company_no) ?>
									</select>

									<label class="ml05" style="display:inline;">支店名:</label>
									<input name="company_sh" type="text" class="field size2" value="<?php echo f_hsc($gc->company_sh)?>" />

									<label class="ml05" style="display:inline;">所在地:</label>
									<select name="todoufuken_no" class="field">
										<option value=""></option>
										<?php echo fsel_get_todoufuken($gc, $gc->todoufuken_no) ?>
									</select>

									<label class="ml15" style="display:inline;">
										<input type="checkbox" name="relocation_flg" id="relocation_flg" value="1"<?php echo $gc->relocation_flg_checked?>>
										<span style="color:#000;">リロケーション</span>
									</label>

									<button type="button" class="button color silver ml30" onclick="search_run();">検索</button>
								</p>
							</div>

							<div class="cl">&nbsp;</div>

						</form>

					</div>
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">抽出条件・手数料合計</h2>
						<div class="right">
							<div class="cl">&nbsp;</div>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Form -->
					<div class="form">

						<div class="box-size4 left">
							<p class="inline-field">
								<label style="display:inline;">集計期間:</label>
								<?php echo substr($gc->mbif, 0, 4) ?>年<?php echo substr($gc->mbif, 4, 2) ?>月<?php echo substr($gc->mbif, 6, 2) ?>日
								~
								<?php echo substr($gc->mbit, 0, 4) ?>年<?php echo substr($gc->mbit, 4, 2) ?>月<?php echo substr($gc->mbit, 6, 2) ?>日
								<label class="ml20" style="display:inline;">区分:</label>
								<?php echo f_hsc($gc->joken_company_kbn_nm) ?>
							</p>
						</div>
						<div class="box-size4 left">
							<p class="inline-field">
								<label style="display:inline;">提携会社:</label>
								<?php echo f_hsc($gc->joken_company_nm) ?>
								<label class="ml20" style="display:inline;">支店名:</label>
								<?php echo f_hsc($gc->joken_company_sh) ?>
								<label class="ml20" style="display:inline;">所在地:</label>
								<?php echo f_hsc($gc->joken_todoufuken_nm) ?>
								<label class="ml20" style="display:inline;">リロケーション:</label>
								<?php echo f_hsc($gc->joken_relocation_flg_nm) ?>
							</p>
						</div>

						<div style="float:right;">
							<label class="ml40" style="display:inline;">手数料合計:</label>
							<?php echo number_format($gc->sum_tesuryou) ?>円
						</div>

						<div class="cl">&nbsp;</div>

					</div>
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">手数料一覧</h2>
						<div class="right">
							<a href="tesuryo_excel.php?mode=1&mbif=<?php echo f_hsc($gc->mbif) ?>&mbit=<?php echo f_hsc($gc->mbit) ?>&todoufuken_no=<?php echo f_hsc($gc->todoufuken_no) ?>&company_no=<?php echo f_hsc($gc->company_no) ?>&company_kbn=<?php echo f_hsc($gc->company_kbn) ?>&relocation_flg=<?php echo f_hsc($gc->relocation_flg) ?>&company_sh=<?php echo urlencode($gc->company_sh) ?>" class="custom-button" style="margin-right:15px;"><span>請求書出力</span></a>
							<a href="tesuryo_csv.php?mode=1&mbif=<?php echo f_hsc($gc->mbif) ?>&mbit=<?php echo f_hsc($gc->mbit) ?>&todoufuken_no=<?php echo f_hsc($gc->todoufuken_no) ?>&company_no=<?php echo f_hsc($gc->company_no) ?>&company_kbn=<?php echo f_hsc($gc->company_kbn) ?>&relocation_flg=<?php echo f_hsc($gc->relocation_flg) ?>&company_sh=<?php echo urlencode($gc->company_sh) ?>" class="custom-button"><span>CSV出力</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">

								<th width="200" class="ac"><a href="tesuryo_l.php<?php echo f_sq("ckn") ?>">提携会社名</a><?php echo $sort_mode["ckn"] ?></th>
								<th width="40" class="ac"><a href="tesuryo_l.php<?php echo f_sq("kbn") ?>">区分</a><?php echo $sort_mode["kbn"] ?></th>
								<th class="ac"><a href="tesuryo_l.php<?php echo f_sq("tod") ?>">所在地</a><?php echo $sort_mode["tod"] ?></th>
								<th width="44" class="ac"><a href="tesuryo_l.php<?php echo f_sq("crl") ?>">Lプラン</a><?php echo $sort_mode["crl"] ?><br />(件数)</th>
								<th width="44" class="ac"><a href="tesuryo_l.php<?php echo f_sq("crs") ?>">Sランク</a><?php echo $sort_mode["crs"] ?><br />(件数)</th>
								<th width="44" class="ac"><a href="tesuryo_l.php<?php echo f_sq("cra") ?>">Aランク</a><?php echo $sort_mode["cra"] ?><br />(件数)</th>
								<th width="44" class="ac"><a href="tesuryo_l.php<?php echo f_sq("crb") ?>">Bランク</a><?php echo $sort_mode["crb"] ?><br />(件数)</th>
								<th width="44" class="ac"><a href="tesuryo_l.php<?php echo f_sq("crc") ?>">Cランク</a><?php echo $sort_mode["crc"] ?><br />(件数)</th>
								<th width="70" class="ac"><a href="tesuryo_l.php<?php echo f_sq("tes") ?>">手数料</a><?php echo $sort_mode["tes"] ?></th>
								<th width="70" class="ac"><a href="tesuryo_l.php<?php echo f_sq("jog") ?>">上限</a><?php echo $sort_mode["jog"] ?></th>
								<th width="60" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$company_no = $rs->fields["company_no"];
		$company_nm = $rs->fields["company_nm"];
		$company_sh = $rs->fields["company_sh"];
		$company_kbn = $rs->fields["company_kbn"];
		$todoufuken_no = $rs->fields["todoufuken_no"];
		$add1 = $rs->fields["add1"];
		$rank_l = $rs->fields["sr_l"];
		$rank_no1 = $rs->fields["sr_1"];
		$rank_no2 = $rs->fields["sr_2"];
		$rank_no3 = $rs->fields["sr_3"];
		$rank_no4 = $rs->fields["sr_4"];
		$sum_tesuryou_l = $rs->fields["sum_tesuryou_l"];
		$sum_tesuryou_s = $rs->fields["sum_tesuryou_s"];
		$sum_tesuryou_a = $rs->fields["sum_tesuryou_a"];
		$sum_tesuryou_b = $rs->fields["sum_tesuryou_b"];
		$sum_tesuryou_c = $rs->fields["sum_tesuryou_c"];
		$jyougen = $rs->fields["jyougen"];

		$todoufuken_nm = $arr_todoufuken[$todoufuken_no];

		$company_kbn_nm = $arr_company_kbn[$company_kbn];


		$tesuryou =$rs->fields["s_t"];
//		$tesuryou =$sum_tesuryou_l + $sum_tesuryou_s + $sum_tesuryou_a + $sum_tesuryou_b + $sum_tesuryou_c;

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td>".f_hsc($company_nm)."<br />".f_hsc($company_sh)."</td>";
		echo "<td class=\"ac\">".f_hsc($company_kbn_nm)."</td>";
		echo "<td>".f_hsc($todoufuken_nm.$add1)."</td>";
		echo "<td class=\"ac\">".f_hsc($rank_l)."</td>";
		echo "<td class=\"ac\">".f_hsc($rank_no1)."</td>";
		echo "<td class=\"ac\">".f_hsc($rank_no2)."</td>";
		echo "<td class=\"ac\">".f_hsc($rank_no3)."</td>";
		echo "<td class=\"ac\">".f_hsc($rank_no4)."</td>";
		echo "<td class=\"ar\">".f_hsc(number_format($tesuryou))."</td>";
		echo "<td class=\"ar\">".f_hsc(number_format($jyougen))."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='tesuryo_d.php?company_no=".$company_no."&mbif=".$gc->mbif."&mbit=".$gc->mbit."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"10\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>

						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>対応エリア編集</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<style>
/* IEでソートするときの対応 */
.group { zoom: 1 }
</style>
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script>
$(function() {

	$('.group h3').click(function(){

		if( $(this).attr("panelmode") == "open" ){

			//閉じる処理

			$(this).attr("panelmode", "close");

			$(this).removeClass("ui-accordion-header-active");
			$(this).removeClass("ui-state-active");
			$(this).removeClass("ui-corner-top");
			$(this).addClass("ui-corner-all");

			$('span', this).removeClass("ui-icon-triangle-1-s");
			$('span', this).addClass("ui-icon-triangle-1-e");

			$('+div', this).removeClass("ui-accordion-content-active");

			$('+div:not(:animated)',this).slideUp('normal');

		}else{

			//開く処理

			get_area($('+div', this), $(this).attr("todoufuken_no"));

			$(this).attr("panelmode", "open");

			$(this).removeClass("ui-corner-all");
			$(this).addClass("ui-accordion-header-active");
			$(this).addClass("ui-state-active");
			$(this).addClass("ui-corner-top");

			$('span', this).removeClass("ui-icon-triangle-1-e");
			$('span', this).addClass("ui-icon-triangle-1-s");

			$('+div', this).addClass("ui-accordion-content-active");

			var d = {height:'toggle', opacity:'toggle'};
			$('+div',this).animate(d);

		}

	});

});

//ランクの変更
function rank_change(o){

	var selectedItem = o.options[ o.selectedIndex ];

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=rank";
	query += "&shikucyouson_no=" + $(o).attr("shikucyouson_no");
	query += "&rank_no=" + selectedItem.value;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}

function get_area(pnl, todoufuken_no){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=company_area_e";
	query += "&company_no=" + company_no;
	query += "&todoufuken_no=" + todoufuken_no;

	$.ajax({
		type: "POST",
		url: "get_area.php",
		dataType: "html",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				pnl.empty();
				pnl.html(XMLHttpRequest.responseText);
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
function set_area_all(todoufuken_no, act){
	todoufuken_chk(todoufuken_no, act);
	if(act == 1){
		$(".chk_todoufuken_no" + todoufuken_no).attr("checked", true );
		$(".txt_todoufuken_no" + todoufuken_no).val("0");
		$(".txt_todoufuken_no" + todoufuken_no).text("0");
	}else{
		$(".chk_todoufuken_no" + todoufuken_no).attr("checked", false);
		$(".txt_todoufuken_no" + todoufuken_no).val("");
		$(".txt_todoufuken_no" + todoufuken_no).text("");
	}
}
function set_area(o){
	var act = 0;
	if($(o).attr("checked") == "checked"){
		act = 1;
	}
	shikucyouson_chk($(o).val(), act);
}
//すべてにチェック関連の登録
function todoufuken_chk(todoufuken_no, act){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=todoufuken_chk";
	query += "&company_no=" + company_no;
	query += "&todoufuken_no=" + todoufuken_no;
	query += "&act=" + act;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
//市区町村チェック関連の登録
function shikucyouson_chk(shikucyouson_no, act){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=shikucyouson_chk";
	query += "&company_no=" + company_no;
	query += "&shikucyouson_no=" + shikucyouson_no;
	query += "&act=" + act;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

	if(act == 1){
		$("#shikucyouson_kingaku" + shikucyouson_no).val("0");
		$("#shikucyouson_kingaku" + shikucyouson_no).text("0");
	}else{
		$("#shikucyouson_kingaku" + shikucyouson_no).val("");
		$("#shikucyouson_kingaku" + shikucyouson_no).text("");
	}

}

//市区町村金額の登録
function shikucyouson_kingaku_upd(shikucyouson_no){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();
	var shikucyouson_kingaku = $("#shikucyouson_kingaku" + shikucyouson_no).val();

	var query = "time=" + timestamp;
	query += "&mode=shikucyouson_kingaku_upd";
	query += "&company_no=" + company_no;
	query += "&shikucyouson_no=" + shikucyouson_no;
	query += "&shikucyouson_kingaku=" + shikucyouson_kingaku;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}

<!--
//市区町村確率の登録
function shikucyouson_ritu_upd(shikucyouson_no){

	var company_no = <?php echo $gc->company_no ?>;

	var date = new Date();
	var timestamp = date.getTime();
	var shikucyouson_ritu = $("#shikucyouson_ritu" + shikucyouson_no).val();

	var query = "time=" + timestamp;
	query += "&mode=shikucyouson_ritu_upd";
	query += "&company_no=" + company_no;
	query += "&shikucyouson_no=" + shikucyouson_no;
	query += "&shikucyouson_ritu=" + shikucyouson_ritu;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}
-->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 2) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="company_l.php">提携会社管理</a>
			<span>&gt;</span>
			<a href="company_l.php">提携会社一覧</a>
			<span>&gt;</span>
			<a href="company_r.php?company_no=<?php echo $gc->company_no ?>">詳細</a>
			<span>&gt;</span>
			対応エリア編集
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->

					<div class="box-head">

						<div class="left">
						<h2 class="left"><b>対応エリア編集 <?php echo $gc->company_nm ?></b></h2>
							<div class="cl">&nbsp;</div>
						</div>

						<div class="right">
							<a href="company_area_csv.php?company_no=<?php echo $gc->company_no ?>" class="custom-button" style="margin-right:10px;"><span>データエクスポート</span></a>
							<a href="company_area_insert.php?company_no=<?php echo $gc->company_no ?>" class="add-button"><span>データインポート</span></a>
							<div class="cl">&nbsp;</div>
						</div>
					</div>

					<!-- End Box Head -->

					<!-- Accordion -->
					<div class="Accordion" style="padding:15px 10px;">

						<!-- Accordion -->
						<div class="ui-accordion ui-widget ui-helper-reset">

<?php

	$sql = "SELECT";
	$sql.= " t.todoufuken_no,";
	$sql.= " t.todoufuken_nm ";
	$sql.= "FROM";
	$sql.= " m_todoufuken t ";
	$sql.= "INNER JOIN";
	$sql.= " (";
	$sql.= " SELECT";
	$sql.= "  todoufuken_no";
	$sql.= " FROM";
	$sql.= "  m_shikucyouson";
	$sql.= " WHERE";
	$sql.= "  rank_no > 0";
	$sql.= " GROUP BY";
	$sql.= "  todoufuken_no";
	$sql.= " ) s ";
	$sql.= "ON";
	$sql.= " s.todoufuken_no = t.todoufuken_no ";
	$sql.= "ORDER BY";
	$sql.= " t.sort_no";

	$rs = $gc->db->query($sql);

	$i = 0;

	while ($rs->eof==false) {

		$todoufuken_no = $rs->fields["todoufuken_no"];
		$todoufuken_nm = $rs->fields["todoufuken_nm"];

?>
		<div class="group">
			<h3 panelmode="close" todoufuken_no="<?php echo f_hsc($todoufuken_no) ?>" class="ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all">
				<span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-e"></span>
				<?php echo f_hsc($todoufuken_nm) ?></h3>
			<div style="display: none;" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
				&nbsp;
			</div>
		</div>
<?php

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

?>

						</div>

					</div>
					<!-- Accordion -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	$gc->arr_todoufuken = fsel_get_arr_todoufuken($gc);

	$gc->company_kbn = $_GET["company_kbn"];

	//ラジオボタン設定
	fdiv_set_company_kbn_radio($gc, $gc->company_kbn, "company_kbn");

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " company_no,";
	$sql.= " company_nm,";
	$sql.= " company_sh,";
	$sql.= " company_kbn,";
	$sql.= " todoufuken_no,";
	$sql.= " add1,";
	$sql.= " tel,";
	$sql.= " tantou,";

	$sql.= " keisai_flg,";

	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " m_company ";
	$sql.= "WHERE 0 = 0 ";

	switch ($gc->company_kbn) {
	case 1://大手
		$sql.= "AND company_kbn = 1 ";

		break;
	case 2://地場
		$sql.= "AND company_kbn = 2 ";

		break;

	default:

	}

	$sql.= "ORDER BY";

	switch($_GET["si"]) {
	case "company_kn":
		$sql.= " company_kn".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	case "company_kbn":
		$sql.= " company_kbn".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	case "syozaichi":
		$sql.= " CONCAT( LPAD(COALESCE(todoufuken_no,'0'), 3, '0'), COALESCE(add1,''), COALESCE(add2,''))".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	case "tantou":
		$sql.= " tantou".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	case "tel":
		$sql.= " tel".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	case "keisai_flg":
		$sql.= " keisai_flg".(($_GET["sa"]=="desc") ? " DESC" : "").", company_no ";
		break;
	default:
		$sql.= " company_no ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("company_l.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["company_kn"] = "";
	$sort_mode["company_kbn"] = "";
	$sort_mode["syozaichi"] = "";
	$sort_mode["tantou"] = "";
	$sort_mode["tel"] = "";
	$sort_mode["keisai_flg"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

	$arr_company_kbn = fdiv_set_company_kbn_array();

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>提携会社一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
$(function() {
	$("input").focus( function () { this.blur(); } );
	$('input[name="company_kbn"]:radio').change( function() {
		run_submit("form_search", "search");
	});
});
// -->
</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 2) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="company_l.php">提携会社管理</a>
			<span>&gt;</span>
			提携会社一覧
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Form -->
<!--					<div class="form">

						<form name="form_search" action="company_l.php" method="get" onsubmit="return false">
							<input name="mode" type="hidden" value="">

							<div class="box-size2 left">
								<p class="inline-field">
									<label style="display:inline;">表示形式:</label>
									<input id="company_kbn_0" type="radio" name="company_kbn" value="0"<?php //echo $gc->company_kbn_0_checked ?> />
									<label class="mr10" for="company_kbn_0" style="display:inline;font-weight: normal;">全て</label>
									<input id="company_kbn_1" type="radio" name="company_kbn" value="1"<?php //echo $gc->company_kbn_1_checked ?> />
									<label class="mr10" for="company_kbn_1" style="display:inline;font-weight: normal;">大手のみ</label>
									<input id="company_kbn_2" type="radio" name="company_kbn" value="2"<?php //echo $gc->company_kbn_2_checked ?> />
									<label class="mr10" for="company_kbn_2" style="display:inline;font-weight: normal;">地場のみ</label>
								</p>
							</div>

							<div class="cl">&nbsp;</div>

						</form>

					</div>  -->
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">

						<div class="left">
						<h2 class="left"><b>提携会社一覧</b></h2>
							<div class="cl">&nbsp;</div>
						</div>

						<div class="right">
							<a href="company_area_csv.php" class="custom-button" style="margin-right:10px;"><span>エリア金額一括エクスポート</span></a>
							<a href="company_area_insert.php" class="custom-button" style="margin-right:50px;"><span>エリア金額一括インポート</span></a>
							<a href="company_e.php?mode=add" class="add-button"><span>新規追加</span></a>
							<div class="cl">&nbsp;</div>
						</div>
					</div>


					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th><a href="company_l.php<?php echo f_sq("company_kn") ?>">企業名</a><?php echo $sort_mode["company_kn"] ?></th>
								<!--  <th width="40" class="ac"><a href="company_l.php<?php //echo f_sq("company_kbn") ?>">区分</a><?php //echo $sort_mode["company_kbn"] ?></th>-->
								<th width="150"><a href="company_l.php<?php echo f_sq("syozaichi") ?>">所在地</a><?php echo $sort_mode["syozaichi"] ?></th>
								<th width="120" class="ac"><a href="company_l.php<?php echo f_sq("tantou") ?>">担当者名</a><?php echo $sort_mode["tantou"] ?></th>
								<th width="120" class="ac"><a href="company_l.php<?php echo f_sq("tel") ?>">電話番号</a><?php echo $sort_mode["tel"] ?></th>
								<th width="40" class="ac"><a href="company_l.php<?php echo f_sq("keisai_flg") ?>">掲載</a><?php echo $sort_mode["keisai_flg"] ?></th>
								<th width="70" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$company_no = $rs->fields["company_no"];
		$company_nm = $rs->fields["company_nm"];
		$company_sh = $rs->fields["company_sh"];
		$company_kbn = $rs->fields["company_kbn"];
		$todoufuken_no = $rs->fields["todoufuken_no"];
		$add1 = $rs->fields["add1"];
		$tel = $rs->fields["tel"];
		$tantou = $rs->fields["tantou"];
		$keisai_flg = $rs->fields["keisai_flg"];

		$todoufuken_nm = $gc->arr_todoufuken[$todoufuken_no];

		$company_kbn_nm = $arr_company_kbn[$company_kbn];

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td>".f_hsc($company_nm." ".$company_sh)."</td>";
		//echo "<td class=\"ac\">".f_hsc($company_kbn_nm)."</td>";
		echo "<td>".f_hsc($todoufuken_nm.$add1)."</td>";
		echo "<td class=\"ac\">".f_hsc($tantou)."</td>";
		echo "<td class=\"ac\">".f_hsc($tel)."</td>";
		echo "<td class=\"ac\">".f_hsc( ($keisai_flg==1?"○":"×") )."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='company_r.php?company_no=".$company_no."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"7\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>
						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	if($gc->form_mode == "confirm"){
		if($gc->act == "i"){
			$gc->mode_title = "[追加・確認]";
		}else{
			$gc->mode_title = "[編集・確認]";
		}
	}elseif($gc->form_mode == "message"){
		$gc->mode_title = "[完了]";
	}else{
		if($gc->act == "i"){
			$gc->mode_title = "[追加]";
		}else{
			$gc->mode_title = "[編集]";
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>詳細<?php echo f_hsc($gc->mode_title)?></title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">


	<!-- スマートフォン向けviewportの指定 -->
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<!-- Google Maps APIの読み込み -->
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">
<!--
/* 地図オブジェクト */
var map;
/* ストリートビューパノラマオブジェクト */
var svp;
/* 初期設定 */
function initialize() {
	var x = $("#lat").val();
	var y = $("#lon").val();
	var d = parseFloat($('#direction').val());
	var p = parseFloat($('#pitch').val());
	var z = parseFloat($('#zoom').val());

	var obj=document.getElementById("map");
	/* 緯度・経度:日本, 表参道駅(東京)*/
	var latlng=new google.maps.LatLng(x, y);
		/* 地図のオプション設定 */
	var myOptions = {
		/*初期のズーム レベル */
		zoom: 16,
		/* 地図の中心点 */
		center:latlng,
		/* 地図タイプ */
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};

	map=new google.maps.Map(obj, myOptions);
	svp=new google.maps.StreetViewPanorama(
		obj,{
			position : map.getCenter(),
            addressControl:false
		});
	svp.setPov({heading:d, pitch:p, zoom:z});
	map.setStreetView(svp);
	google.maps.event.addListener(svp, 'tilesloaded', review);
	google.maps.event.addListener(svp, 'position_changed', review);
	google.maps.event.addListener(svp, 'pov_changed', review);
}

function review(){
	var pov=svp.getPov();
    var _heading=pov["heading"];
    var _pitch=pov["pitch"];
	var _zoom=pov["zoom"];
	$("#lat").val(svp.getPosition().lat());
	$("#lon").val(svp.getPosition().lng());
	$("#direction").val(pov["heading"]);
	$("#pitch").val(pov["pitch"]);
	$("#zoom").val(pov["zoom"]);
    document.getElementById("res").innerHTML=svp.getPosition();
    document.getElementById("res2").innerHTML=_heading;
    document.getElementById("res3").innerHTML=_pitch;
    document.getElementById("res4").innerHTML=_zoom;
}
/* ロード時に初期化 */
google.maps.event.addDomListener(window, 'load', initialize);

</script>

<script>
$(function(){

	// メッセージDialog
	$('#dialog_message').dialog({
		autoOpen: false,
		resizable: false,
		modal: true,
		width: 350,
		height: 150,
		buttons: {
			"OK": function() {
				run_submit('form_edit','itemdel')
			},
			"キャンセル": function() {
				$(this).dialog("close");
			}
		}
	});


});

function itemdel(no){

	$("#no").val(no);
	$('#dlg_msg_str').text( "削除よろしいですか?" );
	$('#dialog_message').dialog('open');
}

var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 6) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">簡易査定</a>
			<span>&gt;</span>
			<a href="./buken_area_list.php">登録エリア一覧</a>
			<span>&gt;</span>
			<a href="./buken_list.php?shikucyouson_no=<?php echo $gc->shikucyouson_no?>"><?php echo f_hsc($gc->todoufuken_nm." ".$gc->shikucyouson_nm)?></a>
			<span>&gt;</span>
			<?php echo f_hsc($gc->property_nm)?> 詳細<?php echo f_hsc($gc->mode_title)?>
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

<?php
	if($gc->form_mode=="confirm"){
?>

				<form name="form_data" action="bukendetail.php" method="POST" onsubmit="return false">
					<input name="mode" type="hidden" value="">
					<input name="act" type="hidden" value="<?php echo $gc->act?>">
					<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>">
					<input name="property_no" type="hidden" value="<?php echo f_hsc($gc->property_no)?>" />
					<input name="todoufuken_nm" type="hidden" value="<?php echo f_hsc($gc->todoufuken_nm)?>" />
					<input name="shikucyouson_nm" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_nm)?>" />
					<input name="shikucyouson_no" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_no)?>" />
					<input name="property_nm" type="hidden" value="<?php echo f_hsc($gc->property_nm)?>" />
					<input name="comment" type="hidden" value="<?php echo f_hsc($gc->comment)?>" />
					<input name="lat" id="lat" type="hidden" value="<?php echo f_hsc($gc->lat)?>" />
					<input name="lon" id="lon" type="hidden" value="<?php echo f_hsc($gc->lon)?>" />
					<input name="direction" id="direction" type="hidden" value="<?php echo f_hsc($gc->direction)?>" />
					<input name="pitch" id="pitch" type="hidden" value="<?php echo f_hsc($gc->pitch)?>" />
					<input name="zoom" id="zoom" type="hidden" value="<?php echo f_hsc($gc->zoom)?>" />
				</form>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;次の内容でよろしいですか?</strong></p>
				</div>
				<!-- End Message OK -->

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2><?php echo f_hsc($gc->property_nm)."詳細"?></h2>
					</div>
					<!-- End Box Head -->

					<div class="table">

							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<th class="al">住所</th>
									<th width="100" class="al">沿線</th>
									<th width="90" class="al">駅名</th>
									<th width="100" class="al">建物構造</th>
									<th width="80" class="ac">地上階層</th>
									<th width="80" class="ac">地下階層</th>
									<th width="70" class="ac">賃料</th>
									<th width="70" class="ac">㎡単価</th>
								</tr>
							<?php

							$sql =" SELECT";
							$sql.=" d.no";
							$sql.=" , property_no";
							$sql.=" , property_nm";
							$sql.=" , todoufuken_no";
							$sql.=" , todoufuken_nm";
							$sql.=" , shikucyouson_no";
							$sql.=" , shikucyouson_nm";
							$sql.=" , town_nm";
							$sql.=" , address";
							$sql.=" , railroad";
							$sql.=" , station";
							$sql.=" , kouzou";
							$sql.=" , k.name";
							$sql.=" , tijyokaisu";
							$sql.=" , tikakaisu";
							$sql.=" , rent";
							$sql.=" , unit_price";
							$sql.=" FROM";
							$sql.=" propertydetail d";
							$sql.=" LEFT JOIN";
							$sql.=" m_kouzou k";
							$sql.=" ON k.no = d.kouzou ";
							$sql.=" WHERE property_no =".$gc->property_no;
							$sql.=" ORDER BY";
							$sql.=" no";

							$rs = $gc->db->query($sql);

							$row_count = $gc->db->get_row_count();

							$i = 0;

							while ($rs->eof==false) {
								$no = $rs->fields["no"];
								$todoufuken_nm = $rs->fields["todoufuken_nm"];
								$shikucyouson_nm = $rs->fields["shikucyouson_nm"];
								$town_nm = $rs->fields["town_nm"];
								$address = $rs->fields["address"];
								$railroad = $rs->fields["railroad"];
								$station = $rs->fields["station"];
								$name = $rs->fields["name"];
								$tijyokaisu = $rs->fields["tijyokaisu"];
								$tikakaisu = $rs->fields["tikakaisu"];

								$rent = $rs->fields["rent"];
								$unit_price = $rs->fields["unit_price"];

								$odd = "";
								if(($i % 2)==1){
									$odd = " class=\"odd\"";
								}

								echo "<tr".$odd.">";
								echo "<td class=\"al\">".f_hsc($todoufuken_nm.$shikucyouson_nm.$town_nm.$address)."</td>";
								echo "<td class=\"al\">".f_hsc($railroad)."</td>";
								echo "<td class=\"al\">".f_hsc($station)."</td>";
								echo "<td class=\"al\">".f_hsc($name)."</td>";
								echo "<td class=\"ac\">".f_hsc($tijyokaisu)."</td>";
								echo "<td class=\"ac\">".f_hsc($tikakaisu)."</td>";
								echo "<td class=\"ac\">".number_format($rent)."</td>";
								echo "<td class=\"ac\">".number_format($unit_price)."</td>";
								echo "</tr>";

								$rs->move_next();

								$i++;

							}

							$rs->free_result();

							if($row_count==0){
								echo "<tr>";
								echo "<td colspan=\"9\" align=\"center\">データはありません。</td>";
								echo "</tr>";
							}

							?>
							</table>
						</div>
						<!-- Form -->
						<div class="form">
							<div class="box-field">
								<label>コメント</label>
								<textarea  name="comment" style="width:600px;height:90px;" readonly><?php echo $gc->comment?></textarea>
							</div>

							<p>現在の緯度・経度:<?php echo "(".f_hsc($gc->lat).",".f_hsc($gc->lon).") 方角:".f_hsc($gc->direction)?>
								<?php echo " 角度:".f_hsc($gc->pitch)." ズーム:".f_hsc($gc->zoom)?>
							</p>
						</div>
						<!-- End Form -->


					<!-- Form Buttons -->
					<div class="buttons">
						<div class="alignleft">
							<button type="button" class="button color green" onclick="run_submit('form_data', 'entry')">はい</button>
							<button type="button" class="button color blue" onclick="run_submit('form_data', 'revision')">修正</button>
						</div>
						<div class="alignright">
						</div>
					</div>
					<!-- End Form Buttons -->

				</div>
				<!-- End Box -->

<?php
	}elseif($gc->form_mode=="message"){
?>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;<?php echo f_hsc($gc->message) ?></strong></p>
				</div>
				<!-- End Message OK -->

<?php
		echo "<div class=\"ac\"><a href=\"buken_area_list.php\">登録エリア一覧 へ</a>";
		echo "&nbsp;&nbsp;&nbsp;&nbsp;";
		echo "<a href=\"./buken_list.php?shikucyouson_no=".$gc->shikucyouson_no."\">".f_hsc($gc->todoufuken_nm." ".$gc->shikucyouson_nm)."</a>";
		echo "&nbsp;&nbsp;&nbsp;&nbsp;";
		echo "<a href=\"../".$gc->property_no."/detail.php\" target=\"_blank\">プレビューへ</a></div>";
	}else{

		for ($i=0; $i<$gc->msg->count; $i++) {
?>
				<!-- Message Error -->
				<div class="msg msg-error">
					<p><strong>&nbsp;<?php echo f_hsc($gc->msg->list[$i]) ?></strong></p>
				</div>
				<!-- End Message Error -->
<?php
		}
?>

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2><?php echo f_hsc($gc->property_nm)."詳細"?></h2>
					</div>
					<!-- End Box Head -->

					<form name="form_edit" action="bukendetail.php" method="POST" onsubmit="return false" enctype="multipart/form-data">
						<input name="mode" type="hidden" value="" />
						<input name="act" type="hidden" value="<?php echo $gc->act?>" />
						<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>" />
						<input name="property_no" type="hidden" value="<?php echo f_hsc($gc->property_no)?>" />
						<input name="todoufuken_nm" type="hidden" value="<?php echo f_hsc($gc->todoufuken_nm)?>" />
						<input name="shikucyouson_nm" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_nm)?>" />
						<input name="shikucyouson_no" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_no)?>" />
						<input name="property_nm" type="hidden" value="<?php echo f_hsc($gc->property_nm)?>" />
						<input name="no" id="no" type="hidden" value="" />
						<input name="lat" id="lat" type="hidden" value="<?php echo f_hsc($gc->lat)?>" />
						<input name="lon" id="lon" type="hidden" value="<?php echo f_hsc($gc->lon)?>" />
						<input name="direction" id="direction" type="hidden" value="<?php echo f_hsc($gc->direction)?>" />
						<input name="pitch" id="pitch" type="hidden" value="<?php echo f_hsc($gc->pitch)?>" />
						<input name="zoom" id="zoom" type="hidden" value="<?php echo f_hsc($gc->zoom)?>" />
						<div class="table">

							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<th class="al">住所</th>
									<th width="90" class="al">沿線</th>
									<th width="70" class="al">駅名</th>
									<th width="100" class="al">建物構造</th>
									<th width="70" class="ac">地上階層</th>
									<th width="70" class="ac">地下階層</th>
									<th width="60" class="ac">賃料</th>
									<th width="60" class="ac">㎡単価</th>
									<th width="50" class="ac">削除</th>
								</tr>
							<?php

							$sql =" SELECT";
							$sql.=" d.no";
							$sql.=" , property_no";
							$sql.=" , property_nm";
							$sql.=" , todoufuken_no";
							$sql.=" , todoufuken_nm";
							$sql.=" , shikucyouson_no";
							$sql.=" , shikucyouson_nm";
							$sql.=" , town_nm";
							$sql.=" , address";
							$sql.=" , railroad";
							$sql.=" , station";
							$sql.=" , kouzou";
							$sql.=" , k.name";
							$sql.=" , tijyokaisu";
							$sql.=" , tikakaisu";
							$sql.=" , rent";
							$sql.=" , unit_price";
							$sql.=" FROM";
							$sql.=" propertydetail d";
							$sql.=" LEFT JOIN";
							$sql.=" m_kouzou k";
							$sql.=" ON k.no = d.kouzou ";
							$sql.=" WHERE property_no =".$gc->property_no;
							$sql.=" ORDER BY";
							$sql.=" no";

							$rs = $gc->db->query($sql);

							$row_count = $gc->db->get_row_count();

							$i = 0;

							while ($rs->eof==false) {
								$no = $rs->fields["no"];
								$todoufuken_nm = $rs->fields["todoufuken_nm"];
								$shikucyouson_nm = $rs->fields["shikucyouson_nm"];
								$town_nm = $rs->fields["town_nm"];
								$address = $rs->fields["address"];
								$railroad = $rs->fields["railroad"];
								$station = $rs->fields["station"];
								$management_company = $rs->fields["management_company"];
								$name = $rs->fields["name"];
								$tijyokaisu = $rs->fields["tijyokaisu"];
								$tikakaisu = $rs->fields["tikakaisu"];
								$soukosu = $rs->fields["soukosu"];
								$rent = $rs->fields["rent"];


								$unit_price = $rs->fields["unit_price"];

								$odd = "";
								if(($i % 2)==1){
									$odd = " class=\"odd\"";
								}

								echo "<tr".$odd.">";
								echo "<td class=\"al\">".f_hsc($todoufuken_nm.$shikucyouson_nm.$town_nm.$address)."</td>";
								echo "<td class=\"al\">".f_hsc($railroad)."</td>";
								echo "<td class=\"al\">".f_hsc($station)."</td>";
								echo "<td class=\"al\">".f_hsc($name)."</td>";
								echo "<td class=\"ac\">".f_hsc($tijyokaisu)."</td>";
								echo "<td class=\"ac\">".f_hsc($tikakaisu)."</td>";
								echo "<td class=\"ac\">".number_format($rent)."</td>";
								echo "<td class=\"ac\">".number_format($unit_price)."</td>";
								echo "<td class=\"ac\"><button type=\"button\" class=\"button\" onclick=\"itemdel(".f_hsc($no).")\">削除</button></td>";
								echo "</tr>";

								$rs->move_next();

								$i++;

							}

							$rs->free_result();

							if($row_count==0){
								echo "<tr>";
								echo "<td colspan=\"9\" align=\"center\">データはありません。</td>";
								echo "</tr>";
							}

							?>
							</table>
						</div>
						<!-- Form -->
						<div class="form">

							<div class="box-field">
								<label>コメント<span style="margin-left:20px;color:red">1行40文字で改行してください。行数に制限はありません。</span></label>
								<textarea  name="comment" style="width:600px;height:90px;" ><?php echo $gc->comment?></textarea>
							</div>

							<p>現在の緯度・経度:<span id="res"></span>  方角<span id="res2"></span>
							  角度<span id="res3"></span>  ズーム<span id="res4"></span>
							</p>
							 <div id="map" style="width:300px; height:300px;"></div>
						</div>
						<!-- End Form -->

						<!-- Form Buttons -->
						<div class="buttons">
							<div class="alignleft">
								<button type="button" class="button color green" onclick="run_submit('form_edit', 'confirm')">入力確認へ</button>
							</div>
<?php
		if($gc->act=="u"){
?>
							<div class="alignright">
								<button type="button" class="button color red" onclick="run_submit('form_edit', 'delete')">削除</button>
							</div>
							<div class="alignright pos-top2">
								<input id="del" name="delete_check" type="checkbox" value="1" class="pos-top2" /><label for="del">削除する</label>
							</div>
<?php
		}
?>
						</div>
						<!-- End Form Buttons -->

					</form>

				</div>
				<!-- End Box -->

<?php
	}
?>
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

<div id="dialog_message" title="メッセージ">
	<p id="dlg_msg_str" class="mt10 ml10"></p>
</div>


</body>
</html>
<?php
}
Exemple #17
0
function out_html($gc) {
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>地域ランク編集</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<style>
/* IEでソートするときの対応 */
.group { zoom: 1 }
</style>
<!-- *** javascript *** -->
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script>
$(function() {

	$('.group h3').click(function(){

		if( $(this).attr("panelmode") == "open" ){

			//閉じる処理

			$(this).attr("panelmode", "close");

			$(this).removeClass("ui-accordion-header-active");
			$(this).removeClass("ui-state-active");
			$(this).removeClass("ui-corner-top");
			$(this).addClass("ui-corner-all");

			$('span', this).removeClass("ui-icon-triangle-1-s");
			$('span', this).addClass("ui-icon-triangle-1-e");

			$('+div', this).removeClass("ui-accordion-content-active");

			$('+div:not(:animated)',this).slideUp('normal');

		}else{

			//開く処理

			get_area($('+div', this), $(this).attr("todoufuken_no"));

			$(this).attr("panelmode", "open");

			$(this).removeClass("ui-corner-all");
			$(this).addClass("ui-accordion-header-active");
			$(this).addClass("ui-state-active");
			$(this).addClass("ui-corner-top");

			$('span', this).removeClass("ui-icon-triangle-1-e");
			$('span', this).addClass("ui-icon-triangle-1-s");

			$('+div', this).addClass("ui-accordion-content-active");

			var d = {height:'toggle', opacity:'toggle'};
			$('+div',this).animate(d);

		}

	});

});

//ランクの変更
function rank_change(o){

	var selectedItem = o.options[ o.selectedIndex ];

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=rank";
	query += "&shikucyouson_no=" + $(o).attr("shikucyouson_no");
	query += "&rank_no=" + selectedItem.value;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("更新処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}

function get_area(pnl, todoufuken_no){

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=area_l";
	query += "&todoufuken_no=" + todoufuken_no;

	$.ajax({
		type: "POST",
		url: "get_area.php",
		dataType: "html",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				pnl.empty();
				pnl.html(XMLHttpRequest.responseText);
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}

function set_area(order){

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&mode=shikucyouson";
	query += "&" + order;

	$.ajax({
		type: "POST",
		url: "set_area.php",
		dataType: "text",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				if(XMLHttpRequest.responseText != "OK"){
					alert("ソート処理に失敗しました。");
				}
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}

</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 3) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="area_r.php">エリア管理</a>
			<span>&gt;</span>
			<a href="area_r.php">対応エリア</a>
			<span>&gt;</span>
			地域ランク編集
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>地域ランク編集</b></h2>
						<div class="right">
							<a href="area_sort.php?mode=add" class="custom-button"><span>都道府県ソートモード</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Accordion -->
					<div class="Accordion" style="padding:15px 10px;">

						<!-- Accordion -->
						<div class="ui-accordion ui-widget ui-helper-reset">

<?php

	$sql = "SELECT";
	$sql.= " todoufuken_no,";
	$sql.= " todoufuken_nm,";
	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " m_todoufuken ";
	$sql.= "ORDER BY";
	$sql.= " sort_no";

	$rs = $gc->db->query($sql);

	$i = 0;

	while ($rs->eof==false) {

		$todoufuken_no = $rs->fields["todoufuken_no"];
		$todoufuken_nm = $rs->fields["todoufuken_nm"];

?>
		<div class="group">
			<h3 panelmode="close" todoufuken_no="<?php echo f_hsc($todoufuken_no) ?>" class="ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all">
				<span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-e"></span>
				<?php echo f_hsc($todoufuken_nm) ?></h3>
			<div style="display: none;" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
				&nbsp;
			</div>
		</div>
<?php

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

?>

						</div>

					</div>
					<!-- Accordion -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {


	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.=" todoufuken_no";
	$sql.=" , todoufuken_nm";
	$sql.=" FROM";
	$sql.=" m_todoufuken ";
	$sql.= " ORDER BY sort_no ";

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>簡易査定一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">
var submit_flg = false;
function search(fname) {
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;

$(function() {

	$('.group h3').click(function(){

		if( $(this).attr("panelmode") == "open" ){

			//閉じる処理

			$(this).attr("panelmode", "close");

			$(this).removeClass("ui-accordion-header-active");
			$(this).removeClass("ui-state-active");
			$(this).removeClass("ui-corner-top");
			$(this).addClass("ui-corner-all");

			$('span', this).removeClass("ui-icon-triangle-1-s");
			$('span', this).addClass("ui-icon-triangle-1-e");

			$('+div', this).removeClass("ui-accordion-content-active");

			$('+div:not(:animated)',this).slideUp('normal');

		}else{

			//開く処理

			get_area($('+div', this), $(this).attr("todoufuken_no"));

			$(this).attr("panelmode", "open");

			$(this).removeClass("ui-corner-all");
			$(this).addClass("ui-accordion-header-active");
			$(this).addClass("ui-state-active");
			$(this).addClass("ui-corner-top");

			$('span', this).removeClass("ui-icon-triangle-1-e");
			$('span', this).addClass("ui-icon-triangle-1-s");

			$('+div', this).addClass("ui-accordion-content-active");

			var d = {height:'toggle', opacity:'toggle'};
			$('+div',this).animate(d);

		}

	});

});

function get_area(pnl, todoufuken_no){

	var date = new Date();
	var timestamp = date.getTime();

	var query = "time=" + timestamp;
	query += "&todoufuken_no=" + todoufuken_no;
	query += "&pnl=" + pnl;

	$.ajax({
		type: "POST",
		url: "get_buken.php",
		dataType: "html",
		data: query,
		cache: false,
		async: false,
		complete: function(XMLHttpRequest, textStatus){
			if(textStatus=="success"){
				pnl.empty();
				pnl.html(XMLHttpRequest.responseText);
			}else{
				alert("通信エラーが発生しました。");
			}
		}
	});

}


</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 6) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
		<a href="#">簡易査定</a>
		<span>&gt;</span>
			登録エリア一覧
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<div class="left">
						<h2 class="left">登録エリア一覧</h2>
							<div class="cl">&nbsp;</div>
						</div>

						<div class="right">
							<a href="buken_csv.php" class="custom-button" style="margin-right:10px;"><span>CSV出力</span></a>
							<a href="bukeninsert.php" class="add-button"><span>データインポート</span></a>
							<div class="cl">&nbsp;</div>
						</div>
					</div>
					<!-- End Box Head -->
					<!-- Accordion -->
					<div class="Accordion" style="padding:15px 10px;">

						<!-- Accordion -->
						<div class="ui-accordion ui-widget ui-helper-reset">

			<?php
			$i = 0;

			while ($rs->eof==false) {

				$todoufuken_no = $rs->fields["todoufuken_no"];
				$todoufuken_nm = $rs->fields["todoufuken_nm"];
?>
				<div class="group" >
					<h3 panelmode="close"  id="<?php echo "pnl".f_hsc($todoufuken_no)?>" todoufuken_no="<?php echo f_hsc($todoufuken_no) ?>" class="ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all">
						<span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-e"></span>
						<?php echo f_hsc($todoufuken_nm) ?></h3>
					<div style="display: none;" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
						&nbsp;
					</div>
				</div>
<?php
				$rs->move_next();

				$i++;

			}

			$rs->free_result();

			?>
</div>

					</div>
					<!-- Accordion -->
				</div>
				<!-- End Box -->

				<div class="cl">&nbsp;</div>
			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>
		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title><?php echo $gc->title_text ?></title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script language="JavaScript">
<!--
var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;
// -->
</script>

</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 6) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="company_l.php">提携会社管理</a>
			<span>&gt;</span>
			<a href="company_l.php">提携会社一覧</a>
			<span>&gt;</span>

<?php
	if($gc->company_no > 0){
?>
			<a href="company_r.php?company_no=<?php echo $gc->company_no ?>">詳細</a>
			<span>&gt;</span>
			<a href="company_area_e.php?mode=edit&company_no=<?php echo $gc->company_no ?>">対応エリア編集</a>
			<span>&gt;</span>
<?php
	}
?>
<?php echo $gc->title_text ?>

		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

<?php
	if($gc->form_mode=="message"){
?>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;<?php echo f_hsc($gc->message) ?></strong></p>
				</div>
				<!-- End Message OK -->

<?php

	if($gc->company_no > 0){
			echo "<div class=\"ac\"><a href=\"company_area_e.php?mode=edit&company_no=".$gc->company_no."\">対応エリア編集へ</a></div>";
	}else{
			echo "<div class=\"ac\"><a href=\"company_l.php\">提携会社一覧へ</a></div>";
	}


	}else{

		for ($i=0; $i<$gc->msg->count; $i++) {
?>
				<!-- Message Error -->
				<div class="msg msg-error">
					<p><strong>&nbsp;<?php echo f_hsc($gc->msg->list[$i]) ?></strong></p>
				</div>
				<!-- End Message Error -->
<?php
		}
?>

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2><?php echo $gc->title_text ?></h2>
					</div>
					<!-- End Box Head -->

					<form name="form_edit" action="company_area_insert.php" method="POST" onsubmit="return false" enctype="multipart/form-data">
						<input name="mode" type="hidden" value="insert" />
						<input name="act" type="hidden" value="<?php echo $gc->act?>" />
						<input name="token" type="hidden" value="<?php echo f_hsc($gc->token)?>" />

						<!-- Form -->
						<div class="form">

							<div class="box-field">
								<label style="display:inline;"><?php echo $gc->title_text ?></label>
								<input type="file" name="company_area_file" class="field size4" />
								<input type="hidden" name="company_no" value="<?php echo $gc->company_no ?>" />
							</div>

						</div>
						<!-- End Form -->

						<!-- Form Buttons -->
						<div class="buttons">
							<div class="alignleft">
								<button type="button" class="button color green" onclick="submit()">インポートへ</button>
							</div>
							<div class="alignright">
								<span><?php echo "アップロード時のファイル最大サイズは合計で".ini_get('upload_max_filesize')."バイトです。"?></span>
							</div>
						</div>
						<!-- End Form Buttons -->

					</form>

				</div>
				<!-- End Box -->

<?php
	}
?>
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
Exemple #20
0
function out_html($gc) {

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " user_no,";
	$sql.= " user_nm,";
	$sql.= " user_kn,";
	$sql.= " user_id,";
	$sql.= " e_mail,";
	$sql.= " last_login_time,";
	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " m_user ";
	$sql.= "WHERE 0 = 0 ";

	$sql.= "ORDER BY";

	switch($_GET["si"]) {
	case "user_no":
		$sql.= " user_no".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
		break;
	case "user_nm":
		$sql.= " user_nm".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "user_kn":
		$sql.= " user_kn".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "user_id":
		$sql.= " user_id".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "e_mail":
		$sql.= " e_mail".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	case "last_login_time":
		$sql.= " last_login_time".(($_GET["sa"]=="desc") ? " DESC" : "").", user_no ";
		break;
	default:
		$sql.= " user_no ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("user_l.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

	//ソート関連
	$sort_mode["user_no"] = "";
	$sort_mode["user_nm"] = "";
	$sort_mode["user_kn"] = "";
	$sort_mode["user_id"] = "";
	$sort_mode["e_mail"] = "";
	$sort_mode["last_login_time"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>管理者一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script> 
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 4) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="user_l.php">管理者</a>
			<span>&gt;</span>
			管理者一覧
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left"><b>管理者一覧</b></h2>
						<div class="right">
							<a href="user_e.php?mode=add" class="add-button"><span>新規追加</span></a>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr style="border-top:solid 1px #e0e0e0;">
								<th width="60" class="ac"><a href="user_l.php<?php echo f_sq("user_no") ?>">No.</a><?php echo $sort_mode["user_no"] ?></th>
								<th width="150"><a href="user_l.php<?php echo f_sq("user_nm") ?>">管理者名</a><?php echo $sort_mode["user_nm"] ?></th>
								<th width="150"><a href="user_l.php<?php echo f_sq("user_kn") ?>">フリガナ</a><?php echo $sort_mode["user_kn"] ?></th>
								<th><a href="user_l.php<?php echo f_sq("e_mail") ?>">E-mail</a><?php echo $sort_mode["e_mail"] ?></th>
								<th width="120" class="ac"><a href="user_l.php<?php echo f_sq("user_id") ?>">ログインID</a><?php echo $sort_mode["user_id"] ?></th>
								<th width="120" class="ac"><a href="user_l.php<?php echo f_sq("last_login_time") ?>">最終ログイン日時</a><?php echo $sort_mode["last_login_time"] ?></th>
								<th width="70" class="ac">詳細</th>
							</tr>

<?php

	$i = 0;

	while ($rs->eof==false) {

		$user_no = $rs->fields["user_no"];
		$user_nm = $rs->fields["user_nm"];
		$user_kn = $rs->fields["user_kn"];
		$user_id = $rs->fields["user_id"];
		$e_mail = $rs->fields["e_mail"];
		$last_login_time = $rs->fields["last_login_time"];

		if($last_login_time != ""){
			$last_login_time_d = substr($last_login_time, 0, 4)."/".substr($last_login_time, 5, 2)."/".substr($last_login_time, 8, 2);
			$last_login_time_t = substr($last_login_time, 11);
		}else{
			$last_login_time_d = "";
			$last_login_time_t = "";
		}

		$odd = "";
		if(($i % 2)==1){
			$odd = " class=\"odd\"";
		}

		echo "<tr".$odd.">";
		echo "<td class=\"ac\">".f_hsc($user_no)."</td>";
		echo "<td>".f_hsc($user_nm)."</td>";
		echo "<td>".f_hsc($user_kn)."</td>";
		echo "<td>".f_hsc($e_mail)."</td>";
		echo "<td class=\"ac\">".f_hsc($user_id)."</td>";
		echo "<td class=\"ac\">".f_hsc($last_login_time_d)."<br />".f_hsc($last_login_time_t)."</td>";
		echo "<td class=\"ac\"><button type=\"button\" class=\"list-button\" onclick=\"location.href='user_e.php?mode=edit&user_no=".$user_no."';\">詳細</button></td>";
		echo "</tr>";

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	if($row_count==0){
		echo "<tr>";
		echo "<td colspan=\"6\" align=\"center\">データはありません。</td>";
		echo "</tr>";
	}

?>
						</table>

<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								&nbsp;
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->
				<div class="cl">&nbsp;</div>

			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>

		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

</body>
</html>
<?php
}
function out_html($gc) {

	$gc->keyword = $_GET["keyword"];

	//ソート関連
	$sort_mode["cmt"] = "";

	foreach ($sort_mode as $key => &$value) {
		if($key == $_GET["si"]){
			if($_GET["sa"] == "desc"){
				$value = " ▼";
			}else{
				$value = " ▲";
			}
		}
	}

	$sql = "SELECT";
	$sql.=" t.todoufuken_no";
	$sql.=" , t.todoufuken_nm";
	$sql.=" , s.shikucyouson_nm";
	$sql.=" FROM";
	$sql.=" m_todoufuken t ";
	$sql.=" LEFT JOIN";
	$sql.=" m_shikucyouson s";
	$sql.=" ON s.todoufuken_no = t.todoufuken_no";
	$sql.= " WHERE s.shikucyouson_no = ".$gc->shikucyouson_no;

	$rs = $gc->db->query($sql);

	if(!$rs->eof){

		$todoufuken_nm = $rs->fields["todoufuken_nm"];
		$shikucyouson_nm = $rs->fields["shikucyouson_nm"];
		$todoufuken_no = $rs->fields["todoufuken_no"];
	}

	$rs->free_result();

	$sql =" SELECT SQL_CALC_FOUND_ROWS";
	$sql.=" l.property_no";
	$sql.=" , l.property_nm";
	$sql.=" , l.todoufuken_no";
	$sql.=" , l.todoufuken_nm";
	$sql.=" , l.shikucyouson_no";
	$sql.=" , l.shikucyouson_nm";
	$sql.=" , l.town_nm";
	$sql.=" , l.address";
	$sql.=" , (case when CHAR_LENGTH(l.comment)>0 then 1 else 0 end) as comment";
	$sql.=" , l.direction";
	$sql.=" , l.pitch";
	$sql.=" , d.rent";
	$sql.=" , d.unit_price";
	$sql.=" FROM";
	$sql.=" propertylist l";
	$sql.=" LEFT JOIN";
	$sql.=" (SELECT";
	$sql.=" property_no";
	$sql.=" , avg(rent) as rent";
	$sql.=" , avg(unit_price) as unit_price";
	$sql.=" FROM";
	$sql.=" propertydetail ";
	$sql.=" GROUP BY property_no";
	$sql.=" ) d";
	$sql.=" ON d.property_no = l.property_no";
	$sql.=" LEFT JOIN ";
	$sql.=" m_shikucyouson s";
	$sql.=" On s.shikucyouson_no = l.shikucyouson_no";
	$sql.=" WHERE";
	$sql.=" l.shikucyouson_no = ".$gc->shikucyouson_no;
	if($gc->keyword != ""){
		$sql.=" AND (s.shikucyouson_nm like '%".$gc->keyword."%' ";
		$sql.=" OR l.property_nm like '%".$gc->keyword."%') ";
	}

	$sql.=" ORDER BY";
	switch($_GET["si"]) {
		case "cmt":
			$sql.= " l.comment".(($_GET["sa"]=="desc") ? " DESC" : "")." ";
			break;
		default:
			$sql.= " l.property_no DESC ";
	}

	$sql.= f_get_limit($gc->pn, $gc->pl, C_ORDER_LIST_COL_CNT);

	$rsp = $gc->db->query($sql);
	$row_count = $gc->db->get_row_count();
	//ページャーの設定
	if($row_count > 0){
		$page_arr = f_page_arr("buken_list.php", $row_count, $gc->pl, C_ORDER_LIST_COL_CNT, C_ORDER_PAGE_TAG_CNT);
	}

?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>簡易査定一覧</title>
<!-- *** stylesheet *** -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/custom/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<!-- *** javascript *** -->
<script type="text/javascript" src="js/listpage.js" charset="utf-8"></script>
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script language="JavaScript">

$(function(){

	// メッセージDialog
	$('#dialog_message').dialog({
		autoOpen: false,
		resizable: false,
		modal: true,
		width: 350,
		height: 150,
		buttons: {
			"OK": function() {
				run_submit('form_del', 'del')
			},
			"キャンセル": function() {
				$(this).dialog("close");
			}
		}
	});


});

var submit_flg = false;
function run_submit(fname, mode) {
	document.forms[fname].mode.value = mode;
	if(submit_flg==false){
		//ボタン2度押し対応
		submit_flg = true;
		document.forms[fname].submit();
	}
}
function unload_page(){
	submit_flg = false;
}
window.onunload = unload_page;

function Boxcheck(){

	var flg = false;
	if($("#allchk:checked").val()){
		flg = true;
	}

	   form = document.form_del;
	   cnt =  form.elements.length;

	   for (i = 0; i < cnt; i++) {
	   if(form.elements[i].name == 'id[]') {
		   form.elements[i].checked = flg;

	   }

	 }
}

function delmsg(){

	$('#dlg_msg_str').text( "選択行を削除しでもよろしいですか?" );
	$('#dialog_message').dialog('open');
}

</script>
</head>
<body>

<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<?php tcom_header_logo_nav($gc) ?>
		<!-- End Logo + Top Nav -->
		<!-- Main Nav -->
		<?php tcom_header_main_nav($gc, 6) ?>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
		<a href="#">簡易査定</a>
		<span>&gt;</span>
			<a href="./buken_area_list.php">登録エリア一覧</a>
		<span>&gt;</span>
			<?php echo f_hsc($todoufuken_nm." ".$shikucyouson_nm)?>
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">
			<?php
			if($gc->form_mode=="message"){
			?>

				<!-- Message OK -->
				<div class="msg msg-ok">
					<p><strong>&nbsp;<?php echo f_hsc($gc->message) ?></strong></p>
				</div>
				<!-- End Message OK -->

		<?php }?>
				<!-- Box -->
				<div class="box">

				<!-- Form -->
					<div class="form">

						<form name="form_search" action="buken_list.php" method="get" onsubmit="return false">
							<input name="mode" type="hidden" value="">
							<input name="shikucyouson_no" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_no) ?>">
							<div class="box-size2 left">
								<p class="inline-field">
									<label style="display:inline;">マンション名:</label>
									<input name="keyword" type="text" class="field size3" value="<?php echo f_hsc($gc->keyword) ?>" />
									<button type="button" class="button color silver ml05" onclick="run_submit('form_search', 'search');">検索</button>
								</p>
							</div>

							<div class="cl">&nbsp;</div>

						</form>

					</div>
					<!-- End Form -->

					<!-- Box Head -->
					<div class="box-head">
						<div class="left">
						<h2 class="left"><?php echo f_hsc($todoufuken_nm." ".$shikucyouson_nm)?></h2>
							<div class="cl">&nbsp;</div>
						</div>
						<div class="right">
							<a href="buken_csv.php?shikucyouson_no=<?php echo $gc->shikucyouson_no?>" class="custom-button" style="margin-right:10px;"><span>CSV出力</span></a>
							<div class="cl">&nbsp;</div>
						</div>
					</div>
					<!-- End Box Head -->
						<!-- Accordion -->
						<div class="table">
			<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<?php echo $page_arr["cmes_str"].$page_arr["par1_str"].$page_arr["par2_str"]; ?>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>
						<form name="form_del" method="GET" action="buken_list.php" onSubmit="return false">
							<input name="mode" type="hidden" value="">
							<input name="shikucyouson_no" type="hidden" value="<?php echo f_hsc($gc->shikucyouson_no) ?>">
							<input name="keyword" type="hidden" value="<?php echo f_hsc($gc->keyword) ?>" />
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<th width="10" class="ac"><input type="checkbox" name="allchk" id="allchk" onclick="Boxcheck();"></th>
									<th width="120" class="al">マンション名</th>
									<th width=60 class="al">市区町村</th>
									<th width="100" class="al">住所</th>
									<th width="90" class="ac">賃料相場</th>
									<th width="90" class="ac">㎡単価</th>
									<th width="20" class="ac">方角</th>
									<th width="50" class="ac"><a href="buken_list.php<?php echo f_sq("cmt") ?>">コメント</a><?php echo $sort_mode["cmt"] ?></th>
									<th width="45" class="ac">詳細</th>
									<th width="65" class="ac">プレビュー</th>
								</tr>

			<?php

				$i = 0;

			while ($rsp->eof==false) {

				$property_no = $rsp->fields["property_no"];
				$property_nm = $rsp->fields["property_nm"];
				$todoufuken_nm = $rsp->fields["todoufuken_nm"];
				$shikucyouson_nm = $rsp->fields["shikucyouson_nm"];
				$town_nm = $rsp->fields["town_nm"];
				$address= $rsp->fields["address"];
				$direction = $rsp->fields["direction"];
				$pitch = $rsp->fields["pitch"];
				$management_company = $rsp->fields["management_company"];
				$rent = $rsp->fields["rent"];
				$rent = sprintf('%.1f',round($rent*0.9/10000,1))."万~".sprintf('%.1f',round($rent*1.1/10000,1))."万";
				$unit_price = $rsp->fields["unit_price"];
				$unit_price = number_format(round($unit_price*0.9))."~".number_format(round($unit_price*1.1));
				$odd = "";

				$comment = "-";
				if($rsp->fields["comment"] == 1){
					$comment = "○";
				}

				$hokaku = "-";
				if($direction != "0" || $pitch != "0"){
					$hokaku = "済";
				}
				if(($i % 2)==1){
					$odd = " class=\"odd\"";
				}
				echo "<tr".$odd.">";
				echo "<td class=\"ac\"><input type=\"checkbox\" name=\"id[]\" value=\"".$property_no."\"></td>";
				echo "<td class=\"al\">".f_hsc($property_nm)."</td>";
				echo "<td class=\"al\">".f_hsc($shikucyouson_nm)."</td>";
				echo "<td class=\"al\">".f_hsc($town_nm.$address)."</td>";
				echo "<td class=\"ac\">".f_hsc($rent)."</td>";
				echo "<td class=\"ac\">".$unit_price."</td>";
				echo "<td class=\"ac\">".$hokaku."</td>";
				echo "<td class=\"ac\">".$comment."</td>";
				echo "<td class=\"ac\"><button type=\"button\" class=\"button\" onclick=\"location.href='bukendetail.php?mode=edit&property_no=".$property_no."';\">編集</button></td>";
				echo "<td class=\"ac\"><button type=\"button\" class=\"button\" onclick=\"window.open('../".$property_no."/detail.php');\">プレビュー</button></td>";
				echo "</tr>";
				$rsp->move_next();

				$i++;

			}

			$rsp->free_result();
			if($row_count==0){
				echo "<tr>";
				echo "<td colspan=\"10\" align=\"center\">データはありません。</td>";
				echo "</tr>";
			}
			?>
			</table>
</form>
			<?php if($row_count > 0){ ?>
						<!-- Pagging -->
						<div class="pagging">
							<div class="box-l">
								<button type="button" class="button color red" onclick="delmsg();">選択行を削除</button>
							</div>
							<div class="box-c">
								<div class="margin-center">
									<?php echo $page_arr["back_str"].$page_arr["list_str"].$page_arr["deno_str"].$page_arr["next_str"]; ?>
								</div>
							</div>
							<div class="box-r">
								<label>表示件数:</label>
								<?php echo $page_arr["plst_str"] ?>
							</div>
						</div>
						<!-- End Pagging -->
<?php } ?>

					</div>
					<!-- Accordion -->
				</div>
				<!-- End Box -->

				<div class="cl">&nbsp;</div>
			</div>
			<!-- End Content -->
			<div class="cl">&nbsp;</div>
		</div>
		<!-- Main -->

	</div>
</div>
<!-- End Container -->

<!-- Footer -->
	<?php tcom_footer($gc) ?>
<!-- End Footer -->

	<div id="dialog_message" title="メッセージ">
		<p id="dlg_msg_str" class="mt10 ml10"></p>
	</div>

</body>
</html>
<?php
}