[studentbooks09] r143 committed - my account

0 views
Skip to first unread message

student...@googlecode.com

unread,
Dec 11, 2010, 2:51:16 PM12/11/10
to student...@googlegroups.com
Revision: 143
Author: shahx07
Date: Sat Dec 11 11:50:43 2010
Log: my account
http://code.google.com/p/studentbooks09/source/detail?r=143

Added:
/trunk/Geekzbookshelf2/images/Process Icon.jpg
Modified:
/trunk/Geekzbookshelf2/my-account.php

=======================================
--- /dev/null
+++ /trunk/Geekzbookshelf2/images/Process Icon.jpg Sat Dec 11 11:50:43 2010
Binary file, no diff available.
=======================================
--- /trunk/Geekzbookshelf2/my-account.php Sat Dec 11 04:42:22 2010
+++ /trunk/Geekzbookshelf2/my-account.php Sat Dec 11 11:50:43 2010
@@ -1,85 +1,162 @@
<?php session_start();
+if ($_SESSION["Email"]=="") {
+//print("You're not a valid user of this site!");
+header( 'Location: customer/login.php' ) ;
+}
require("data/dbRetrieval.php");
+openmydb();
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" type="text/css" href="StyleSheets/cart.css"
/>
- <link rel="stylesheet" type="text/css"
href="StyleSheets/mainStyleSheet.css" />
- <link rel="stylesheet" type="text/css" href="StyleSheets/item.css"
/>
- <script type="text/javascript"
src="jquery/jquery-1.3.2.min.js"></script>
- <script type="text/javascript"
src="jquery/jquery-ui-1.7.2.custom.min.js"></script>
- <link rel = "stylesheet" href="jquery/jquery-ui-1.7.2.custom.css">
- <script type="text/javascript"><!--
- function afterLoad() {
- $(function() {
- $("td#Title").click(function() {
- // alert('second');
- //location.replace("login.php");
- });
- });
- }
- //--></script>
- <title></title>
- </head>
- <body>
- <div id ="top">
- <a href="index.php" ><img src="images/logo.jpg" id="image"
title="Go back to Home"></a>
- <center>
- Your Account
- </center>
- <form style="left:80%; position:absolute;" action="index.php"
method="GET" name="return">
- <input type="submit" value=" Continue Shopping " />
- <br />
- </form>
- </div >
-
- <div id="myAccount"">
- <h2>My Account</h2>
- <div id="myInfos">
- <h3>User Infos</h3>
- <div id="myUserInfo">
- <p>Email: <?php echo $_SESSION["Email"]; ?><br />
- Password: **************
- </p>
-
- <p><a href="#">[Edit login info]</a></p>
- </div><div id="myBillingInfo">
- <p><strong>Billing info</strong></p>
- <p>(here goes the billing info)</p>
- <p><a href="#">[Edit billing info]</a></p>
- </div><div id="myShippingInfo">
- <p><strong>Shipping info</strong></p>
- <p>(here goes the shipping info)</p>
- <p><a href="#">[Edit shipping info]</a></p>
- </div>
- </div>
- <div id="myOrders">
- <br /><h3>Past Orders</h3>
- <table width="800" border="1" cellspacing="0"
cellpadding="5">
- <tr>
- <td width="95"><strong>Order
No.</strong></td>
- <td width="300"><strong>Title</strong></td>
- <td
width="106"><strong>Quantity</strong></td>
- <td width="106"><strong>Price</strong></td>
- <td width="106"><strong>Total
Price</strong></td>
-
- <td
width="106"><strong>Status</strong></td>
- </tr>
- <?php
- $myOrders = getMyOrders($_SESSION["id"]);
- while ($row = mysql_fetch_assoc($myOrders)) {
-
- echo "<tr><td>".$row['orderID']."</td>";
- echo "<td><a href=\"index.php?bid=".
$row['bookid'] ."\">".$row['title']."</a></td>";
- echo "<td>". $row['quantity'] . "
Books</td>";
- echo "<td>". $row['price']."</td>";
- echo "<td>". $row['quantity'] *
$row['price']."</td>";
- echo "<td
width=\"106\"><strong>Processing</strong></td></tr>";
- } ?>
- </table>
- </div>
- </div>
- </body>
+<!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>GeeksBookSelf - My account</title>
+<style>
+ #container {
+
+ padding-left: 150px;
+ padding-right: 150px;
+ background-color: #d3d3d3;
+ font-weight: 100 ;
+}
+.strong{
+ color: #0000FF;
+}
+ #order {
+
+ padding-left: 0px;
+ padding-right: 0px;
+ background-color: lightyellow;
+}
+ #order1 {
+
+ padding-left: 0px;
+ padding-right: 0px;
+ background-color: burlywood ;
+}
+#orderbody{
+ background-color: burlywood;
+}
+
+#main{
+ background-color: ghostwhite;
+}
+</style>
+</head>
+
+<body id="container">
+ <div id="main">
+<h2><img src="images/logo.jpg" width="345" height="100" alt="logo" /></h2>
+<h2>My Account
+</h2>
+<table >
+ <tr valign="top">
+ <td width="100"><p><strong>User info</strong></p>
+ <p>Email: <?php echo $_SESSION["Email"]; ?><br />
+ Password: **************
+ </p>
+ <p><a href="#">[Edit login info]</a></p>
+<p><strong>Billing info</strong></p>
+ <table width="200" border="0" id="order1">
+ <?php
+ $id = $_SESSION["id"];
+$sql = "select
B_Name,B_Addr_Line1,B_Addr_Line2,B_City,B_Zip,B_Phone,B_Country \n"
+ . "from Customer_BillingInfo\n"
+ . "where Customer_ID = '$id'\n";
+ $result = mysql_query($sql) ;
+ while($row = mysql_fetch_assoc($result)){ ?>
+ <tr id="order">
+ <td><strong>Name</strong></td><td><?php echo
$row['B_Name'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Address</strong></td><td><?php echo
$row['B_Addr_Line1'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Address2</strong></td><td><?php echo
$row['B_Addr_Line2'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>City</strong></td><td><?php echo
$row['B_City'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Zip</strong></td><td><?php echo $row['B_Zip'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Phone</strong></td><td><?php echo
$row['B_Phone'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Country</strong></td><td><?php echo
$row['B_Country'];?></td>
+ </tr>
+ <?php }?>
+ </table>
+ <p><a href="#">[Edit billing info]</a></p>
+ <p><strong>Shipping info</strong></p>
+ <table width="200" border="0" id="order1">
+ <?php
+ $id = $_SESSION["id"];
+$sql = "select S_Name,S_Addr_Line1,S_City, S_Country\n"
+ . "from Customer_ShippingInfo\n"
+ . "where Customer_ID = '$id'\n";
+ $result = mysql_query($sql) ;
+ while($row = mysql_fetch_assoc($result)){ ?>
+ <tr id="order">
+ <td><strong>Name</strong></td><td><?php echo
$row['S_Name'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Address</strong></td><td><?php echo
$row['S_Addr_Line1'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>City</strong></td><td><?php echo
$row['S_City'];?></td>
+ </tr>
+ <tr id="order">
+ <td><strong>Country</strong></td><td><?php echo
$row['S_Country'];?></td>
+ </tr>
+ <?php }?>
+ </table>
+
+<td width="100"><p><h2>Past Orders</h2></p>
+ <table width="700" border="0" id="order" >
+ <tr bgcolor="#eeeeee">
+ <td width="95"><strong>Order No.</strong></td>
+ <td width="300"><strong>Title</strong></td>
+ <td width="106"><strong>Quantity</strong></td>
+ <td width="106"><strong>Price</strong></td>
+ <td width="106"><strong>Total Price</strong></td>
+
+ <td width="80"><strong>Status</strong></td>
+ </tr>
+ <?php
+
+
+ $id = $_SESSION["id"];
+$sql = "SELECT od.orderid AS orderID, b.title AS title, b.price AS price,
ord_b.quantity AS quantity\n"
+ . " FROM booksnine.Order od,booksnine.Order_Book ord_b,
booksnine.Books b\n"
+ . " WHERE od.customer_ID = '$id'\n"
+ . " AND od.orderid = ord_b.orderid\n"
+ . " AND ord_b.bookid = b.bookid"
+ . "";
+
+
+
+ $result = mysql_query($sql) ;
+ while($row = mysql_fetch_assoc($result)){ ?>
+ <tr id="orderbody">
+
+ <td><?php echo $row['orderID'];?></td>
+ <td ><a href="index.php?bid=.$row['bookid'];."><?php echo
$row['title'];?> </a></td>
+ <td><?php echo $row['quantity'] ."&nbsp;"."Books";?></td>
+ <td><?php echo $row['price'];?></td>
+ <td><?php echo $row['quantity']*$row['price'];?></td>
+
+ <td> <img src="images/Process Icon.jpg" width="80" height="60"
alt="processing" /></td>
+
+ </tr>
+ <?php }?>
+ </table>
+ <p><strong></strong></p></td>
+ </tr>
+</table>
+<p>&nbsp;</p>
+</div>
+</body>
+
</html>

Sven Schmid

unread,
Dec 12, 2010, 11:01:12 AM12/12/10
to student...@googlegroups.com
Shah, why haven't you used my version of my-account.php to add your changes ????

In one of our skype meetings and in one of our emails we decided not to add colors.
The current version of my-account doesn't look similar to all the other pages of our project and has display bugs...

I will reset the version to my version and continue with coding this site.

Sven

Niraj Suthar

unread,
Dec 12, 2010, 11:53:10 AM12/12/10
to student...@googlegroups.com
I am agree with Sven, we are not using colors in our site. Further I have noticed that
MyAccount LogOut
links are not in all the pages.

Thank you,
Niraj

Sven Schmid

unread,
Dec 12, 2010, 1:31:47 PM12/12/10
to student...@googlegroups.com
tried to understand the behavior of customer session var - but no result...

So I won't work on my-account.php and we use Shahs version.

Sha: would you please remove the colors?


Sven

Valentin Despa

unread,
Dec 12, 2010, 1:37:36 PM12/12/10
to student...@googlegroups.com
what do you need about the customer session variable?

V

2010/12/12 Sven Schmid <sven.schm...@googlemail.com>

Sven Schmid

unread,
Dec 12, 2010, 1:40:11 PM12/12/10
to student...@googlegroups.com
i haven't found the customer-var (there is just the id stored, but not the object, as far as i could see)

Valentin Despa

unread,
Dec 12, 2010, 1:52:22 PM12/12/10
to student...@googlegroups.com
well, after the login, the session variables contian only the user id and his email address.

with the user id you can retreive any info from the database using the methods from the customer class.

let me know if this helps,

M.Shahnawaz

unread,
Dec 12, 2010, 2:51:59 PM12/12/10
to student...@googlegroups.com
 
Sven Its Done color removed...

my-account.php

Sven Schmid

unread,
Dec 12, 2010, 2:53:36 PM12/12/10
to student...@googlegroups.com
perfect ;o)

cu

Sven

> <my-account.php>

Valentin Despa

unread,
Dec 13, 2010, 11:05:49 AM12/13/10
to student...@googlegroups.com
Shah,

Please integrate your code into the design ASAP.

Also include some navigational buttons to get away from the my-account.php page using relative URLs.

Thanks,

V

2010/12/12 Sven Schmid <sven.schm...@googlemail.com>
perfect ;o)

M.Shahnawaz

unread,
Dec 13, 2010, 5:36:03 PM12/13/10
to student...@googlegroups.com
Where is design ?
 
give me the link.....

M.Shahnawaz

unread,
Dec 13, 2010, 6:32:42 PM12/13/10
to student...@googlegroups.com
DONE
my-account.php

Valentin Despa

unread,
Dec 14, 2010, 2:39:05 AM12/14/10
to student...@googlegroups.com
Shah,

- please post your updates to the repository, don't attach files here.

- I don't think you understand which one is our design. Look at the header of any other page and look at the header from my-account.php. You should see the difference immediately.

- the links on the books don't work. Fix them or remove the links.


Valentin


2010/12/14 M.Shahnawaz <sha...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages