<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?><?php require_once('../../Connections/xxx.php'); ?>
<?php require_once("../../webassist/file_manipulation/helperphp.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$colname_rsebook = "-1";
if (isset($_GET['ebook'])) {
$colname_rsebook = (get_magic_quotes_gpc()) ? $_GET['ebook'] : addslashes($_GET['ebook']);
}
mysql_select_db($database_traders, $traders);
$query_rsebook = sprintf("SELECT * FROM prod WHERE EbookLink = %s ", GetSQLValueString($colname_rsebook, "text"));
$rsebook = mysql_query($query_rsebook, $traders) or die(mysql_error());
$row_rsebook = mysql_fetch_assoc($rsebook);
$totalRows_rsebook = mysql_num_rows($rsebook);
$paramItemNo_rsDesc = "-1";
if (isset($row_rsebook['itemNumber'])) {
$paramItemNo_rsDesc = (get_magic_quotes_gpc()) ? $row_rsebook['itemNumber'] : addslashes($row_rsebook['itemNumber']);
}
mysql_select_db($database_traders, $traders);
$query_rsDesc = sprintf("SELECT * FROM proddesc WHERE itemNum = %s", GetSQLValueString($paramItemNo_rsDesc, "text"));
$rsDesc = mysql_query($query_rsDesc, $traders) or die(mysql_error());
$row_rsDesc = mysql_fetch_assoc($rsDesc);
$totalRows_rsDesc = mysql_num_rows($rsDesc);
$paramItemNum_rsAuthor = "-1";
if (isset($row_rsebook['itemNumber'])) {
$paramItemNum_rsAuthor = (get_magic_quotes_gpc()) ? $row_rsebook['itemNumber'] : addslashes($row_rsebook['itemNumber']);
}
mysql_select_db($database_traders, $traders);
$query_rsAuthor = sprintf("SELECT * FROM assignauth, authors WHERE prodID = %s AND assignauth.authorID = authors.AuthID", GetSQLValueString($paramItemNum_rsAuthor, "text"));
$rsAuthor = mysql_query($query_rsAuthor, $traders) or die(mysql_error());
$row_rsAuthor = mysql_fetch_assoc($rsAuthor);
$totalRows_rsAuthor = mysql_num_rows($rsAuthor);?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(isset($_POST["download"])){
WA_DFP_DownloadFile("WA_DownloadResult1", "../../../_downloadFiles", "".$row_rsebook['EbookLink'] ."", "".$row_rsebook['EbookLink'] ."", false, false, false, "", "", "", "");
}
?>
<!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>Untitled Document</title>
<link href="../../siteassist_css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p> </p>
<table width="750" align="center" cellpadding="5">
<tr>
<td colspan="3">
<p>Item Number: <?php echo $row_rsebook['itemNumber']; ?></p>
<h3><?php echo $row_rsebook['Title']; ?><?php echo $row_rsebook['subTitle']; ?></h3>
</td>
</tr>
<tr>
<td width="150" align="center" valign="top">
<p><img src="../../bookimages/<?php echo $row_rsebook['SmallImage']; ?>" alt="<?php echo $row_rsebook['Title']; ?>" /></p>
<p>Author(s):<br />
<?php do { ?>
<?php echo $row_rsAuthor['AuthFName']; ?> <?php echo $row_rsAuthor['AuthLName']; ?><br />
<?php } while ($row_rsAuthor = mysql_fetch_assoc($rsAuthor)); ?></p>
</td>
<td colspan="2" valign="top">
<p><?php echo $row_rsDesc['shortDesc']; ?></p>
<div style="margin:25px">
<form id="downloadForm" name="downloadForm" method="post" action="download.php">
<input type="submit" name="download" id="download" value="Download eBook" />
</form></div>
<p> </p>
</td>
</tr>
</table>
<p> </p>
<p> </p>
</body>
</html>
<?php
mysql_free_result($rsebook);
mysql_free_result($rsDesc);
mysql_free_result($rsAuthor);
?>