/* Author: Ram Samudrala (me@ram.org) * Version: O1.0 * Detail: * November 30, 1996; Copyright (c) 1995 by Ram Samudrala. * * See the URL above for terms of use and general help. */ #include "cgi_common.h" #include "cgi_defines.h" #include "sc_defines.h" #include "items.h" /******************************************************************/ void display_item_list(item items[]) { int i; char item_string[20]; printf("\n"); printf("\n"); for(i = 1; i <= total_items(&items); i++) { if (item_ql(&items[i]) == item_qh(&items[i])) sprintf(item_string, "%d", item_ql(&items[i])); else if (item_qh(&items[i]) == MAX_QUANTITY_PER_ITEM) sprintf(item_string, "%d+", item_ql(&items[i])); else sprintf(item_string, "%d-%d", item_ql(&items[i]), item_qh(&items[i])); printf("\n", item_name(&items[i]), DEFAULT_INPUT_FIELD_SIZE, item_description(&items[i]), item_string, item_price(&items[i])); } printf("
Item Quantity Price
%s %s $%7.2f each
"); return; } /******************************************************************/