10 #include <sys/socket.h>
13 #include <netinet/in.h>
23 void display_graphics_upload(char *description, char *check_cmd, char *uplurl)
30 display_error(&buf[4]);
33 wprintf("HTTP/1.0 200 OK\n");
35 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
36 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
37 wprintf("<B>Set/change %s</B>\n", description);
38 wprintf("</FONT></TD></TR></TABLE>\n");
40 wprintf("<CENTER>\n");
42 wprintf("<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"%s&which_room=%s\" METHOD=\"POST\">\n", uplurl, bstr("which_room"));
44 wprintf("You can upload any image directly from your computer,\n");
45 wprintf("as long as it is in GIF format (JPEG, PNG, etc. won't\n");
46 wprintf("work).<BR><BR>\n");
48 wprintf("Please select a file to upload:<BR>\n");
49 wprintf("<INPUT TYPE=\"FILE\" NAME=\"filename\" SIZE=\"35\">\n");
51 wprintf("<INPUT TYPE=\"SUBMIT\" VALUE=\"Upload\">\n");
52 wprintf("<INPUT TYPE=\"RESET\" VALUE=\"Reset Form\">\n");
54 wprintf("<A HREF=\"/display_main_menu\">Cancel</A>\n");
55 wprintf("</CENTER>\n");
59 void do_graphics_upload(char *upl_cmd)
66 if (WC->upload_length == 0) {
67 display_error("You didn't upload a file.\n");
73 display_error(&buf[4]);
76 bytes_remaining = WC->upload_length;
77 while (bytes_remaining) {
78 thisblock = ((bytes_remaining > 4096) ? 4096 : bytes_remaining);
79 serv_printf("WRIT %d", thisblock);
82 display_error(&buf[4]);
87 thisblock = extract_int(&buf[4], 0);
88 serv_write(&WC->upload[pos], thisblock);
89 pos = pos + thisblock;
90 bytes_remaining = bytes_remaining - thisblock;
96 display_success(&buf[4]);
103 void select_floor_to_edit_pic(void)
107 wprintf("HTTP/1.0 200 OK\n");
110 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
111 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
112 wprintf("<B>Select floor to edit label graphic</B>\n");
113 wprintf("</FONT></TD></TR></TABLE>\n");
116 for (a = 0; a < 128; ++a)
117 if (strlen(floorlist[a]) > 0) {
118 wprintf("<A HREF=\"/display_editfloorpic&which_floor=%d\">", a);
119 escputs(floorlist[a]);