diff --git a/.gitignore b/.gitignore
index 4449841..73771fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-/src/main/resources/static/resources
+/src/main/resources/static/resources/metadata
/src/main/java/tctable
/logs/
diff --git a/src/main/resources/static/resources/QGIS/IVI.qgs b/src/main/resources/static/resources/QGIS/IVI.qgs
new file mode 100644
index 0000000..0459ad8
--- /dev/null
+++ b/src/main/resources/static/resources/QGIS/IVI.qgs
@@ -0,0 +1,326 @@
+
+
Connect is ERROR
");
+ }
+ }catch(Exception e)
+ {
+ out.write("
Connect Exception:"+e.getMessage()+"
");
+}
+
+
+//Select language for current user
+String user_id = (String)request.getSession().getAttribute("USER_ID");
+if(user_id==null) user_id="null";
+
+Statement st = conn.createStatement();
+ResultSet rs=null;
+try {
+ String sql="select l.short_name lng from main._users u LEFT JOIN main._languages l ON l.id = u.language_id where u.id="+user_id+";";
+ rs = st.executeQuery(sql);
+} catch( SQLException ex )
+{
+ out.write("
SQLException:"+ex.getMessage()+"
");
+}
+
+if(rs!=null)
+{
+ while (rs.next())
+ {
+ m_locale = rs.getString("lng");
+ }
+}
+st.close();
+
+String jspPath = application.getRealPath("/")+"QGIS/";
+
+String fileAsString="";
+String name=request.getParameter("name");
+
+//Pods (кубышки)
+if(name!=null && (name.equals("frmlocust_pods_density") || name.equals("frmlocust_hoppers_density") || name.equals("frmlocust_bands") || name.equals("frmlocust_adults_density") || name.equals("frmlocust_swarms")))
+{
+ fileAsString = fileToString(jspPath + name + ".qgs");
+
+ String country_id=request.getParameter("country_id");
+ String locust_type_id=request.getParameter("locust_type_id");
+ String date_start=request.getParameter("date_start");
+ String date_end=request.getParameter("date_end");
+ String registered=request.getParameter("registered");
+
+ //Make SQL
+ String sql = "1=1";
+ String sql2 = "1=1";
+ if(country_id!=null && !country_id.equals(""))
+ {
+ if(country_id.equals("-1"))
+ {
+ sql+=" and country_id in (7,3,4,2)";
+ sql2+=" and country_id in (7,3,4,2)";
+ }else if(country_id.equals("-2"))
+ {
+ sql+=" and country_id in (7,1,5,6,8,9,10)";
+ sql2+=" and country_id in (7,1,5,6,8,9,10)";
+ }else
+ {
+ sql+=" and country_id="+country_id;
+ sql2+=" and country_id="+country_id;
+ }
+ }
+ if(locust_type_id!=null && !locust_type_id.equals(""))
+ {
+ sql+=" and locust_type_id="+locust_type_id;
+ }
+ if(date_start!=null && !date_start.equals(""))
+ {
+ sql+=" and date>='"+date_start+"'";
+ }
+ if(date_end!=null && !date_end.equals(""))
+ {
+ sql+=" and date<='"+date_end+"'";
+ }
+
+ if(registered!=null && registered.equals("1"))
+ {
+ sql+=" and registered=true";
+ }else
+ if(registered!=null && registered.equals("0"))
+ {
+ sql+=" and registered=false";
+ }
+
+ //Apply variables to text
+ fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
+
+ fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
+
+}
+
+if(name!=null && name.equals("frmlocustdel"))
+{
+ fileAsString = fileToString(jspPath + name + ".qgs");
+
+ String country_id=request.getParameter("country_id");
+ String date_start=request.getParameter("date_start");
+ String date_end=request.getParameter("date_end");
+ String registered=request.getParameter("registered");
+
+ //Make SQL
+ String sql = "1=1";
+ String sql2 = "1=1";
+ if(country_id!=null && !country_id.equals(""))
+ {
+ //sql+=" and country_id="+country_id;
+ if(country_id.equals("-1"))
+ {
+ sql+=" and country_id in (7,3,4,2)";
+ sql2+=" and country_id in (7,3,4,2)";
+ }else if(country_id.equals("-2"))
+ {
+ sql+=" and country_id in (7,1,5,6,8,9,10)";
+ sql2+=" and country_id in (7,1,5,6,8,9,10)";
+ }else
+ {
+ sql+=" and country_id="+country_id;
+ sql2+=" and country_id="+country_id;
+ }
+ }
+ if(date_start!=null && !date_start.equals(""))
+ {
+ sql+=" and date>='"+date_start+"'";
+ }
+ if(date_end!=null && !date_end.equals(""))
+ {
+ sql+=" and date<='"+date_end+"'";
+ }
+
+ if(registered!=null && registered.equals("1"))
+ {
+ sql+=" and registered=true";
+ }else
+ if(registered!=null && registered.equals("0"))
+ {
+ sql+=" and registered=false";
+ }
+
+ //Apply variables to text
+ fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
+
+ fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
+}
+
+if(name!=null && (name.equals("frmlocustinfo_p2") || name.equals("frmlocustinfo_p3") || name.equals("frmlocustinfo_p4")))
+{
+ String country_id=request.getParameter("country_id");
+ String year=request.getParameter("year");
+ String locust_type_id=request.getParameter("locust_type_id");
+
+ //Make SQL
+ String sql = "1=1";
+ if(country_id!=null && !country_id.equals(""))
+ {
+ if(country_id.equals("-1"))
+ {
+ sql+=" and country_id in (7,3,4,2)";
+ }else if(country_id.equals("-2"))
+ {
+ sql+=" and country_id in (7,1,5,6,8,9,10)";
+ }else
+ {
+ sql+=" and country_id="+country_id;
+ }
+ }
+ if(locust_type_id!=null && !locust_type_id.equals(""))
+ {
+ sql+=" and locust_type_id="+locust_type_id;
+ }
+
+ String fileName = jspPath + name + ".qgs";
+ fileAsString = fileToString(fileName);
+ //Apply variables to text
+ fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
+ fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
+}
+
+if(name!=null && (name.equals("frmlocustinfo_p2r") || name.equals("frmlocustinfo_p3r") || name.equals("frmlocustinfo_p4r")))
+{
+ String region_id=request.getParameter("region_id");
+ String year=request.getParameter("year");
+ String locust_type_id=request.getParameter("locust_type_id");
+
+ //Make SQL
+ String sql = "1=1";
+ if(region_id!=null && !region_id.equals(""))
+ {
+ sql+=" and region_id="+region_id;
+ }
+ if(locust_type_id!=null && !locust_type_id.equals(""))
+ {
+ sql+=" and locust_type_id="+locust_type_id;
+ }
+
+ String fileName = jspPath + name + ".qgs";
+ fileAsString = fileToString(fileName);
+ //Apply variables to text
+ fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
+ fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
+}
+
+if(name!=null && name.equals("weather"))
+{
+ String country_id=request.getParameter("country_id");
+ String country_name=request.getParameter("country_name");
+
+ //Make SQL
+ String sql2 = "1=1";
+ if(country_id!=null && !country_id.equals(""))
+ {
+ //sql+=" and country_id="+country_id;
+ if(country_id.equals("-1"))
+ {
+ sql2+=" and country_id in (7,3,4,2)";
+ }else if(country_id.equals("-2"))
+ {
+ sql2+=" and country_id in (7,1,5,6,8,9,10)";
+ }else
+ {
+ sql2+=" and country_id="+country_id;
+ }
+ }
+
+ String fileName = jspPath + name + ".qgs";
+ fileAsString = fileToString(fileName);
+ //Apply variables to text
+ fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
+
+ fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
+}
+if(name!=null && name.equals("NDVI"))
+{
+
+ String fileName = jspPath + "NDVI.qgs";
+ fileAsString = fileToString(fileName);
+}
+if(name!=null && name.equals("NDWI"))
+{
+
+ String fileName = jspPath + "NDWI.qgs";
+ fileAsString = fileToString(fileName);
+}
+
+//Send file to client.
+response.setHeader("Content-Disposition", "attachment;filename=Locust.qgs");
+out.write(fileAsString); //out.write(getText(fileAsString));
+
+%>
\ No newline at end of file
diff --git a/src/main/resources/static/resources/QGIS/precipitation.qgs b/src/main/resources/static/resources/QGIS/precipitation.qgs
new file mode 100644
index 0000000..4befaf7
--- /dev/null
+++ b/src/main/resources/static/resources/QGIS/precipitation.qgs
@@ -0,0 +1,1924 @@
+
+
Connect is ERROR
");
+ }
+}catch(Exception e)
+{
+ out.write("
Connect Exception:"+e.getMessage()+"
");
+}
+
+Statement st = conn.createStatement();
+ResultSet rs=null;
+try {
+ String sql="select id,name,ST_AsGeoJSON(geom,3,0) as geom from main."+table+" where id="+id+";";
+ rs = st.executeQuery(sql);
+} catch( SQLException ex )
+{
+ out.write("
SQLException:"+ex.getMessage()+"
");
+}
+
+if(rs!=null)
+{
+ while (rs.next())
+ {
+ String geom=null;
+ try {
+ geom=rs.getString("geom");
+ } catch( Exception ex )
+ {
+ out.write("
SQLException:"+ex.getMessage()+"
");
+ System.out.println("Error: "+ex.getMessage());
+ }
+ if(geom==null) geom="";
+ out.write(geom);
+ }
+}
+st.close();
+
+
+conn.close();
+
+%>
diff --git a/src/main/resources/static/resources/engine/help.png b/src/main/resources/static/resources/engine/help.png
new file mode 100644
index 0000000..604dbd4
Binary files /dev/null and b/src/main/resources/static/resources/engine/help.png differ
diff --git a/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.docx b/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.docx
new file mode 100644
index 0000000..df7fd5e
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.docx differ
diff --git a/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.pdf b/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.pdf
new file mode 100644
index 0000000..fbf8fba
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/ASDC_for_Android_ENG.pdf differ
diff --git a/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.docx b/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.docx
new file mode 100644
index 0000000..c3df063
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.docx differ
diff --git a/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.pdf b/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.pdf
new file mode 100644
index 0000000..1146652
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/ASDC_for_Android_RUS.pdf differ
diff --git a/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_ENG.doc b/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_ENG.doc
new file mode 100644
index 0000000..3eec553
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_ENG.doc differ
diff --git a/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_RUS.doc b/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_RUS.doc
new file mode 100644
index 0000000..88de428
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/Administration CCALM v 0.3_RUS.doc differ
diff --git a/src/main/resources/static/resources/engine/help/CCALM_help_ENG.doc b/src/main/resources/static/resources/engine/help/CCALM_help_ENG.doc
new file mode 100644
index 0000000..b62a481
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/CCALM_help_ENG.doc differ
diff --git a/src/main/resources/static/resources/engine/help/CCALM_help_ENG.pdf b/src/main/resources/static/resources/engine/help/CCALM_help_ENG.pdf
new file mode 100644
index 0000000..035ab11
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/CCALM_help_ENG.pdf differ
diff --git a/src/main/resources/static/resources/engine/help/CCALM_help_RUS.docx b/src/main/resources/static/resources/engine/help/CCALM_help_RUS.docx
new file mode 100644
index 0000000..831a1f7
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/CCALM_help_RUS.docx differ
diff --git a/src/main/resources/static/resources/engine/help/CCALM_help_RUS.pdf b/src/main/resources/static/resources/engine/help/CCALM_help_RUS.pdf
new file mode 100644
index 0000000..9ee934c
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/CCALM_help_RUS.pdf differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_EN.doc b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_EN.doc
new file mode 100644
index 0000000..f613656
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_EN.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_RU.doc b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_RU.doc
new file mode 100644
index 0000000..bc9fc96
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Inspector_DRAFT_RU.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_EN.doc b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_EN.doc
new file mode 100644
index 0000000..4450290
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_EN.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_RU.doc b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_RU.doc
new file mode 100644
index 0000000..18ac6f4
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/ASDC_User_Manual_Operator_DRAFT_RU.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/Application_Inspector_ASDC_RU.doc b/src/main/resources/static/resources/engine/help/OLD/Application_Inspector_ASDC_RU.doc
new file mode 100644
index 0000000..7bb291e
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/Application_Inspector_ASDC_RU.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/How_to_configure_the_Internet_connection_via_the_operator_Beeline_RU.doc b/src/main/resources/static/resources/engine/help/OLD/How_to_configure_the_Internet_connection_via_the_operator_Beeline_RU.doc
new file mode 100644
index 0000000..1ab0234
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/How_to_configure_the_Internet_connection_via_the_operator_Beeline_RU.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/How_to_set_up_WIFI_connection_on_your_Android_tablet_RU.doc b/src/main/resources/static/resources/engine/help/OLD/How_to_set_up_WIFI_connection_on_your_Android_tablet_RU.doc
new file mode 100644
index 0000000..58ff22f
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/How_to_set_up_WIFI_connection_on_your_Android_tablet_RU.doc differ
diff --git a/src/main/resources/static/resources/engine/help/OLD/MultiLing_Keyboard.doc b/src/main/resources/static/resources/engine/help/OLD/MultiLing_Keyboard.doc
new file mode 100644
index 0000000..6e27778
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/OLD/MultiLing_Keyboard.doc differ
diff --git a/src/main/resources/static/resources/engine/help/QGIS_Guide_ENG.doc b/src/main/resources/static/resources/engine/help/QGIS_Guide_ENG.doc
new file mode 100644
index 0000000..30fc08f
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/QGIS_Guide_ENG.doc differ
diff --git a/src/main/resources/static/resources/engine/help/QGIS_Guide_RUS.doc b/src/main/resources/static/resources/engine/help/QGIS_Guide_RUS.doc
new file mode 100644
index 0000000..878f6ea
Binary files /dev/null and b/src/main/resources/static/resources/engine/help/QGIS_Guide_RUS.doc differ
diff --git a/src/main/resources/static/resources/engine/help/index.html b/src/main/resources/static/resources/engine/help/index.html
new file mode 100644
index 0000000..2a6dad3
--- /dev/null
+++ b/src/main/resources/static/resources/engine/help/index.html
@@ -0,0 +1,37 @@
+
+
+
|
+ + + |
+
| + + + | +
| + |
| '+trt('Year')+' | '+trt('Average')+' | '+trt('Thous_ha')+' | '+trt('Dev_of_average')+' |
|---|---|---|---|
| 2005 | | 3 | |
| 2006 | 2 | 30 | |
| 2007 | 2 | 300 |
| >15% | '+trt('Increase')+' | |
| >=15% '+trt('and')+' <=15% | '+trt('On_the_same_level')+' | |
| <15% | '+trt('Decrease')+' | |
| '+trt('No_data')+' |
| >15% | '+trt('Increase')+' | |
| >=15% '+trt('and')+' <=15% | '+trt('On_the_same_level')+' | |
| <15% | '+trt('Decrease')+' | |
| '+trt('No_data')+' |
| >-25% '+trt('and')+' <25% | '+trt('Normal_Multiyear_average_level')+' | |
| <=-25% '+trt('or')+' >=25% | '+trt('Danger')+' | |
| '+trt('No_data')+' |
| >1 | '+trt('Danger')+' | |
| <=1 | '+trt('Attention')+' | |
| =0 | '+trt('Quietly')+' | |
| '+trt('No_data')+' |
| >=5 | '+trt('Danger')+' | |
| >=3 ... <5 | '+trt('Caution')+' | |
| <=2 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=1 | '+trt('Danger')+' | |
| <1 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=5 | '+trt('Danger')+' | |
| >=3 ... <5 | '+trt('Caution')+' | |
| <=2 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=1 | '+trt('Danger')+' | |
| <1 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >1 | '+trt('Danger')+' | |
| <=1 | '+trt('Attention')+' | |
| =0 | '+trt('Quietly')+' | |
| '+trt('No_data')+' |
| >=5 | '+trt('Danger')+' | |
| >=3 ... <5 | '+trt('Caution')+' | |
| <=2 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=1 | '+trt('Danger')+' | |
| <1 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=5 | '+trt('Danger')+' | |
| >=3 ... <5 | '+trt('Caution')+' | |
| <=2 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| >=1 | '+trt('Danger')+' | |
| <1 | '+trt('Calm')+' | |
| '+trt('No_data')+' |
| '+trt('Spraying')+' |
| Описание | +Название | +ID объекта | +
| Описание | +Название | +ID объекта | +
|
+ + + + Поля= Поле= + + + Колонки= Колонка= |
+
+ |
+
+ |
+