ecommerce_user_contributions

one of the documented procedures in this installation of the ACS
Usage:
ecommerce_user_contributions   db   user_id   purpose
What it does:
Returns list items, one for each classified posting
Defined in: /web/philip/tcl/ecommerce-user-contributions-summary.tcl

Source code:


    if { $purpose != "site_admin" } {
	return [list]
    }
    if ![ad_parameter EnabledP ecommerce 0] {
	return [list]
    }
    set moby_string ""
    append moby_string "<ul>
    <li>Ecommerce User Classes: [ec_user_class_display $db $user_id t]
    
    <p>

    <li><a href=\"/admin/ecommerce/customer-service/gift-certificates?user_id=$user_id\">Gift Certificates</a> (balance [ec_pretty_price [database_to_tcl_string $db "select ec_gift_certificate_balance($user_id) from dual"]])
    </ul>

    <h4>Addresses</h4>
    <ul>
    "

    set address_id_list [database_to_tcl_list $db "select address_id
from ec_addresses where user_id = $user_id"]

    foreach address_id $address_id_list  {
	append moby_string "<li>[ec_display_as_html [ec_pretty_mailing_address_from_ec_addresses $db $address_id]]<p>\n"
    }

    append moby_string "
    </ul>

    <h4>Order History</h4>

    [ec_all_orders_by_one_user $db $user_id]

    <h4>Customer Service History</h4>
    <ul>
    <li><a href=\"/admin/ecommerce/customer-service/interaction-summary?user_id=$user_id\">Interaction Summary</a>
    <li>Individual Issues:
    [ec_all_cs_issues_by_one_user $db $user_id]
    </ul>

    <h4>Product Reviews</h4>
    <ul>
    "

    set selection [ns_db select $db "select c.comment_id, p.product_name, comment_date
    from ec_product_comments c, ec_products p
    where c.product_id = p.product_id
    and user_id = $user_id"]

    while { [ns_db getrow $db $selection] } {
	set_variables_after_query
	append moby_string "<li>[util_AnsiDatetoPrettyDate $comment_date] : <a href=\"/admin/ecommerce/customer-reviews/one?[export_url_vars comment_id]\">$product_name</a>\n"
    }

    append moby_string "</ul>
    "
    if [empty_string_p $moby_string] {
	return [list]
    } else {
	return [list 0 "Ecommerce" $moby_string]
    }



philg@mit.edu