<?php require_once('Connections/Buchregal.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;
}
}

$currentPage = $_SERVER["PHP_SELF"];

mysql_select_db($database_Buchregal, $Buchregal);
$query_Recordset1 = "SELECT * FROM buch WHERE Preis < 36";
$Recordset1 = mysql_query($query_Recordset1, $Buchregal) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

mysql_select_db($database_Buchregal, $Buchregal);
$query_Recordset2 = "SELECT * FROM buch WHERE Preis = 39";
$Recordset2 = mysql_query($query_Recordset2, $Buchregal) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);

$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false && 
        stristr($param, "totalRows_Recordset1") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

$queryString_Recordset2 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset2") == false && 
        stristr($param, "totalRows_Recordset2") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_Recordset2 = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_Recordset2 = sprintf("&totalRows_Recordset2=%d%s", $totalRows_Recordset2, $queryString_Recordset2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
.Stil1 {
	font-size: 36px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #6A6000;
}
.Stil2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 12px;
}
.Stil4 {
	font-size: 10px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.Stil7 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 9px;
	color: #FFFFFF;
}
.Stil5 {
	font-size: 10px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	line-height: 15px;
}
.Stil8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #2D7EAB; }
a:link {
	color: #2D7EAB;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #2D7EAB;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
  <tr>
    <td width="839" height="70" bgcolor="#FFE300"><div align="center" class="Stil1"> B&uuml;chershop</div></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="48%" valign="top"><?php do { ?>
        <table border="0" cellpadding="5" cellspacing="0">
          <tr>
            <td width="15" bgcolor="#D0E1EB"></td>
            <td width="10">&nbsp;</td>
            <td width="100" align="center" valign="top"><img src="bilder/<?php echo $row_Recordset1['ISBN']; ?>.jpg" /></td>
            <td align="left" valign="top" background="Bilder/bg_buecher.gif"><p align="left" class="Stil2"><?php echo $row_Recordset1['Buchtitel']; ?></p>
              <p align="left" class="Stil4"><?php echo $row_Recordset1['Autor']; ?></p>
              <p align="left" class="Stil4"><?php echo $row_Recordset1['Verlag']; ?><br />
                ISBN: <?php echo $row_Recordset1['ISBN']; ?> <br />
                Erschienen: <?php echo $row_Recordset1['Datum']; ?><br />
                <?php echo $row_Recordset1['Seiten']; ?> Seiten </p>
              <p align="left" class="Stil4"><span class="Stil2"><?php echo $row_Recordset1['Preis']; ?> &euro;</span><br />
              </p></td>
            <td width="10"></td>
            <td width="5" bgcolor="#2D7EAB">&nbsp;</td>
          </tr>
          <tr>
            <td width="15" rowspan="3" bgcolor="#D0E1EB">&nbsp;</td>
            <td width="10" rowspan="3">&nbsp;</td>
            <td colspan="2" align="left" class="Stil4"><img src="Bilder/space.gif" width="1" height="5" /></td>
            <td width="10" rowspan="3">&nbsp;</td>
            <td width="5" rowspan="3" align="left" valign="top" bgcolor="#2D7EAB">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" align="left" class="Stil4"><span class="Stil5"><?php echo $row_Recordset1['Text']; ?></span></td>
          </tr>
          <tr>
            <td colspan="2" align="left" class="Stil5"><span class="Stil4"><img src="Bilder/space.gif" width="1" height="5" /></span></td>
          </tr>
        </table>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td>
    <td width="10">&nbsp;</td>
    <td width="48%" valign="top"><?php do { ?>
        <table border="0" cellpadding="5" cellspacing="0">
          <tr>
            <td width="15" bgcolor="#D0E1EB"></td>
            <td width="10">&nbsp;</td>
            <td width="100" align="center" valign="top"><img src="bilder/<?php echo $row_Recordset2['ISBN']; ?>.jpg" /></td>
            <td align="left" valign="top" background="Bilder/bg_buecher.gif"><p align="left" class="Stil2"><?php echo $row_Recordset2['Buchtitel']; ?></p>
              <p align="left" class="Stil4"><?php echo $row_Recordset2['Autor']; ?></p>
              <p align="left" class="Stil4"><?php echo $row_Recordset2['Verlag']; ?><br />
                ISBN: <?php echo $row_Recordset2['ISBN']; ?> <br />
                Erschienen: <?php echo $row_Recordset2['Datum']; ?><br />
                <?php echo $row_Recordset2['Seiten']; ?> Seiten </p>
              <p align="left" class="Stil4"><span class="Stil2"><?php echo $row_Recordset2['Preis']; ?> &euro;</span><br />
              </p></td>
            <td width="10">&nbsp;</td>
            <td width="5" bgcolor="#2D7EAB">&nbsp;</td>
          </tr>
          <tr>
            <td width="15" rowspan="3" bgcolor="#D0E1EB">&nbsp;</td>
            <td width="10" rowspan="3">&nbsp;</td>
            <td colspan="2" align="left" class="Stil4"><img src="Bilder/space.gif" width="1" height="5" /></td>
            <td width="10" rowspan="3">&nbsp;</td>
            <td width="5" rowspan="3" align="left" valign="top" bgcolor="#2D7EAB">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" align="left" class="Stil4"><span class="Stil5"><?php echo $row_Recordset2['Text']; ?></span></td>
          </tr>
          <tr>
            <td colspan="2" align="left" class="Stil5"><span class="Stil4"><img src="Bilder/space.gif" width="1" height="5" /></span></td>
          </tr>
        </table>
        <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);
?>
