"
} else {
set Button_Prev "
"
}
# Define the Next Button
if [info exists next] {
set Button_Next "
"
} else {
set Button_Next "
"
}
# fetch the product record from the product database
MysqlConnectProdDB
set data [MysqlGrokRec $mysqlProdtbl Record_ID $record]
if {$data == 0} {
cw log 0 "record=$record; data=$data"
MysqlDisconnect
cw redirect search.html$nocache+prod@no force
}
DataStringToArray $data prod $cw_product_tablepath
cw stats PRODUCT $record $prod(Title)
if {[string length $prod(Series_Record_ID)]} {
set query "select Title from $mysqlProdtbl where Record_ID='$prod(Series_Record_ID)';"
set tmp [sql $query]
set seriesTitle [lindex [lindex $tmp 0] 0]
if {![string length $seriesTitle]} {
set seriesTitle "This series record is missing."
}
}
############### products in this Series ###################
set chiquery "SELECT Record_ID, Title FROM $mysqlProdtbl WHERE Series_Record_ID='$prod(Record_ID)' ORDER BY Title_Alpha"
set chiresult [sql $chiquery]
set itemrecs {}
set itemtitles {}
foreach item $chiresult {
lappend itemrecs [lindex $item 0]
lappend itemtitles [lindex $item 1]
}
set limit [llength $itemrecs]
################################ Related Titles ##############################
set results {}
set qaddition "AND (Record_Type='Product' OR Record_Type='Series')"
if {[string length $prod(General_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE General_Catalog_Page='$prod(General_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
if {[llength $results]} {
set catalog "General Catalog"
} elseif {[string length $prod(Guidance_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE Guidance_Catalog_Page='$prod(Guidance_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
if {[llength $results]} {
set catalog "Guidance Catalog"
} elseif {[string length $prod(Writing_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE Writing_Catalog_Page='$prod(Writing_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
if { [llength $results]} {
set catalog "Writing Catalog"
} elseif {[string length $prod(Health_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE Health_Catalog_Page='$prod(Health_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
set results [getindexlist Health_Catalog_Page $prod(Health_Catalog_Page)]
if {[llength $results]} {
set catalog "Health Catalog"
} elseif {[string length $prod(Primary_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE Primary_Catalog_Page='$prod(Primary_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
if {[llength $results]} {
set catalog "Primary_Catalog"
} elseif {[string length $prod(Internet_Catalog_Page)]} {
set query "SELECT Record_ID FROM $mysqlProdtbl WHERE Internet_Catalog_Page='$prod(Internet_Catalog_Page)' $qaddition ORDER BY Title_Alpha"
set results [sql $query]
if { [llength $results]} {
set catalog "Internet Catalog"
}
}
}
}
}
}
}
MysqlDisconnect
if {[string length $prod(Picture_File)] > 2} {
set TableWidth 100%
} else {
set TableWidth 75%
}
cw source $cw_templatePath/templateTop.tcl
### load facebook sdk
puts "
"
#### end facebook sdk
if {[llength $sdb(search_result_list)] == 1 && [string match $record $sdb(search_result_list)]} {
puts " | $sdb(listcriteria) | 1 item matches your request. |
Oops! Please enter a valid quantity.
" }
|
|
$prod(Title)" |
|
|---|
"
if { [string length $prod(Description)] } {
regsub -all {(/)*pdf/} $prod(Description) {/pdf/} prod(Description)
#cw log 2 "prod(Description)=$prod(Description)"
set pic [glob -nocomplain $cw_pkgdocroot/$itemimages/medium/$prod(Picture_File).JPG]
puts " "
}
set desStr "$prod(Description) "
} else {
set desStr ""
}
cw log 2 "bubbletext: $prod(Bubble_Text)"
puts " $prod(Bubble_Text) "
|
" ## If it's a Product record, display the Ordering Instructions ## and it's a Form... if { [string match Series $prod(Record_Type)]} { # List the titles in this series... set printoutputstring 0 set outputstring "
"
append outputstring "Titles in this series:
|
| This Title is part of the Series: $seriesTitle |
" } if {[regexp {^(Product|Series)$} $prod(Record_Type)] && [llength $prod(Catalog_Number_Web)]} { puts "
" if { [llength $results] > 1 && [info exists catalog] } { set sdb(catalog) $catalog set sdb(related_result_list) $results ### tell list.html come from which link #set sdb(fromcontent) 2 puts "