# file: resltable.html # Copyright (c) 1996-2002 Cuesta Technologies, LLC # All rights reserved. # This document contains confidential and/or proprietary information # beloging to Cuesta Technologies, LLC. # Package: nep # # Purpose: Display the search result table. # # Requires: # set pageID PG_20 cw source searchlimit.tcl cw source mysql.tcl ### display the result table using sdb(curList) if { [info exists cw_args(curList)] } { set curList $cw_args(curList) } elseif { [string length $sdb(curList)] } { #cw log 2 "sdb(curList) is $sdb(curList)" set curList $sdb(curList) } else { set curList 0 } set sdb(curList) $curList set resLen [llength $sdb(search_result_list)] if {$resLen } { if {$resLen ==1} { cw redirect product$webPgExtn$nocache+record@$sdb(search_result_list) force } set defaultMax 200 set searchLimit 20 if {[string length $sdb(listLimit)]} { set searchLimit $sdb(listLimit) } #cw log 2 "searchLimit: $searchLimit" setupSearchLimit $searchLimit $sdb(search_result_list) $defaultMax set results [getListContentsAtIndex $curList] } else { set results {} } set sdb(displayListType) resultTable ### Default heading is the leading 6 items saved in sdb(resultTable_field). if {![llength $sdb(rtable_cols)]} { set sdb(rtable_cols) [lrange $cdb(resultTable_field) 0 6] } if {[info exists cw_vals(modTable_col)]} { set sdb(rtable_cols) $cw_vals(modTable_col) } ##cw log 2 "sdb(rtable_cols)>>>$sdb(rtable_cols)" cw source $new_cw_templatePath/templateSetup.tcl cw source $new_cw_templatePath/templateTop.tcl ######################## # Add your own code here ######################## puts "

Modify Table    Search Results List
$sdb(searchcriteria) $sdb(searchcriteria2) [llength $sdb(search_result_list)] items match your request.

" if {[llength $sdb(search_result_list)]} { DisplayListPagesMenu $curList head } foreach item $sdb(rtable_cols) { set newitem [mapelement $item $cdb(resultTable_field) $cdb(resultTable_show)] puts "" } puts "" set selectedFields $sdb(rtable_cols) set i 0 MysqlConnectProdDB foreach record $results { set flag 0 if {[expr $i % 2]} { set colorTDBg $cdb(colorTDBg2) } else { set colorTDBg $cdb(colorTDBg1) } set data [MysqlGrokRec $mysqlProductTable Record_ID $record] DataStringToArray $data prod $cw_tablepath puts "" ## Gayathri: 10/21/2002 added the Topic_Language_Arts to the otherCurriculums list set otherCurriculums {Topic_Social_Studies Topic_Science Topic_Math Topic_Language_Arts} foreach col $selectedFields { regsub "N/A" $prod($col) "" prod($col) ## use $display flag to decide displaying the column. set display 0 if {[string compare {{}} $prod($col)] && [string length $prod($col)]} { incr display } ## 08/27/02 Cindy: If at least one of the Curriculums Area fields has ## value, we need to display it. if {[string match Topic_Science $col] && !$display} { foreach cur $otherCurriculums { if {[string compare {{}} $prod($cur)] && [string length $prod($cur)]} { incr display break } } } if {$display} { switch $col { Title { set flagImg "" if {[regexp New $prod(Special)]} { append flagImg " " } if {[regexp Updated $prod(Special)]} { append flagImg " " } if {[regexp Spanish $prod(Special)]} { append flagImg " " } puts "" } else { puts "" } } puts "" incr i } MysqlDisconnect puts "
$newitem
$prod($col)$flagImg" #cw log 2 "prod($col): $prod($col)" } Grade_Begin { puts "$prod(Grade_Begin)" if {[string compare $prod(Grade_Begin) $prod(Grade_End)]} { puts "-$prod(Grade_End)" } } EI_Level_Begin { puts "$prod(EI_Level_Begin)" if {[string compare $prod(EI_Level_Begin) $prod(EI_Level_End)]} { puts "-$prod(EI_Level_End)" } } GR_Level_Begin { puts " $prod(GR_Level_Begin)" if {[string compare $prod(GR_Level_Begin) $prod(GR_Level_End)]} { puts "-$prod(GR_Level_End)" } } DRA_Level_Begin { puts " $prod(DRA_Level_Begin)" if {[string compare $prod(DRA_Level_Begin) $prod(DRA_Level_End)]} { puts "-$prod(DRA_Level_End)" } } EDL_Level_Begin { puts " $prod(EDL_Level_Begin)" if {[string compare $prod(EDL_Level_Begin) $prod(EDL_Level_End)]} { puts "-$prod(EDL_Level_End)" } } LX_Level_Begin { set tmpStr "" if {$prod($col) > 0} { append tmpStr "$prod($col)L" } else { append tmpStr " " } if {[string length $prod(LX_Level_End)] && [string compare $prod(LX_Level_Begin) $prod(LX_Level_End)]} { append tmpStr " - $prod(LX_Level_End)L" } puts $tmpStr } Topic_Science { puts "" if {[string compare {{}} $prod($col)]} { puts "[join $prod($col)
]
" incr flag } if {[string compare {{}} $prod(Topic_Social_Studies)]} { puts "[join $prod(Topic_Social_Studies)
]
" incr flag } if {[string compare {{}} $prod(Topic_Math)]} { puts "[join $prod(Topic_Math)
]
" incr flag } if {[string compare {{}} $prod(Topic_Language_Arts)]} { puts "[join $prod(Topic_Language_Arts)
]
" incr flag } if {$flag == 0} { puts " " } } default { if {[is_multi_field $col $cw_tablepath]} { puts "
[join $prod($col) ", "]" #cw log 2 "MULT: $col" } else { puts "$prod($col)" } } } puts " 

" if {[llength $sdb(search_result_list)]} { DisplayListPagesMenu $curList foot } cw source $new_cw_templatePath/templateBottom.tcl