Index: openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl 23 Jul 2001 05:50:06 -0000 1.2 +++ openacs-4/packages/ecommerce/www/admin/orders/gift-certificates.tcl 26 May 2002 04:36:50 -0000 1.3 @@ -1,41 +1,45 @@ -# /www/[ec_url_concat [ec_url] /admin]/orders/gift-certificates.tcl ad_page_contract { - View gift certificates. + View gift certificates. - @author Eve Andersson (eveander@arsdigita.com) - @creation-date Summer 1999 - @cvs-id gift-certificates.tcl,v 3.2.2.3 2000/08/16 21:07:10 seb Exp - @author ported by Jerry Asher (jerry@theashergroup.com) + @author Eve Andersson (eveander@arsdigita.com) + @creation-date Summer 1999 + @author ported by Jerry Asher (jerry@theashergroup.com) + @author revised by Bart Teeuwisse + @revision-date March 2002 + } { - {view_gift_certificate_state "reportable"} - {view_issue_date "all"} - {order_by "gift_certificate_id"} + {view_gift_certificate_state "reportable"} + {view_issue_date "last_24"} + {order_by "gift_certificate_id"} } ad_require_permission [ad_conn package_id] admin -doc_body_append "[ad_admin_header "Gift Certificate Purchase History"] +doc_body_append " + [ad_admin_header "Gift Certificate Purchase History"] -

Gift Certificate Purchase History

+

Gift Certificate Purchase History

-[ad_admin_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "Gift Certificate Purchase History"] + [ad_admin_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "Gift Certificate Purchase History"] -
+
-
-[export_form_vars view_issue_date order_by] + + [export_form_vars view_issue_date order_by] - - - - - - -
Gift Certificate StateIssue Date
+ + + + + + - + + +
Gift Certificate StateIssue Date
- - -" +doc_body_append " + + + " set issue_date_list [list [list last_24 "last 24 hrs"] [list last_week "last week"] [list last_month "last month"] [list all all]] @@ -63,79 +67,74 @@ } } -doc_body_append "\[ [join $linked_issue_date_list " | "] \] +doc_body_append " + \[ [join $linked_issue_date_list " | "] \] +
+ +
" -
+set gift_certificate_state_query_bit "and g.gift_certificate_state=:view_gift_certificate_state" - -
-" - -if { $view_gift_certificate_state == "reportable" } { - set gift_certificate_state_query_bit "and g.gift_certificate_state in ('authorized_plus_avs','authorized_minus_avs')" -} else { - set gift_certificate_state_query_bit "and g.gift_certificate_state=:view_gift_certificate_state" -} - if { $view_issue_date == "last_24" } { - #set issue_date_query_bit "and sysdate-g.issue_date <= 1" set issue_date_query_bit [db_map last_24] } elseif { $view_issue_date == "last_week" } { - #set issue_date_query_bit "and sysdate-g.issue_date <= 7" set issue_date_query_bit [db_map last_week] } elseif { $view_issue_date == "last_month" } { - #set issue_date_query_bit "and months_between(sysdate,g.issue_date) <= 1" set issue_date_query_bit [db_map last_month] } else { set issue_date_query_bit "" } set link_beginning "gift-certificates?[export_url_vars view_gift_certificate_state view_issue_date]" -set order_by_clause [util_decode $order_by \ - "gift_certificate_id" "g.gift_certificate_id" \ - "issue_date" "g.issue_date" \ - "gift_certificate_state" "g.gift_certificate_state" \ - "name" "u.last_name, u.first_names" \ - "recipient_email" "g.recipient_email" \ - "amount" "g.amount"] +set order_by_clause [ec_decode $order_by \ + "gift_certificate_id" "g.gift_certificate_id" \ + "issue_date" "g.issue_date" \ + "gift_certificate_state" "g.gift_certificate_state" \ + "name" "u.last_name, u.first_names" \ + "recipient_email" "g.recipient_email" \ + "amount" "g.amount"] -set table_header " - - - - - - - -" +set table_header " +
IDDate IssuedGift Certificate StatePurchased ByRecipientAmount
+ + + + + + + + " - - set row_counter 0 -db_foreach gift_certificates_select "select g.gift_certificate_id, g.issue_date, g.gift_certificate_state, g.recipient_email, g.purchased_by, g.amount, u.first_names, u.last_name -from ec_gift_certificates g, cc_users u -where g.purchased_by=u.user_id -$issue_date_query_bit $gift_certificate_state_query_bit -order by $order_by_clause -" { +db_foreach gift_certificates_select " + select g.gift_certificate_id, g.issue_date, g.gift_certificate_state, g.recipient_email, g.purchased_by, g.amount, u.first_names, u.last_name + from ec_gift_certificates g, cc_users u + where g.purchased_by=u.user_id + $issue_date_query_bit $gift_certificate_state_query_bit + order by $order_by_clause" { + if { $row_counter == 0 } { - doc_body_append $table_header + doc_body_append $table_header } - # even rows are white, odd are grey + + # Even rows are white, odd are grey + if { [expr floor($row_counter/2.)] == [expr $row_counter/2.] } { set bgcolor "white" } else { set bgcolor "ececec" } - doc_body_append " - - - - - - - " + doc_body_append " + + + + + + + " incr row_counter } @@ -145,7 +144,7 @@ doc_body_append "
None Found
" } -doc_body_append " +doc_body_append " + -[ad_admin_footer] -" + [ad_admin_footer]"
IDDate IssuedGift Certificate StatePurchased ByRecipientAmount
$gift_certificate_id[ec_nbsp_if_null [util_AnsiDatetoPrettyDate $issue_date]]$gift_certificate_state[ec_decode $last_name "" " " "$last_name, $first_names"]$recipient_email[ec_pretty_price $amount]
$gift_certificate_id[ec_nbsp_if_null [util_AnsiDatetoPrettyDate $issue_date]]$gift_certificate_state[ec_decode $last_name "" " " "$last_name, $first_names"]$recipient_email[ec_pretty_price $amount]