Modified:
/trunk/Geekzbookshelf2/center/bookItem.php
/trunk/Geekzbookshelf2/data/dbRetrieval.php
/trunk/Geekzbookshelf2/navigate/return.php
=======================================
--- /trunk/Geekzbookshelf2/center/bookItem.php Fri Dec 10 18:39:33 2010
+++ /trunk/Geekzbookshelf2/center/bookItem.php Sun Dec 12 18:53:01 2010
@@ -81,76 +81,69 @@
<link rel="stylesheet" type="text/css" href="StyleSheets/review.css" />
<?php
///////// Star rating here for statistics
+$line = mysql_fetch_assoc(getStatisticsforBook_Totalreview($bookID));
+if ($line['TotalReview'] >= 1){
echo " <div id='Stattitle' style=' width: 300px' title='Statistics
of ratings' >";
- echo "<div id='reviewtitle' > Total reviews:     ";
- $line = mysql_fetch_assoc(getStatisticsforBook_Totalreview($bookID));
if ($line['TotalReview'] >= 1) {echo $line['TotalReview'];} else {
echo "0";}
- echo "</div>";
-
-
- echo " </br>   <div id='stars'
class='s_five'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_FiveStar($bookID));
- if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].")
People";}
- else { echo "By (0) People"; }
-
-
- echo " </br>   <div id='stars'
class='s_four'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_FourStar($bookID));
- if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].")
People";}
- else { echo "By (0) People"; }
-
- echo " </br>   <div id='stars'
class='s_three'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_ThreeStar($bookID));
- if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].")
People";}
- else { echo "By (0) People"; }
-
- echo " </br>   <div id='stars'
class='s_two'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_TwoStar($bookID));
- if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].")
People";}
- else { echo "By (0) People"; }
-
- echo " </br>   <div id='stars'
class='s_one'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_OneStar($bookID));
- if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].")
People";}
- else { echo "By (0) People"; }
-
- echo "</br></div></br><hr><b>Other reviews:<b><hr>";
-
- $results = getReviewofaBOOK($bookID);
-
- if(mysql_num_rows($results) > 0)
- {
-
- while ($line = mysql_fetch_assoc($results))
- {
- echo "<div id='review' style=' '><b>By - ".
$line['UserID_Guest']."</b>  " ;
-
- if ($line['Rating'] == 5 )
- {
- echo "<div id='stars' class='s_five'></div>";
- }
- else if ($line['Rating'] == 4 )
- {
- echo "<div id='stars' class='s_four'></div>";
- }
- else if ($line['Rating'] == 3 )
- {
- echo "<div id='stars' class='s_three'></div>";
- }
- else if ($line['Rating'] == 2 )
- {
- echo "<div id='stars' class='s_two'></div>";
- }
- else if($line['Rating'] == 1 )
- {
- echo "<div id='stars' class='s_one'></div>";
- }
- echo "</br>" .$line['Review']. "</br><hr></div>" ;
- }
- }
- else {
- echo "No reviews for this book";
- }
-
+ echo "<div id='reviewtitle' >  Total
reviews: ".$line['TotalReview']."    ";
+ if ($line['TotalReview'] >= 1)
+ echo "</div>";
+
+
+ echo " </br>   <div id='stars'
class='s_five'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_FiveStar($bookID));
+ if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].") People";}
+ else { echo "By (0) People"; }
+
+
+ echo " </br>   <div id='stars'
class='s_four'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_FourStar($bookID));
+ if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].") People";}
+ else { echo "By (0) People"; }
+
+ echo " </br>   <div id='stars'
class='s_three'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_ThreeStar($bookID));
+ if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].") People";}
+ else { echo "By (0) People"; }
+
+ echo " </br>   <div id='stars'
class='s_two'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_TwoStar($bookID));
+ if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].") People";}
+ else { echo "By (0) People"; }
+
+ echo " </br>   <div id='stars'
class='s_one'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_OneStar($bookID));
+ if ($line['Rating'] >= 1) {echo "By (".$line['Rating'].") People";}
+ else { echo "By (0) People"; }
+
+ echo "</br></div></br><hr><b>Other reviews:<b><hr>";
+
+ $results = getReviewofaBOOK($bookID);
+
+ if(mysql_num_rows($results) > 0)
+ {
+
+ while ($line = mysql_fetch_assoc($results)){
+ echo "<div id='review' style=' '><b>By - ".
$line['UserID_Guest']."</b>  " ;
+ if ($line['Rating'] == 5 ){
+ echo "<div id='stars' class='s_five'></div>";
+ }else if ($line['Rating'] == 4 ){
+ echo "<div id='stars' class='s_four'></div>";
+ }else if ($line['Rating'] == 3 ){
+ echo "<div id='stars' class='s_three'></div>";
+ }else if ($line['Rating'] == 2 ){
+ echo "<div id='stars' class='s_two'></div>";
+ }else if($line['Rating'] == 1 ){
+ echo "<div id='stars' class='s_one'></div>";
+ }
+ echo "</br>" .$line['Review']. "</br><hr></div>" ;
+ }
+ }
+ else {
+ echo "No reviews for this book";
+ }
+}else {
+ echo "No reviews for this book";
+}
///
=======================================
--- /trunk/Geekzbookshelf2/data/dbRetrieval.php Sat Dec 11 04:42:22 2010
+++ /trunk/Geekzbookshelf2/data/dbRetrieval.php Sun Dec 12 18:53:01 2010
@@ -10,13 +10,16 @@
//$dbhost = "127.0.0.1";
$dbuser = "booksnine";
$dbpass = "sfulda09";
+ /*$dbhost = "localhost";
+ $dbuser = "root";
+ $dbpass = "";*/
mysql_connect($dbhost, $dbuser, $dbpass); // Connection to MySQL
mysql_select_db($dbname); // Select database
}
function getCourses($school){
openmydb();
- $result = mysql_query("SELECT * FROM courses WHERE school
= '$school'");
+ $result = mysql_query("SELECT * FROM courses WHERE school = '$school'
ORDER BY courseNumber");
//if($result == NULL){echo "RESULT is null";}
return $result;
}
=======================================
--- /trunk/Geekzbookshelf2/navigate/return.php Fri Dec 10 21:16:17 2010
+++ /trunk/Geekzbookshelf2/navigate/return.php Sun Dec 12 18:53:01 2010
@@ -73,59 +73,62 @@
<link rel="stylesheet" type="text/css" href="StyleSheets/review.css" />
<?php
////
+$line = mysql_fetch_assoc(getStatisticsforBook_Totalreview($bookID));
+if ($line['TotalReview'] >= 1){
echo " <div id='Stattitle' style=' width: 300px' title='Statistics
of ratings' ><b>  Statistics</b></br>";
- echo "<div id='reviewtitle' >  Total reviews:  
  ";
- $line = mysql_fetch_assoc(getStatisticsforBook_Totalreview($bookID));
if ($line['TotalReview'] >= 1) {echo $line['TotalReview'];} else {
echo "0";}
- echo "</div>";
-
- echo " </br>   <div id='stars'
class='s_five'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_FiveStar($bookID));
- if ($line['Rating'] >= 1) {echo $line['Rating'];}
- else { echo "0"; }
-
-///// Star rating here for statistics
- echo " </br>   <div id='stars'
class='s_four'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_FourStar($bookID));
- if ($line['Rating'] >= 1) {echo $line['Rating'];}
- else { echo "0"; }
-
- echo " </br>   <div id='stars'
class='s_three'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_ThreeStar($bookID));
- if ($line['Rating'] >= 1) {echo $line['Rating'];}
- else { echo "0"; }
-
- echo " </br>   <div id='stars'
class='s_two'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_TwoStar($bookID));
- if ($line['Rating'] >= 1) {echo $line['Rating'];}
- else { echo "0"; }
-
- echo " </br>   <div id='stars'
class='s_one'></div>  : ";
- $line =
mysql_fetch_assoc(getStatisticsforBookWith_OneStar($bookID));
- if ($line['Rating'] >= 1) {echo $line['Rating'];}
- else { echo "0"; }
-
- echo "</br></div></br>";
-
- $results = getReviewofaBOOK($bookID);
-
- if(mysql_num_rows($results) > 0){
- while ($line = mysql_fetch_assoc($results)){
- echo "<div id='review' style=' '><b>By - ".
$line['UserID_Guest']."</b>  " ;
- if ($line['Rating'] == 5 ){
- echo "<div id='stars' class='s_five'></div>";
- }else if ($line['Rating'] == 4 ){
- echo "<div id='stars' class='s_four'></div>";
- }else if ($line['Rating'] == 3 ){
- echo "<div id='stars' class='s_three'></div>";
- }else if ($line['Rating'] == 2 ){
- echo "<div id='stars' class='s_two'></div>";
- }else if($line['Rating'] == 1 ){
- echo "<div id='stars' class='s_one'></div>";
-
}echo "</br>" .$line['Review']. "</br><hr></div>" ;}
- }
- else {
- echo "No reviews for this book";
- }
+ echo "<div id='reviewtitle' >  Total reviews:     ";
+ $line = mysql_fetch_assoc(getStatisticsforBook_Totalreview($bookID));
if ($line['TotalReview'] >= 1) {echo $line['TotalReview'];} else {
echo "0";}
+ echo "</div>";
+
+ echo " </br>   <div id='stars'
class='s_five'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_FiveStar($bookID));
+ if ($line['Rating'] >= 1) {echo $line['Rating'];}
+ else { echo "0"; }
+
+ ///// Star rating here for statistics
+ echo " </br>   <div id='stars'
class='s_four'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_FourStar($bookID));
+ if ($line['Rating'] >= 1) {echo $line['Rating'];}
+ else { echo "0"; }
+
+ echo " </br>   <div id='stars'
class='s_three'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_ThreeStar($bookID));
+ if ($line['Rating'] >= 1) {echo $line['Rating'];}
+ else { echo "0"; }
+
+ echo " </br>   <div id='stars'
class='s_two'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_TwoStar($bookID));
+ if ($line['Rating'] >= 1) {echo $line['Rating'];}
+ else { echo "0"; }
+
+ echo " </br>   <div id='stars'
class='s_one'></div>  : ";
+ $line = mysql_fetch_assoc(getStatisticsforBookWith_OneStar($bookID));
+ if ($line['Rating'] >= 1) {echo $line['Rating'];}
+ else { echo "0"; }
+
+ echo "</br></div></br>";
+
+ $results = getReviewofaBOOK($bookID);
+
+ if(mysql_num_rows($results) > 0){
+ while ($line = mysql_fetch_assoc($results)){
+ echo "<div id='review' style=' '><b>By - ".
$line['UserID_Guest']."</b>  " ;
+ if ($line['Rating'] == 5 ){
+ echo "<div id='stars' class='s_five'></div>";
+ }else if ($line['Rating'] == 4 ){
+ echo "<div id='stars' class='s_four'></div>";
+ }else if ($line['Rating'] == 3 ){
+ echo "<div id='stars' class='s_three'></div>";
+ }else if ($line['Rating'] == 2 ){
+ echo "<div id='stars' class='s_two'></div>";
+ }else if($line['Rating'] == 1 ){
+ echo "<div id='stars' class='s_one'></div>";
+ }echo "</br>" .$line['Review']. "</br><hr></div>" ;}
+ }
+}else{
+ echo "No reviews for this book";
+}
+
echo "</div>";
echo "</div>";
closemydb();