All pastes #773774 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-14 19:42 UTC
rendered paste body
<?php require_once('Connections/CMS.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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;
}
}

mysql_select_db($database_CMS, $CMS);
$query_uniformSearch = "SELECT * FROM articles WHERE itemType = 'uniform'";
$uniformSearch = mysql_query($query_uniformSearch, $CMS) or die(mysql_error());
$row_uniformSearch = mysql_fetch_assoc($uniformSearch);
$totalRows_uniformSearch = mysql_num_rows($uniformSearch);

mysql_select_db($database_CMS, $CMS);
$query_weaponrySearch = "SELECT * FROM articles WHERE itemType = 'weaponry'";
$weaponrySearch = mysql_query($query_weaponrySearch, $CMS) or die(mysql_error());
$row_weaponrySearch = mysql_fetch_assoc($weaponrySearch);
$totalRows_weaponrySearch = mysql_num_rows($weaponrySearch);

mysql_select_db($database_CMS, $CMS);
$query_documentSearch = "SELECT * FROM articles WHERE itemType = 'document'";
$documentSearch = mysql_query($query_documentSearch, $CMS) or die(mysql_error());
$row_documentSearch = mysql_fetch_assoc($documentSearch);
$totalRows_documentSearch = mysql_num_rows($documentSearch);

mysql_select_db($database_CMS, $CMS);
$query_accessorySearch = "SELECT * FROM articles WHERE itemType = 'accessory'";
$accessorySearch = mysql_query($query_accessorySearch, $CMS) or die(mysql_error());
$row_accessorySearch = mysql_fetch_assoc($accessorySearch);
$totalRows_accessorySearch = mysql_num_rows($accessorySearch);

mysql_select_db($database_CMS, $CMS);
$query_medalSearch = "SELECT * FROM articles WHERE itemType = 'medal'";
$medalSearch = mysql_query($query_medalSearch, $CMS) or die(mysql_error());
$row_medalSearch = mysql_fetch_assoc($medalSearch);
$totalRows_medalSearch = mysql_num_rows($medalSearch);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Center for Military Studies</title>
<link href="screen.css" rel="stylesheet" type="text/css">
<script src="SpryAssets/SprySlidingPanels.js" type="text/javascript"></script> 
<link href="SpryAssets/SprySlidingPanels.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrap">
<div id="head">
<?php include ('includes/headcontent.htm'); ?>
</div>
<div id="contentwrap">
<img style="float:left;" src="images/medal.jpg">
<div id="nav">
<h1>Welcome</h1>
<ul style="text-align:left;clear:both;float:right;list-style-type:none;">
<li><a href="about.php">About the center</a></li>
<li><a href="conflict.php">Conflict timeline</a></lI>
<li id="current"><a href="artifacts.php">Artifact library</a></li>
<li><a href="news.php">News &amp; Updates</a></li>
</ul>
</div>
<div id="content">
<h1>Artifact library</h1>
<p style="text-align:center;font-size:14px;">
<a href="#" onclick="sp1.showPanel(0); return false;">Uniforms</a> |
<a href="#" onclick="sp1.showPanel(1); return false;">Weaponry</a> |
<a href="#" onclick="sp1.showPanel(2); return false;">Documents</a> |
<a href="#" onclick="sp1.showPanel(3); return false;">Accessories</a> |
<a href="#" onclick="sp1.showPanel(4); return false;">Medals</a>
</p>
<div style="clear:both;" id="SlidingPanels1" class="SlidingPanels">
<div class="SlidingPanelsContentGroup">
<div id="p1" class="SlidingPanelsContent">
<?php do { ?>
<ul>
<li><a target="_blank" href="images/all_edited/<?php echo $row_uniformSearch['mImage']; ?>"><img src="images/all_edited/thumbs/<?php echo $row_uniformSearch['mImage']; ?>"></a></li>
<li>Item ID #<?php echo $row_uniformSearch['itemID']; ?></li>
</ul>
<?php } while ($row_uniformSearch = mysql_fetch_assoc($uniformSearch)); ?>
</div>
<div id="p2" class="SlidingPanelsContent">
<?php do { ?>
<ul>
<li><a target="_blank" href="images/all_edited/<?php echo $row_weaponrySearch['mImage']; ?>"><img src="images/all_edited/thumbs/<?php echo $row_weaponrySearch['mImage']; ?>"></a></li>
<li>Item ID #<?php echo $row_weaponrySearch['itemID']; ?></li>
</ul>
<?php } while ($row_weaponrySearch = mysql_fetch_assoc($weaponrySearch)); ?>
</div>
<div id="p3" class="SlidingPanelsContent">
<?php do { ?>
<ul>
<li><a target="_blank" href="images/all_edited/<?php echo $row_documentSearch['mImage']; ?>"><img src="images/all_edited/thumbs/<?php echo $row_documentSearch['mImage']; ?>"></a></li>
<li>Item ID #<?php echo $row_documentSearch['itemID']; ?></li>
</ul>
<?php } while ($row_documentSearch = mysql_fetch_assoc($documentSearch)); ?>
</div>
<div id="p4" class="SlidingPanelsContent">
<?php do { ?>
<ul>
<li><a target="_blank" href="images/all_edited/<?php echo $row_accessorySearch['mImage']; ?>"><img src="images/all_edited/thumbs/<?php echo $row_accessorySearch['mImage']; ?>"></a></li>
<li>Item ID #<?php echo $row_accessorySearch['itemID']; ?></li>
</ul>
<?php } while ($row_accessorySearch = mysql_fetch_assoc($accessorySearch)); ?>
</div>
<div id="p5" class="SlidingPanelsContent">
<?php do { ?>
<ul>
<li><a target="_blank" href="images/all_edited/<?php echo $row_medalSearch['mImage']; ?>"><img src="images/all_edited/thumbs/<?php echo $row_medalSearch['mImage']; ?>"></a></li>
<li>Item ID #<?php echo $row_medalSearch['itemID']; ?></li>
</ul>
<?php } while ($row_medalSearch = mysql_fetch_assoc($medalSearch)); ?>
</div>
</div>
</div>   
<script type="text/javascript">
	var sp1 = new Spry.Widget.SlidingPanels("SlidingPanels1");
</script> 
</div>
</div>
<div id="foot"><p>&copy; 2007 Center for Military Studies. All Rights Reserved.</p></div>
</div>
</body>
</html>
<?php
mysql_free_result($uniformSearch);
mysql_free_result($weaponrySearch);
mysql_free_result($documentSearch);
mysql_free_result($accessorySearch);
mysql_free_result($medalSearch);
?>