<?php
	require("../index/__include-common.php");
	require("../account/__logincheck.php");
	$con = my_mysqli_connect(_DB_SCHEMA);
	$sql = "select * from m_pane2 where id_account = ".$_SESSION['login_id']."";
	$rs = my_mysqli_query($sql);
	if (mysqli_num_rows($rs) == 0) {
		$sql = "insert into m_pane2 ";
		$sql .= "(id_account";
		$sql .= ", c_text1";
		$sql .= ", c_text2";
		$sql .= ") values (";
		$sql .= "'".$_SESSION['login_id']."'";
		$sql .= ", '".post_to_mysql("c_text1")."'";
		$sql .= ", '".post_to_mysql("c_text2")."'";
		$sql .= ")";
		$ret = my_mysqli_query($sql, "登録できませんでした。");
	} else {
		$rec = mysqli_fetch_array($rs);
		$sql = "update m_pane2 set";
		$sql .= " c_text1 = '".post_to_mysql("c_text1")."'";
		$sql .= ", c_text2 = '".post_to_mysql("c_text2")."'";
		$sql .= ", c_updatetime = '". date("Y/m/d H:i:s") . "'";
		$sql .= " where id_account = ".$_SESSION['login_id']."";
		$ret = my_mysqli_query($sql, "更新できませんでした。");
	}
?>
