※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

<?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 = "account_cre2.php";
if (! *1 && (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
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_rsAmazonz2 = 5;
$pageNum_rsAmazonz2 = 0;
if (isset($_GET['pageNum_rsAmazonz2'])) {
 $pageNum_rsAmazonz2 = $_GET['pageNum_rsAmazonz2'];
}
$startRow_rsAmazonz2 = $pageNum_rsAmazonz2 * $maxRows_rsAmazonz2;
$colname_rsAmazonz2 = "%";
if (isset($_GET['key'])) {
 $colname_rsAmazonz2 = (get_magic_quotes_gpc()) ? $_GET['key'] : addslashes($_GET['key']);
}
mysql_select_db($database_connAmazon2, $connAmazon2);
$query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE topic LIKE '%s' ORDER BY uptime DESC", $colname_rsAmazonz2);
$query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2);
$rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error());
$row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2);
if (isset($_GET['totalRows_rsAmazonz2'])) {
 $totalRows_rsAmazonz2 = $_GET['totalRows_rsAmazonz2'];
} else {
 $all_rsAmazonz2 = mysql_query($query_rsAmazonz2);
 $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2);
}
$totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1;
$queryString_rsAmazonz2 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
 $params = explode("&", $_SERVER['QUERY_STRING']);
 $newParams = array();
 foreach ($params as $param) {
   if (stristr($param, "pageNum_rsAmazonz2") == false && 
       stristr($param, "totalRows_rsAmazonz2") == false) {
     array_push($newParams, $param);
   }
 }
 if (count($newParams) != 0) {
   $queryString_rsAmazonz2 = "&" . htmlentities(implode("&", $newParams));
 }
}
$queryString_rsAmazonz2 = sprintf("&totalRows_rsAmazonz2=%d%s", $totalRows_rsAmazonz2, $queryString_rsAmazonz2);
?>
<?php
session_start();
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if *2 && ($_SERVER['QUERY_STRING'] != "")){
 $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if *3 &&($_GET['doLogout']=="true")){
 //to fully log out a visitor we need to clear the session varialbles
 session_unregister('MM_Username');
 session_unregister('MM_UserGroup');

 $logoutGoTo = "top.php";
 if ($logoutGoTo) {
   header("Location: $logoutGoTo");
   exit;
 }
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

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 *4 && ($_POST["MM_insert"] == "form2")) {
 $insertSQL = sprintf("INSERT INTO amazonz_data (id, title, category, topic, uptime, uset_id) VALUES (%s, %s, %s, %s, %s, %s)",
                      GetSQLValueString($_POST['id'], "int"),
                      GetSQLValueString($_POST['title'], "text"),
                      GetSQLValueString($_POST['category'], "text"),
                      GetSQLValueString($_POST['topic'], "text"),
                      GetSQLValueString($_POST['uptime'], "date"),
                      GetSQLValueString($_POST['uset_id'], "text"));

 mysql_select_db($database_connAmazon2, $connAmazon2);
 $Result1 = mysql_query($insertSQL, $connAmazon2) or die(mysql_error());

 $insertGoTo = "admin2.php";
 if (isset($_SERVER['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
   $insertGoTo .= $_SERVER['QUERY_STRING'];
 }
 header(sprintf("Location: %s", $insertGoTo));
}

$maxRows_rsAmazonz2 = 5;
$pageNum_rsAmazonz2 = 0;
if (isset($_GET['pageNum_rsAmazonz2'])) {
 $pageNum_rsAmazonz2 = $_GET['pageNum_rsAmazonz2'];
}
$startRow_rsAmazonz2 = $pageNum_rsAmazonz2 * $maxRows_rsAmazonz2;

mysql_select_db($database_connAmazon2, $connAmazon2);
$query_rsAmazonz2 = "SELECT * FROM amazonz_data ORDER BY uptime DESC";
$query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2);
$rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error());
$row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2);

if (isset($_GET['totalRows_rsAmazonz2'])) {
 $totalRows_rsAmazonz2 = $_GET['totalRows_rsAmazonz2'];
} else {
 $all_rsAmazonz2 = mysql_query($query_rsAmazonz2);
 $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2);
}
$totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1;

mysql_select_db($database_connAmazon2, $connAmazon2);
$sessionname=$_SESSION['MM_Username'];
$query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE topic LIKE '%s' && uset_id = '$sessionname' ORDER BY uptime DESC" , $colname_rsAmazonz2);
$query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2);
$rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error());
$row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2);

if (isset($_GET['totalRows_rsAmazonz2'])) {
 $totalRows_rsAmazonz2 = $_GET['totalRows_rsAmazonz2'];
} else {
 $all_rsAmazonz2 = mysql_query($query_rsAmazonz2);
 $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2);
}
$totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1;

