version 0.2.14
[fms.git] / src / http / pages / homepage.cpp
index f305f30..1a65cf4 100644 (file)
@@ -9,6 +9,9 @@
 const std::string HomePage::GeneratePage(const std::string &method, const std::map<std::string,std::string> &queryvars)\r
 {\r
 \r
+       std::string messagecountstr="";\r
+       std::string filecountstr="";\r
+\r
        if(queryvars.find("formaction")!=queryvars.end() && (*queryvars.find("formaction")).second=="shutdown")\r
        {\r
                wantshutdown=true;\r
@@ -21,12 +24,29 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m
        content+="</b><br>";\r
        content+="Use these pages to administer your FMS installation.";\r
        content+="</p>";\r
+\r
+       SQLite3DB::Statement st=m_db->Prepare("SELECT COUNT(*) FROM tblMessageInserts WHERE Inserted='false';");\r
+       st.Step();\r
+       if(st.RowReturned())\r
+       {\r
+               st.ResultText(0,messagecountstr);\r
+       }\r
+       content+="Messages waiting to be inserted:"+messagecountstr+"<br>";\r
+       st=m_db->Prepare("SELECT COUNT(*) FROM tblFileInserts WHERE Key IS NULL;");\r
+       st.Step();\r
+       if(st.RowReturned())\r
+       {\r
+               st.ResultText(0,filecountstr);\r
+       }\r
+       content+="Files waiting to be inserted:"+filecountstr+"<br>";\r
+\r
        content+="<p class=\"paragraph\">";\r
        content+="<form name=\"frmshutdown\" method=\"POST\">";\r
        content+="<input type=\"hidden\" name=\"formaction\" value=\"shutdown\">";\r
        content+="<input type=\"submit\" value=\"Shutdown FMS\">";\r
        content+="</form>";\r
        content+="</p>";\r
+\r
        return "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"+StringFunctions::Replace(m_template,"[CONTENT]",content);\r
 }\r
 \r