diff --git a/account/account.php b/account/account.php index 0396f65..32b9d6c 100644 --- a/account/account.php +++ b/account/account.php @@ -41,12 +41,12 @@ echo ''; } ?> -
- - My books
- - Logout -
+
+ + My books
+ + Logout +
diff --git a/catalog/bookInfo.php b/catalog/bookInfo.php index e360332..0d59bbb 100644 --- a/catalog/bookInfo.php +++ b/catalog/bookInfo.php @@ -16,7 +16,7 @@ "; echo ""; @@ -41,17 +42,19 @@ echo '

'.$title.'

'; echo '
'; - echo 'Authors:'.$authors; + echo 'Authors: '.$authors; echo '
'; - echo 'ISBN:'.$isbn; + echo 'ISBN: '.$isbn; echo '
'; - echo 'Subject Code:'.$subj; + echo 'Subject Code: '.strtoupper($subj); echo '
'; - echo 'Condition:'.$condition; + echo 'Condition: '.$condition; echo '
'; - echo 'Description:'.$desc; + echo 'Description: '.$desc; echo '
'; - echo 'Subject Code:'.$price.'$'; + echo 'Price: '.'$'.$price; + echo '
'; + echo 'Contact: '. $contact; echo ''; echo ""; } diff --git a/catalog/uploadBooks.php b/catalog/uploadBooks.php index c898d3e..816e6de 100644 --- a/catalog/uploadBooks.php +++ b/catalog/uploadBooks.php @@ -9,11 +9,9 @@ include("../includes/dbconnect.inc.php"); - $userEmail= $_SESSION['userEmail']; - - // if ($_SERVER["REQUEST_METHOD"] === 'POST') if (isset($_POST['submit'])) { + $userEmail= mysqli_real_escape_string($db, $_SESSION['userEmail']); $title = htmlspecialchars(trim($_POST['title'])); $authors = htmlspecialchars(trim($_POST['authors'])); @@ -37,14 +35,14 @@ $imgExt = array('jpeg', 'jpg', 'png'); + if (!in_array($fileExt, $imgExt) or !$fileError === 0 or $filesize >= 10000000){ - echo "Error with file, please upload a different file"; - die(); + echo "Error with file, please upload a different file. File must be of typpe jpep, jpg, or png. File size must be under 10MB. Your file size is "; + echo $filesize. "."; } $uploads_dir = "../resources/bookImg"; $imgIdentifier= $subj .'-'. rand(999999999, 9999999999).'.'.$fileExt; - echo $imgIdentifier; move_uploaded_file($tmploc, $uploads_dir.'/'.$imgIdentifier); $insQuery = "insert into books(imgID, title, authors, isbn, subjectCode, `condition`, `desc`, price, `sellerEmail`) values(?,?,?,?,?,?,?,?,?)"; @@ -54,9 +52,10 @@ $statement->close(); if ($success) { - echo "success"; + echo "Your file was successfully uploaded"; } else { - echo "Error on server, please try again"; + echo "Sorry " . $userEmail; + echo "There was an error on our server, please try again"; } } diff --git a/resources/bookImg/astr-6038484371.jpg b/resources/bookImg/astr-6038484371.jpg new file mode 100644 index 0000000..76c0f04 Binary files /dev/null and b/resources/bookImg/astr-6038484371.jpg differ diff --git a/resources/bookImg/econ-1658630216.jpg b/resources/bookImg/econ-1658630216.jpg new file mode 100644 index 0000000..cf4be64 Binary files /dev/null and b/resources/bookImg/econ-1658630216.jpg differ diff --git a/resources/bookImg/math-2371036874.jpg b/resources/bookImg/math-2371036874.jpg new file mode 100644 index 0000000..9609f47 Binary files /dev/null and b/resources/bookImg/math-2371036874.jpg differ diff --git a/resources/bookImg/calc-5234973584.jpg b/resources/bookImg/math-5234973584.jpg similarity index 100% rename from resources/bookImg/calc-5234973584.jpg rename to resources/bookImg/math-5234973584.jpg diff --git a/resources/items.sql b/resources/items.sql index 500e253..39e3b63 100644 --- a/resources/items.sql +++ b/resources/items.sql @@ -1,12 +1,16 @@ delete from books; delete from users; -insert into users values(1, "", "", "admin@rpi.edu", "admin"); +insert into users values(1, "admin", "", "admin@rpi.edu", "admin"); +insert into users values(2, "Jane", "Koy", "koyj@rpi.edu", "firstUser1!"); INSERT INTO `books` (`id`, `imgID`, `title`, `authors`, `isbn`, `subjectCode`, `condition`, `desc`, `price`, `sellerEmail`) VALUES (1, 'csci-2844507230.jpg', 'Algorithms', 'Sanjoy Dasgupta, Christos Papadimitriou, Umesh Vazirani', '978-0073523408', 'csci', 'good', 'includes handwritings+highlightings', '15.00', 'admin@rpi.edu'), (2, 'biol-8129677909.jpg', 'Essential Cell Biology', 'Bruce Alberts, Karen Hopkin, Alexander Johnson, David Morgan, Martin Raff, Keith Roberts, Peter Walter', '978-0393680379', 'biol', 'fair', 'includes handwritings+highlightings', '20.00', 'admin@rpi.edu'), - (3, 'csci-5109354294.jpg', 'Practical Programming', 'Paul Gries, Jennifer Campbell, Jason Montojo', '9781680502688', 'csci', 'new', 'csci1100, lightly used', '30.00', 'admin@rpi.edu'); - (4, 'mgmt-5123364294.jpg', 'Principiles of Management', 'David S Bright, Anastasia H Cortes, Eva Hartmann', '9384781502789', 'mgmt1100', 'new', 'lightly used', '30.00', 'admin@rpi.edu'), - (5, 'econ-5345574294.jpg', 'Principles of Microeconomics', 'N. Gregory Mankiw', '9384781502789', '9384781502789', 'econ', 'fair', 'used', '30.00', 'admin@rpi.edu'), -(6, 'calc-5234973584.jpg', 'Calculus Third Edition', 'William L Briggs, William Briggs, Lyle Cochran, Bernard Gillett, Eric L Schulz, Eric Schulz', '9234690702489', 'math', 'fair', 'used', '30.00', 'admin@rpi.edu'); \ No newline at end of file + (3, 'csci-5109354294.jpg', 'Practical Programming', 'Paul Gries, Jennifer Campbell, Jason Montojo', '9781680502688', 'csci', 'new', 'csci1100, lightly used', '30.00', 'admin@rpi.edu'), + (4, 'mgmt-5123364294.jpg', 'Principiles of Management', 'David S Bright, Anastasia H Cortes, Eva Hartmann', '9384781502789', 'mgmt1100', 'new', 'shrink wrap included', '45.00', 'admin@rpi.edu'), + (5, 'econ-5345574294.jpg', 'Principles of Microeconomics', 'N. Gregory Mankiw', '9384781502789', 'econ', 'fair', 'some water damage but all pages inact', '30.00', 'admin@rpi.edu'), + (6, 'math-5234973584.jpg', 'Calculus Third Edition', 'William L Briggs, William Briggs, Lyle Cochran, Bernard Gillett, Eric L Schulz, Eric Schulz', '9234690702489', 'math', 'fair', 'used', '55.99', 'admin@rpi.edu'), + (7, 'astr-6038484371.jpg', 'Foundations of Astrophysics', 'Barbara S. Ryden, Bradley M. Peterson', '978-0321595584', 'astr', 'poor', '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit i', '15.75', 'koyj@rpi.edu'), + (8, 'econ-1658630216.jpg', 'Intermediate Microeconomics: A Modern Approach', 'Hal R. Varian', '978-0393934243', 'econ', 'poor', '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit i', '21.00', 'koyj@rpi.edu'), + (9, 'math-2371036874.jpg', 'Introduction to Linear Algebra', 'Gilbert Strang', '978-1733146654', 'math', 'very good', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis', '87.34', 'koyj@rpi.edu'); \ No newline at end of file diff --git a/resources/textbookBuddy.sql b/resources/textbookBuddy.sql index 9e2faa7..36dfeb3 100644 --- a/resources/textbookBuddy.sql +++ b/resources/textbookBuddy.sql @@ -48,28 +48,11 @@ CREATE TABLE books( , authors VARCHAR(1000) , isbn VARCHAR(20) , subjectCode CHAR(4) - , `condition` CHAR(4) + , `condition` CHAR(9) , `desc` text , price numeric(5, 2) , sellerEmail VARCHAR(20) not null , FOREIGN KEY (`condition`) references `conditions`(`condition`) on delete set null , FOREIGN KEY (subjectCode) references subjects(subjectCode) on delete set null , FOREIGN KEY (sellerEmail) references users(email) on delete cascade -); - --- user reserve books --- functionality not yet created -CREATE TABLE reservebooks( - buyerEmail VARCHAR(20) not null - , bookID INT not null - , FOREIGN KEY (buyerEmail) references users(email) on delete cascade - , FOREIGN KEY (bookID) references books(id) on delete cascade - -) - --- will need this if we want to allow multiple images --- CREATE TABLE BookIMG ( --- bookID INT --- , ImgNo INT primary key NOT NULL --- , FOREIGN KEY (bookID) references books(bookID) on delete cascade --- ) \ No newline at end of file +); \ No newline at end of file diff --git a/styles/account.css b/styles/account.css index 9d603ca..1725628 100644 --- a/styles/account.css +++ b/styles/account.css @@ -1,24 +1,21 @@ #outer { margin: auto; + margin-top: 20px; width: 50%; padding: 10px; - background-color: whitesmoke; - border: 10px solid blueviolet; + background-color: #f4f7f8; + border: 10px solid #a8d5f8; padding: 20px; - height: 100px; - } #middle{ font-size: 2em; font-variant: small-caps; font-weight: bold; - bottom: 200px; - left: 650px; + float: left; + margin-right: 250px; } #sellerlog{ font-size: 2em; - margin-left: 600px; - margin-top: -75px; -} \ No newline at end of file +} diff --git a/styles/bookinfo.css b/styles/bookinfo.css index 5881702..4bde352 100644 --- a/styles/bookinfo.css +++ b/styles/bookinfo.css @@ -1,27 +1,20 @@ #item{ -position:relative; - - - - + position:relative; + width: 80%; + margin: auto; } img { - width:250px; + width:350px; position:absolute; - top:10px; - left:10px; - - + top:10px; + left:10px; } #bookInfo{ position:absolute; - background-color: green; - top:10px; - left:310px; - - - - + background-color: #a8d5f8; + top:50px; + left:400px; + padding: 10px; } \ No newline at end of file diff --git a/styles/general.css b/styles/general.css index cc899b7..e21bdd8 100644 --- a/styles/general.css +++ b/styles/general.css @@ -1,12 +1,14 @@ /* COLOR PALETTE -- CSS HEX ---aqua-haze: #f4f7f8; ---geyser: #cedcdd; ---picton-blue: #449fee; ---sail: #a8d5f8; ---jordy-blue: #8cccf4; ---link-water: #cee6f3; ---geyser: #dce4e6; + + --aqua-haze: #f4f7f8; + --geyser: #cedcdd; + --picton-blue: #449fee; + --sail: #a8d5f8; + --jordy-blue: #8cccf4; + --link-water: #cee6f3; + --geyser: #dce4e6; + */ *{ @@ -74,6 +76,7 @@ header a { .logo { float:left; padding: 25px 0 5px 20px; + color: #449fee; } .hmenu { diff --git a/styles/index.css b/styles/index.css index 27c6f01..b843023 100644 --- a/styles/index.css +++ b/styles/index.css @@ -20,4 +20,4 @@ img{ #welcomeDesc { margin-left: 52%; -} \ No newline at end of file +} \ No newline at end of file diff --git a/styles/login.css b/styles/login.css index 29c9ef2..4878f70 100644 --- a/styles/login.css +++ b/styles/login.css @@ -2,6 +2,7 @@ h2 { padding-bottom: 1vw; font-variant: small-caps; font-size: 3.5vw; + color: #449fee; } .body {