\r
/* == This function strips extra characters after IP address and stores it = */\r
\r
-void parse_ip(char *str)\r
+void parse_ip(struct IP *ip, char *str)\r
{\r
char *ptr,*ipaddr=NULL,*ipname=NULL,*lmsid=NULL;\r
\r
f=fopen(str,"w");\r
if(f)\r
{\r
- 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
+ fprintf(f,"<table border><tr><th colspan=\"2\">%s %s</th><th align=\"right\">lms</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
+ fprintf(f,"<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">", i++, iplog->name); \r
+ if(iplog->lmsid > 0)\r
+ {\r
+ /*base URL will be configurable soon ... */\r
+ fprintf(f,"<a href=\"https://hermes.spoje.net/?m=customerinfo&id=%d\">%04d</a>\n", iplog->lmsid, iplog->lmsid);\r
+ }\r
+ else if(iplog->lmsid == 0)\r
+ {\r
+ fputs("-------",f);\r
+ } \r
+ fprintf(f,"<td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
+ 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
+ fprintf(f,"<tr><th colspan=\"4\" 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
if(substring)\r
{ \r
substring+=8; //"sharing-"\r
- parse_ip(str);\r
+ parse_ip(ip, str);\r
ip_count++;\r
ip->sharing=substring;\r
ip->keyword=defaultkeyword; /* settings for default keyword */\r
\r
if_exists(keyword,keywords,(substring=strstr(str,keyword->key)))\r
{\r
- parse_ip(str);\r
+ parse_ip(ip, str);\r
ip_count++;\r
ip->keyword=keyword;\r
keyword->ip_count++;\r
}\r
else if(ip->lmsid == 0)\r
{\r
- fputs("------",f);\r
+ fputs("-------",f);\r
}\r
fputs("</td>\n",f); \r
}\r