-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgi_inventory.cpp
More file actions
24 lines (23 loc) · 947 Bytes
/
cgi_inventory.cpp
File metadata and controls
24 lines (23 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include "UI.hpp"
#include "Inventory.hpp"
// driver function for Inventory page
int main()
{
// create UI object
UI ui("Inventory");
Inventory inv;
// read inventory
inv.readInventory(ui.param("Inventory"));
std::cout << "<body>" << std::endl;
// color body
ui.color_body();
std::cout << "<form action=\"http://pathfinder.johnwack.com/cgi-bin/Pathfinder/Map.cgi\">" << std::endl
<< "<input type=\"hidden\" name=\"Inventory\" value=\"" << ui.param("Inventory") << "\">" << std::endl;
// checkbox list
ui.print_check_box_from_list(inv.get_inventory());
// create add to cart button
std::cout << "<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-5\"></div>\n <div class=\"col-sm-2\"><button type=\"submit\" class=\"button\">Add to Cart</button></div>\n <div class=\"col-sm-5\"></div>\n </div>\n</div>" << std::endl
<< "</form>" << std::endl
<< "</body>" << std::endl;
}