- fprintf(f,"<table border><tr><th colspan=\"2\">%s %s</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr>\n ",month,year);\r
-\r
- for_each(iplog,iplogs)\r
- {\r
- if(iplog->traffic)\r
- {\r
- fprintf(f,"<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
- i++, iplog->name, iplog->traffic, iplog->traffic>>10, iplog->guaranted);\r
- total+=iplog->traffic>>10;\r
- iplog->i=i;\r
- iplog->l=total;\r
- }\r
- }\r
- fprintf(f,"<tr><th colspan=\"3\" align=\"left\">Total:</th><th align=\"right\">%ld GB</th><th align=\"right\">%Ld kbps</th></tr>\n", total, line);\r
- fputs("</table>\n", f);\r
-\r
- if(i>10)\r
- {\r
- fputs("<a name=\"erp\"></a><p><table border><tr><th colspan=\"5\">Enterprise Research and Planning (ERP)</th></tr>\n",f);\r
- fputs("<tr><td>Analytic category</td>\n",f);\r
- fputs("<td colspan=\"2\" align=\"center\">Active Classes</td><td colspan=\"2\" align=\"center\">Data transfers</td></tr>\n",f);\r
-\r
- if_exists(iplog,iplogs,iplog->l>=total/4)\r
- {\r
- fprintf(f,"<tr><td>Top 25%% of traffic</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
- \r
- if_exists(iplog,iplogs,iplog->i==10)\r
- {\r
- fprintf(f,"<tr><td>Top 10 downloaders</td>\n");\r
- fprintf(f,"<th align=\"right\">10</th><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists(iplog,iplogs,iplog->l>=total/2)\r
- {\r
- fprintf(f,"<tr><td>Top 50%% of traffic</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><th align=\"right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists(iplog,iplogs,iplog->l>=4*total/5)\r
- {\r
- fprintf(f,"<tr><td>Top 80%% of traffic</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><th align=\"right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists (iplog,iplogs,iplog->i>=i/5)\r
- {\r
- fprintf(f,"<tr><td>Top 20%% downloaders</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists(iplog,iplogs,iplog->i>=i/4)\r
- {\r
- fprintf(f,"<tr><td>Top 25%% downloaders</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists(iplog,iplogs,iplog->i>=i/2)\r
- {\r
- fprintf(f,"<tr><td>Top 50%% downloaders</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- if_exists(iplog,iplogs,iplog->i>=4*i/5)\r
- {\r
- fprintf(f,"<tr><td>Top 80%% downloaders</td>\n");\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
- }\r
-\r
- fprintf(f,"<tr><td>All users, all traffic</td>\n");\r
- fprintf(f,"<th align=\"right\">%d</th><th align=\"right\">100 %%</th><th align=\"right\">%ld G</th><th align=\"right\">100 %%</th></tr>\n",i-1,total);\r
- fputs("</table>\n", f);\r
- }\r
-\r
- fprintf(f, stats_html_signature, version);\r
- fclose(f);\r
- puts(" done.");\r