$queryString_rsAmazonz2 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
 $params = explode("&", $_SERVER['QUERY_STRING']);
 $newParams = array();
 foreach ($params as $param) {
   if (stristr($param, "pageNum_rsAmazonz2") == false && 
       stristr($param, "totalRows_rsAmazonz2") == false) {
     array_push($newParams, $param);
   }
 }
 if (count($newParams) != 0) {
   $queryString_rsAmazonz2 = "&" . htmlentities(implode("&", $newParams));
 }
}
$queryString_rsAmazonz2 = sprintf("&totalRows_rsAmazonz2=%d%s", $totalRows_rsAmazonz2, $queryString_rsAmazonz2);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<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="<?php echo $logoutAction ?>">ログアウト</a>
		          <a href="top.php">投稿閲覧</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" />



   <form action="<?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
     <table width="250" height="100" align="center">
       <tr valign="baseline">
         <td align="left" nowrap="nowrap" class="style3">タイトル:
             <input type="text" name="title" value="" size="32" />          
           </td>
       </tr>
       <tr valign="baseline">
         <td align="left" nowrap="nowrap" class="style3">カテゴリ:
             <select name="category">
               <option value="BOOK" <?php if (!(strcmp("BOOK", ""))) {echo "SELECTED";} ?>>BOOK</option>
               <option value="DVD" <?php if (!(strcmp("DVD", ""))) {echo "SELECTED";} ?>>DVD</option>
               <option value="MUSIC" <?php if (!(strcmp("MUSIC", ""))) {echo "SELECTED";} ?>>MUSIC</option>
             </select>
         </td>
       </tr>
       <tr valign="baseline">
         <td align="left" valign="top" nowrap="nowrap"><p class="style3">トピック:<br />
               <textarea name="topic" cols="40" rows="5"></textarea>
         </p>
         </td>
       </tr>
       <tr valign="baseline">
         <td align="left" nowrap="nowrap" class="style3">
           <input type="submit" value="投稿" />
         </td>
       </tr>
     </table>
     <span class="style3">
     <input type="hidden" name="id" value="" />
     <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_insert" value="form2" />
     </span>
   </form>

   <table width="400" border="0" align="center" cellpadding="3">
 <?php do { ?>
 <tr>
   <td class="style3"><?php echo $row_rsAmazonz2['uptime']; ?></td>
 </tr>
 <tr>
   <td class="style3"><?php echo $row_rsAmazonz2['title']; ?></td>
 </tr>
 <tr>
   <td class="style3"><?php echo $row_rsAmazonz2['category']; ?></td>
 </tr>
 <tr>
   <td class="style3"><?php echo $row_rsAmazonz2['topic']; ?></td>
 </tr>
 <tr>
   <td class="style3"><?php echo $row_rsAmazonz2['uset_id']; ?></td>
 </tr>
 <tr>
   <td><span class="style3"><a href="update2.php?id=<?php echo $row_rsAmazonz2['id']; ?>">修正</a> <a href="del2.php?id=<?php echo $row_rsAmazonz2['id']; ?>">削除</a> </span>      <hr /></td>
 </tr>
 <?php } while ($row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2)); ?>
</table>

<table border="0" width="50%" align="center">
 <tr>
   <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 > 0) { // Show if not first page ?>
     <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, 0, $queryString_rsAmazonz2); ?>">先頭</a>
     <?php } // Show if not first page ?>
   </td>
   <td width="31%" align="center"><?php if ($pageNum_rsAmazonz2 > 0) { // Show if not first page ?>
     <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, max(0, $pageNum_rsAmazonz2 - 1), $queryString_rsAmazonz2); ?>">戻る</a>
     <?php } // Show if not first page ?>
   </td>
   <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 < $totalPages_rsAmazonz2) { // Show if not last page ?>
     <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, min($totalPages_rsAmazonz2, $pageNum_rsAmazonz2 + 1), $queryString_rsAmazonz2); ?>">次へ</a>
     <?php } // Show if not last page ?>
   </td>
   <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 < $totalPages_rsAmazonz2) { // Show if not last page ?>
     <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, $totalPages_rsAmazonz2, $queryString_rsAmazonz2); ?>">最終</a>
     <?php } // Show if not last page ?>
   </td>
 </tr>
</table>
<?php mysql_free_result($rsAmazonz2); ?>
      </div>
   <div id="under">
	   <div id="under1"></div>
   <div id="under2"></div>
   </div> 

    </div>
 </div>
  
</body>
</html>
|