<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BookPage.aspx.cs" Inherits="BookPage" %>
<!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=utf-8" />
<title></title>
<link href="BookPage.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
window.onload = function () {
var bookId = '<%=Session["BookId"]%>' - 1;
displayBookInfo(bookId);
}
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", "Books.xml", false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
x = xmlDoc.getElementsByTagName("Book");
function displayBookInfo(i) {
title = (x[i].getElementsByTagName("Title")[0].childNodes[0].nodeValue);
author = (x[i].getElementsByTagName("Author")[0].childNodes[0].nodeValue);
publishDate = (x[i].getElementsByTagName("PublishDate")[0].childNodes[0].nodeValue);
genre = (x[i].getElementsByTagName("Genre")[0].childNodes[0].nodeValue);
picurl = (x[i].getElementsByTagName("PictureUrl")[0].childNodes[0].nodeValue);
price = (x[i].getElementsByTagName("Price")[0].childNodes[0].nodeValue);
stock = (x[i].getElementsByTagName("Stock")[0].childNodes[0].nodeValue);
summary = (x[i].getElementsByTagName("Summary")[0].childNodes[0].nodeValue);
getTitle = "<h1>" + title + "</h1>";
getAuthor = "<h2>By " + author + "</h2>";
getGenre = "<li>Genre: " + genre + "</li>";
getDate = "<li>Publication: " + publishDate + "</li>";
getPrice = "<li>Price: " + price + " Shekels</li>";
getStock = "";
if (stock > 0) {
getStock = "<li>This item is in stock</li>";
}
else {
getStock = "<li>This item is not in stock</li>";
}
getSummary = "<p>" + summary + "</p>";
document.getElementById("ShowTitle").innerHTML = getTitle;
document.getElementById("ShowAuthor").innerHTML = getAuthor;
document.getElementById("ShowGenre").innerHTML = getGenre;
document.getElementById("ShowPublishDate").innerHTML = getDate;
document.getElementById("ShowPrice").innerHTML = getPrice;
document.getElementById("ShowStock").innerHTML = getStock;
document.getElementById("ShowSummary").innerHTML = getSummary;
}
</script>
</head>
<body>
<center>
<img border="0" alt="" src="Header.png" />
<div id="bookpage_container" style="text-align:left;">
<div id="bookpage_menu" style="padding-left: 100px">
<ul>
<li><a href="Default.aspx">Home</a></li>
<li><a href="#">Search</a></li>
<li><a href="Catalog.aspx" class="current">Books</a></li>
<li><a href="#">Company</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</center>
<div id="bookpage_content_right" style="padding-left: 270px">
<div id='ShowTitle' >title here</div>
<div class="image_panel"><img src="Pictures/Catch22.jpg" alt="" width="100" height="150" /></div>
<div id='ShowAuthor' >author here</div>
<ul>
<div id='ShowGenre' >genre here</div>
<div id='ShowPublishDate' >date here</div>
<div id='ShowPrice' >price here</div>
<div id='ShowStock' >stock here</div>
</ul>
</div>
<center>
<div id="ShowSummary" style="text-align:left; width:57%;">
Show Summary here
</div>
</center>
</body>
</html>