<?php require_once('Connections/connAmazon2.php'); ?>
<?php
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "top.php";
if (! && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE amazonz_data SET title=%s, category=%s, topic=%s, uptime=%s, uset_id=%s WHERE id=%s",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['topic'], "text"),
GetSQLValueString($_POST['uptime'], "date"),
GetSQLValueString($_POST['uset_id'], "text"),
GetSQLValueString($_POST['id'], "int"));
mysql_select_db($database_connAmazon2, $connAmazon2);
$Result1 = mysql_query($updateSQL, $connAmazon2) or die(mysql_error());
$updateGoTo = "admin2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_rsAmazonz2 = "1";
if (isset($_GET['id'])) {
$colname_rsAmazonz2 = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_connAmazon2, $connAmazon2);
$query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE id = %s", $colname_rsAmazonz2);
$rsAmazonz2 = mysql_query($query_rsAmazonz2, $connAmazon2) or die(mysql_error());
$row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2);
$totalRows_rsAmazonz2 = mysql_num_rows($rsAmazonz2);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp" />
<title>Amazonz -投稿修正-</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body onload="MM_preloadImages('img/account2.jpg','img/key2.jpg','img/member2.jpg','img/kate2.jpg')">
<div id="body_2">
<div id="head">
<div id="head1"></div>
<div id="head2"></div>
</div>
<div id="main">
<div id="menu">
<div class="img1"><img src="img/menu1.jpg" width="180" height="24" class="img1" /></div>
<div class="img1">
<div class="img1"><?php echo ($_SESSION['MM_Username']. "さん こんにちわ!"); ?>
</div>
<p>
<a href="admin2.php">管理画面</a><br>
<a href="admin2.php?doLogout=true">ログアウト</a><br>
<a href="top.php">HOME</a>
</p>
</div>
<div class="img1"><img src="img/menu1.jpg" width="180" height="24" hspace="0" vspace="0" border="0" class="img1" /></div>
<div class="img1"><a href="member_s.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','img/member2.jpg',1)"><img src="img/member.jpg" alt="メンバー検索" name="Image10" width="180" height="40" border="0" id="Image10" /></a></div>
<div class="img1"><a href="category_s.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image11','','img/kate2.jpg',1)"><img src="img/kate.jpg" alt="カテゴリー検索" name="Image11" width="180" height="40" border="0" id="Image11" /></a></div>
<div class="img1"><a href="key_s.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','img/key2.jpg',1)"><img src="img/key.jpg" alt="キーワード検索" name="Image9" width="180" height="40" border="0" id="Image9" /></a></div>
</div>
<div id="text">
<img src="img/blank.jpg" /><br>
<p><br></p>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table width="400" align="center" class="style3">
<tr><td><p align="center">投稿を修正します</p></td></tr>
<tr valign="baseline">
<td align="right" nowrap><div align="left">ID:<?php echo $row_rsAmazonz2['id']; ?></div></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap><div align="left">タイトル:
<input type="text" name="title" value="<?php echo $row_rsAmazonz2['title']; ?>" size="32">
</div></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap><div align="left">カテゴリ:
<select name="category">
<option value="DVD" <?php if (!(strcmp("DVD", $row_rsAmazonz2['category']))) {echo "SELECTED";} ?>>DVD</option>
<option value="BOOK" <?php if (!(strcmp("BOOK", $row_rsAmazonz2['category']))) {echo "SELECTED";} ?>>BOOK</option>
<option value="MUSIC" <?php if (!(strcmp("MUSIC", $row_rsAmazonz2['category']))) {echo "SELECTED";} ?>>MUSIC</option>
</select>
</div></td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap><div align="left">トピック:<br>
<textarea name="topic" cols="50" rows="5"><?php echo $row_rsAmazonz2['topic']; ?></textarea>
</div></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap><div align="left">
<input type="submit" value="修正">
</div></td>
</tr>
</table>
<input type="hidden" name="uptime" value="<?php echo date('Y/m/d H:i:s'); ?>">
<input type="hidden" name="uset_id" value="<?php echo($_SESSION['MM_Username']); ?>">
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="id" value="<?php echo $row_rsAmazonz2['id']; ?>">
</form>
</div>
<div id="under">
<div id="under1"></div>
<div id="under2"></div>
</div>
</div>
</div>
</body>
</html>
最終更新:2006年11月07日 09:16