leon 01/08/23 16:48:56
Modified: freetrade2/install/mysql build.sql
freetrade2/modules/action GENERATE_SID
freetrade2/modules/database/mysql item
freetrade2/modules/screen contents welcome
Log:
getting new session_sku_varation schema going
Revision Changes Path
1.8 +2 -3 freetrade/freetrade2/install/mysql/build.sql
Index: build.sql
===================================================================
RCS file: /home/cvs/freetrade/freetrade2/install/mysql/build.sql,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- build.sql 2001/06/22 17:58:03 1.7
+++ build.sql 2001/08/23 23:48:55 1.8
@@ -2,12 +2,12 @@
** File: build.sql
** Description: FreeTrade Database Schema
**
-** Version: $Revision: 1.7 $
+** Version: $Revision: 1.8 $
** Created: 07/26/1999
** Author: Leon Atkinson
** Email: [EMAIL PROTECTED]
** CVS Author: $Author: leon $
-** Last Revised: $Date: 2001/06/22 17:58:03 $
+** Last Revised: $Date: 2001/08/23 23:48:55 $
**
*/
@@ -418,7 +418,6 @@
Session CHAR(24) NOT NULL,
SKU INT NOT NULL,
Quantity INT NOT NULL,
- Notes blob,
PRIMARY KEY(ID),
INDEX (Session),
1.5 +6 -3 freetrade/freetrade2/modules/action/GENERATE_SID
Index: GENERATE_SID
===================================================================
RCS file: /home/cvs/freetrade/freetrade2/modules/action/GENERATE_SID,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GENERATE_SID 2000/11/08 00:54:11 1.4
+++ GENERATE_SID 2001/08/23 23:48:55 1.5
@@ -2,14 +2,17 @@
/*
** File: GENERATE_SID
** Description: create an sid and create row in session table
- ** Version: $Revision: 1.4 $
+ ** Version: $Revision: 1.5 $
** Created: 03/15/99
** Author: Leon Atkinson
** Email: [EMAIL PROTECTED]
** CVS Author: $Author: leon $
- ** Last Revised: $Date: 2000/11/08 00:54:11 $
+ ** Last Revised: $Date: 2001/08/23 23:48:55 $
**
** Log : $Log: GENERATE_SID,v $
+ ** Log : Revision 1.5 2001/08/23 23:48:55 leon
+ ** Log : getting new session_sku_varation schema going
+ ** Log :
** Log : Revision 1.4 2000/11/08 00:54:11 leon
** Log : *** empty log message ***
** Log :
@@ -91,4 +94,4 @@
//if in debug mode, send results that echos SID
array_push($ActionResults, L_GENSID_SUCCESS . $sid);
}
-?>
\ No newline at end of file
+?>
1.25 +51 -9 freetrade/freetrade2/modules/database/mysql/item
Index: item
===================================================================
RCS file: /home/cvs/freetrade/freetrade2/modules/database/mysql/item,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- item 2001/08/23 21:58:55 1.24
+++ item 2001/08/23 23:48:55 1.25
@@ -2,14 +2,17 @@
/*
** File: item
** Description: functions needed for get info about items
- ** Version: $Revision: 1.24 $
+ ** Version: $Revision: 1.25 $
** Created: 6/10/1999
** Author: Leon Atkinson
** Email: [EMAIL PROTECTED]
** CVS Author: $Author: leon $
- ** Last Revised: $Date: 2001/08/23 21:58:55 $
+ ** Last Revised: $Date: 2001/08/23 23:48:55 $
**
** Log : $Log: item,v $
+ ** Log : Revision 1.25 2001/08/23 23:48:55 leon
+ ** Log : getting new session_sku_varation schema going
+ ** Log :
** Log : Revision 1.24 2001/08/23 21:58:55 leon
** Log : bug fixes
** Log :
@@ -746,7 +749,7 @@
"skuID"=>$DatabaseRow["skuID"],
"ExternalSKU"=>$DatabaseRow["ExternalSKU"],
"skuName"=>$DatabaseRow["skuName"],
- "Price"=>(($DatabaseRow["SalePrice"] > 0) ?
$DatabaseRow["SalePrice"] : $DatabaseRow["ListPrice"]),
+ "Price"=>$DatabaseRow["SalePrice"],
"itemName"=>$DatabaseRow["itemName"],
"Notes"=>$DatabaseRow["Notes"],
"usID"=>$DatabaseRow["usID"],
@@ -771,7 +774,7 @@
$data = array();
- $Query = "SELECT ss.ID, ss.Quantity, ss.Notes, ".
+ $Query = "SELECT ss.ID, ss.Quantity, ".
"s.ExternalSKU, s.Name AS SKUName, s.ListPrice, s.SalePrice, "
.
"s.AdditionalShipping, i.Name AS ItemName " .
"FROM session_sku ss, sku s, item i " .
@@ -792,7 +795,7 @@
$data[] = array(
"ID"=>$Row->ID,
"Quantity"=>$Row->Quantity,
- "Variation"=>unserialize($Row->Notes),
+ "Variation"=>getSessionSKUVariations($Row->ID),
"ExternalSKU"=>$Row->ExternalSKU,
"SKUName"=>$Row->SKUName,
"SalePrice"=>$Row->SalePrice,
@@ -805,6 +808,32 @@
}
+ function getSessionSKUVariations($id)
+ {
+ global $DatabaseLink;
+
+ $data = array();
+
+ $Query = "SELECT Variation, Qualifier " .
+ "FROM session_sku ss INNER JOIN session_sku_variation ssv ON
(ss.ID = ssv.SessionSKU) " .
+ "WHERE ss.ID = $id";
+ if(!($DatabaseResult = mysql_query($Query, $DatabaseLink)))
+ {
+ addToLog("Couldn't get basket contents!",
+ LOG_ANNOYANCE, __FILE__, __LINE__);
+ return(FALSE);
+ }
+
+ while($Row = mysql_fetch_object($DatabaseResult))
+ {
+ $data[$Row->Variation] = $Row->Qualifier;
+ }
+
+ return($data);
+
+ }
+
+
/*
** Function: insertSessionSKU
@@ -817,15 +846,28 @@
{
global $DatabaseLink;
- $Query = "INSERT INTO session_sku (Session, SKU, Quantity, Notes) " .
- "VALUES ('$session', $sku, $quantity, " .
- "'".serialize($variation)."')";
+ $Query = "INSERT INTO session_sku (Session, SKU, Quantity) " .
+ "VALUES ('$session', $sku, $quantity)";
if(!mysql_query($Query, $DatabaseLink))
{
addToLog("Couldn't update basket contents!",
+ LOG_ANNOYANCE, __FILE__, __LINE__);
+ return(FALSE);
+ }
+
+ $newrec = mysql_insert_id();
+
+ $Query = "INSERT INTO session_sku_variation VALUES ";
+ foreach($variation as $v)
+ {
+ $Query .= "($newrec, $v, ''),";
+ }
+ $Query = substr($Query, 0, -1);
+ if(!mysql_query($Query, $DatabaseLink))
+ {
+ addToLog("Couldn't update basket contents!",
LOG_ANNOYANCE, __FILE__, __LINE__);
- $error = mysql_error();
return(FALSE);
}
1.5 +5 -5 freetrade/freetrade2/modules/screen/contents
Index: contents
===================================================================
RCS file: /home/cvs/freetrade/freetrade2/modules/screen/contents,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- contents 2000/11/08 00:54:36 1.4
+++ contents 2001/08/23 23:48:56 1.5
@@ -7,7 +7,7 @@
** Author: Leon Atkinson
** Email: [EMAIL PROTECTED]
** CVS Author: $Author: leon $
- ** Last Revised: $Date: 2000/11/08 00:54:36 $
+ ** Last Revised: $Date: 2001/08/23 23:48:56 $
**
** Copyright (c) 1999 Working Dogs. All rights reserved.
*/
@@ -37,12 +37,12 @@
foreach($basket as $b)
{
//describe line item with item name and sku name
- $description = "{$b["ItemName"]} ({$b["SKUName"]})";
+ $description = prepareText("{$b["ItemName"]}
({$b["SKUName"]})");
if(is_array($b["Variation"]))
{
//loop over each variation
- foreach($b["Variation"] as $key=>$variation_ID)
+ foreach($b["Variation"] as $variation_ID=>$qualifier)
{
//get info about attribute and variation
$variation = getVariationInfo($variation_ID);
@@ -50,7 +50,7 @@
//add info to description of line item
$description .= "<BR>\n" .
- $attribute["Name"] . ": "
.$variation["Name"];
+
getTinyText(prepareText($attribute["Name"] . ": " .$variation["Name"]));
}
}
@@ -78,7 +78,7 @@
//print this table row
printTableRow("", array(
- prepareText($description),
+ $description,
$price,
$quantity . " " . $deleteButton
), FALSE);
1.9 +5 -3 freetrade/freetrade2/modules/screen/welcome
Index: welcome
===================================================================
RCS file: /home/cvs/freetrade/freetrade2/modules/screen/welcome,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- welcome 2001/08/23 21:58:56 1.8
+++ welcome 2001/08/23 23:48:56 1.9
@@ -2,14 +2,17 @@
/*
** File: welcome
** Description: default screen for site
- ** Version: $Revision: 1.8 $
+ ** Version: $Revision: 1.9 $
** Created: 05/18/1999
** Author: Leon Atkinson
** Email: [EMAIL PROTECTED]
** CVS Author: $Author: leon $
- ** Last Revised: $Date: 2001/08/23 21:58:56 $
+ ** Last Revised: $Date: 2001/08/23 23:48:56 $
**
** Log : $Log: welcome,v $
+ ** Log : Revision 1.9 2001/08/23 23:48:56 leon
+ ** Log : getting new session_sku_varation schema going
+ ** Log :
** Log : Revision 1.8 2001/08/23 21:58:56 leon
** Log : bug fixes
** Log :
@@ -40,7 +43,6 @@
**
** Copyright (c) 1999 Working Dogs. All rights reserved.
*/
-
?>
This is the home of a default installation of the Open Source project FreeTrade.<BR>
_______________________________________________
FreeTrade-dev mailing list
[EMAIL PROTECTED]
http://share.whichever.com/mailman/listinfo/freetrade-dev