Download reports repair

This commit is contained in:
Igor I
2025-07-14 15:07:32 +05:00
parent d2c1f9c7da
commit d254140b91
3 changed files with 464 additions and 86 deletions

View File

@ -1,12 +1,10 @@
package org.ccalm.main; package org.ccalm.main;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.sql.*; import java.sql.*;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Properties; import java.util.Properties;
import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
//import javax.servlet.ServletContext; //import javax.servlet.ServletContext;
@ -21,7 +19,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.http.CacheControl; import org.springframework.http.CacheControl;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -30,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.ServletContextAware; import org.springframework.web.context.ServletContextAware;
import org.ccalm.main.TranslationUtils;
import tools.DBTools; import tools.DBTools;
import tools.User; import tools.User;

View File

@ -1,97 +1,382 @@
<html> <!DOCTYPE html>
<head> <html lang="en-GB">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <head>
<link rel="shortcut icon" href="./resources/favicon.ico" /> <meta charset="UTF-8">
<title>Automated system of data collection</title> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="yandex-verification" content="2cb5374be0668fe9" /> <meta name="description" content="Caucasus and Central Asia Locust Management System (CCALM) - A sophisticated system for monitoring and analysing locust populations in the CCA region using GIS and remote sensing.">
<meta name="keywords" content="CCALM, Locust Management, Caucasus, Central Asia, Agriculture, Pest Control, GIS, Remote Sensing, Environmental Monitoring, FAO">
<meta name="author" content="CCALM">
<script src="../resources/metadata/dbms/tools.js?v=9"></script> <title>Caucasus and Central Asia Locust Management System (CCALM)</title>
<script src="../resources/metadata/dbms/window.js?v=10"></script>
<meta name="description" content="According to the implementation of the Road Map program to improve national and regional locust control in the Caucasus and Central Asia (CCA) developed a system of monitoring and analysis designed to control locusts in the CCA using a geographic information system and remote sensing technology"> <!-- Favicon -->
<link rel="icon" href="https://ccalm.org/resources/images/locust.png" type="image/x-icon">
<style type="text/css"> <!-- Google Fonts -->
html,body <link rel="preconnect" href="https://fonts.googleapis.com">
{ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
height:100%; <link href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
min-height:100%;
margin:0px; <!-- Phosphor Icons -->
padding:0px; <script src="https://unpkg.com/@phosphor-icons/web"></script>
text-align:center;
background-color: #f0f0f0; <!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<style>
/* Define custom properties (CSS variables) for a consistent and maintainable theme */
:root {
/* These will be populated by JavaScript from the config object */
} }
.content
{ /* Base body styling */
max-width:960px; body {
height:100%; font-family: var(--font-primary);
min-height:100%; background-color: var(--color-bg-core);
margin:0 auto; color: #374151; /* A neutral, dark grey for text */
text-align:left; scroll-behavior: smooth;
background-color: #ffffff; }
/* Header with a single green background color */
.wave-header {
background: var(--color-wave-3); /* Single green line as requested */
position: relative;
color: var(--color-text-on-wave);
}
/* A more refined SVG wave shape for a sophisticated transition */
.wave-header::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100px; /* Adjusted wave height */
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23F8F7F2' fill-opacity='1' d='M0,224L1440,128L1440,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: cover;
background-position: bottom;
transform: translateY(1px); /* Prevents rendering gaps */
}
/* Enhanced button styling for a more interactive feel */
.btn-custom {
background-color: var(--color-button);
color: white;
font-weight: 600;
padding: 0.85rem 2.5rem; /* Slightly larger padding */
border-radius: 0.5rem;
transition: all 0.3s ease;
display: inline-block;
text-decoration: none;
box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}
.btn-custom:hover {
background-color: var(--color-button-hover);
transform: translateY(-3px) scale(1.03);
box-shadow: 0 7px 20px 0 rgba(0, 0, 0, 0.15);
}
/* Enhanced card styling with improved shadows and hover effects */
.info-card {
background-color: white;
border: 1px solid #E5E7EB;
border-radius: 0.75rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover {
transform: translateY(-8px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
}
/* Styling for the icon container within the cards */
.icon-container {
width: 80px;
height: 80px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #f0fdf4; /* A very light green */
color: var(--color-button);
transition: all 0.3s ease;
}
.info-card:hover .icon-container {
background-color: var(--color-button);
color: white;
transform: scale(1.1);
}
/* Animation classes for scroll-triggered fade-in effects */
.fade-in-section {
opacity: 0;
transform: translateY(20px);
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-section.is-visible {
opacity: 1;
transform: translateY(0);
}
/* Language selector styling */
.language-selector {
position: absolute;
top: 20px;
right: 20px;
z-index: 50;
}
.language-button {
background: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 0.5rem;
padding: 0.5rem 1rem;
color: #374151;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 0.5rem;
}
.language-button:hover {
background: rgba(255, 255, 255, 1);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.language-button.active {
background: var(--color-button);
color: white;
} }
</style> </style>
<script type="text/javascript"> </head>
<body class="antialiased">
function setCookie (name, value, expires, path, domain, secure) <!--
{ Website configuration object.
var exdate=new Date(); All user-facing text, colors, fonts, and URLs are defined here.
exdate.setDate(exdate.getDate() + expires); This makes the site easily editable without touching the HTML structure.
expires=exdate.toUTCString() -->
<script>
const config = {
// Text content
en: {
title: "Caucasus and Central Asia Locust Management System (CCALM)",
introText: `The Automated System for Data Collection (ASDC) and the Geographic Information System (GIS) "Caucasus and Central Asia Locust Management System (CCALM)" were created as part of the "Programme to improve national and regional locust management in Caucasus and Central Asia (CCA)", implemented by the Food and Agriculture Organization (FAO) of the United Nations to the benefit of ten countries. Used on tablets or smartphones, ASDC allows field data collection during locust survey and control and near real-time transmission to the GIS. CCALM, filled with ASDC data and other sources (satellite products), aims at improving analysis, forecasting and reporting at national and regional levels and as such contributes to early warning and early reaction.`,
card1: {
title: "Automated System for Data Collection (ASDC)",
buttonText: "Download ASDC"
},
card2: {
title: "Caucasus and Central Asia Locust Management System (CCALM)",
buttonText: "Access CCALM"
},
footer: {
contactTitle: "Contact Us",
phone: "Tel 8(727)3967038",
email: "info@ccalm.org",
copyrightYear: "2025"
}
},
ru: {
title: "Система управления саранчовыми на Кавказе и в Центральной Азии (CCALM)",
introText: `Автоматизированная система сбора данных (ASDC) и геоинформационная система (ГИС) "Система управления саранчовыми на Кавказе и в Центральной Азии (CCALM)" были созданы в рамках "Программы по улучшению национальной и региональной борьбы с саранчой на Кавказе и в Центральной Азии (КЦА)", реализуемой Продовольственной и сельскохозяйственной организацией Объединенных Наций (ФАО) в интересах десяти стран. Используемая на планшетах или смартфонах, ASDC позволяет собирать полевые данные во время обследования и борьбы с саранчой и передавать их в ГИС практически в режиме реального времени. CCALM, наполненный данными ASDC и других источников (спутниковые продукты), призван улучшить анализ, прогнозирование и отчетность на национальном и региональном уровнях и, таким образом, способствовать раннему предупреждению и раннему реагированию.`,
card1: {
title: "Автоматизированная система сбора данных (ASDC)",
buttonText: "Скачать ASDC"
},
card2: {
title: "Система управления саранчовыми на Кавказе и в Центральной Азии (CCALM)",
buttonText: "Доступ к CCALM"
},
footer: {
contactTitle: "Контакты:",
phone: "Тел.: 8(727)3967038",
email: "info@ccalm.org",
copyrightYear: "2025"
}
},
// URLs for buttons and links
urls: {
asdc: "https://play.google.com/store/apps/details?id=kz.istt.locust",
ccalm: "/engine",
phone: "tel:+77273967038",
email: "mailto:info@ccalm.org"
},
// Style configuration
styles: {
fontPrimary: "'EB Garamond', serif",
colors: {
button: "#16A34A",
buttonHover: "#15803D", // Darker shade for hover
wave1: "#5D7958", // Bottom wave color
wave2: "#6F876E", // Middle wave color
wave3: "#8B9E8D", // Top wave color
textOnWave: "#EEF0EE",
bgCore: "#F8F7F2",
bgFooter: "#1F2937"
}
}
};
document.cookie = name + "=" + escape(value) + // Current language state
((expires) ? "; expires=" + expires : "") + let currentLanguage = 'en';
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + // This function applies styles from the config object to CSS custom properties (variables)
((secure) ? "; secure" : ""); function applyStyles() {
const root = document.documentElement;
root.style.setProperty('--font-primary', config.styles.fontPrimary);
root.style.setProperty('--color-button', config.styles.colors.button);
root.style.setProperty('--color-button-hover', config.styles.colors.buttonHover);
root.style.setProperty('--color-wave-1', config.styles.colors.wave1);
root.style.setProperty('--color-wave-2', config.styles.colors.wave2);
root.style.setProperty('--color-wave-3', config.styles.colors.wave3);
root.style.setProperty('--color-text-on-wave', config.styles.colors.textOnWave);
root.style.setProperty('--color-bg-core', config.styles.colors.bgCore);
root.style.setProperty('--color-bg-footer', config.styles.colors.bgFooter);
} }
if(window.location.host.indexOf('locust.kz')>=0){ // This function populates the DOM with content from the config object
window.location.href = "ccalm.org"; function populateContent() {
const content = config[currentLanguage];
document.getElementById('main-title').textContent = content.title;
document.title = content.title;
document.getElementById('intro-text').textContent = content.introText;
document.getElementById('card1-title').textContent = content.card1.title;
const card1Btn = document.getElementById('card1-button');
card1Btn.textContent = content.card1.buttonText;
card1Btn.href = config.urls.asdc;
document.getElementById('card2-title').textContent = content.card2.title;
const card2Btn = document.getElementById('card2-button');
card2Btn.textContent = content.card2.buttonText;
card2Btn.href = config.urls.ccalm;
document.getElementById('footer-contact-title').textContent = content.footer.contactTitle;
const footerPhone = document.getElementById('footer-phone');
footerPhone.textContent = content.footer.phone;
footerPhone.href = config.urls.phone;
const footerEmail = document.getElementById('footer-email');
footerEmail.textContent = content.footer.email;
footerEmail.href = config.urls.email;
document.getElementById('copyright-notice').textContent = `© ${content.footer.copyrightYear} CCALM. All Rights Reserved.`;
} }
document.addEventListener('DOMContentLoaded', () => { // This function switches between languages
const url = new URL(window.location.href); function switchLanguage(lang) {
const message = url.searchParams.get('msg'); currentLanguage = lang;
if (message) { populateContent();
alert2(trt('Alert'),trt(message));
url.searchParams.delete('msg'); // Update active button
window.history.replaceState({}, document.title, url); document.querySelectorAll('.language-button').forEach(btn => {
btn.classList.remove('active');
});
document.getElementById(`lang-${lang}`).classList.add('active');
}
// This function sets up the Intersection Observer for scroll animations
function setupScrollAnimations() {
const sections = document.querySelectorAll('.fade-in-section');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('is-visible');
} }
}); });
}, {
threshold: 0.1 // Trigger when 10% of the element is visible
});
sections.forEach(section => {
observer.observe(section);
});
}
// Run all setup functions when the DOM is fully loaded
document.addEventListener('DOMContentLoaded', () => {
applyStyles();
populateContent();
setupScrollAnimations();
});
</script> </script>
</head>
<body>
<div class='content'> <!-- Language Selector -->
<div class="language-selector">
<div style="padding: 5px; background-color: #ffa100;"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%"><tr><td style="width: 50px;"><a href="/"><img src="./resources/images/locust.png" style="width: 70px;"></a></td><td style="text-align: right; vertical-align: top;"><!--a href="#" onclick="setCookie ('lng', 'en', 365, '', '', ''); window.location.reload();">English</a--></td></tr></table></div> <button id="lang-en" class="language-button active" onclick="switchLanguage('en')">
🇬🇧 English
<div style="padding: 5px;"> </button>
<h1 style="text-align: center;">Caucasus and Central Asia Locusts Management system (CCALM)</h1> <button id="lang-ru" class="language-button" onclick="switchLanguage('ru')">
<p style="font-size: 14pt; text-indent: 25px;"> 🇷🇺 Русский
<img src="./resources/images/locust.png" align="right" style="margin: 5px;"> </button>
According to the implementation of the Road Map "program to improve national and regional locust control in the Caucasus and Central Asia (CCA)" developed a system of monitoring and analysis designed to control locusts in the CCA using a geographic information system and remote sensing technology. </div>
</p>
<!--p style="font-size: 14pt; text-indent: 25px;">
To use the "Automated system of data collection" you have to agree to the <a href="#">terms</a> and <a href="#">sign up</a>.
<p-->
<center>
<table border="0"><tr><td style="width: 300px; padding: 20px">
<a target="_blank" href="https://play.google.com/store/apps/details?id=kz.istt.locust"><center>Automated system of data collection (ASDC)<br>
<img src="./resources/images/google_android_download.png"></center></a>
</td><td style="width: 300px; padding: 20px">
<a href="#" onclick="window.open('./engine'); return false;"><center>Caucasus and Central Asia Locusts Management system (CCALM)<br>
<img src="./resources/images/flex.png"></center></a>
</td></tr></table>
</center>
<br>
<center>For any questions contact us at tel./Fax 8(727)3967038, E-mail: <a href="mailto:info@ccalm.org">info@ccalm.org</a>.</center>
<!-- Header Section -->
<header class="wave-header pb-28 pt-10">
<div class="container mx-auto px-6 text-center">
<div class="inline-block bg-white/95 backdrop-blur-md p-6 md:p-10 rounded-xl shadow-2xl">
<h1 id="main-title" class="text-3xl md:text-5xl font-bold text-gray-800"></h1>
</div> </div>
</div> </div>
</body> </header>
<!-- Main Content Section -->
<main class="pb-16 md:pb-20">
<div class="container mx-auto px-6">
<!-- Introductory Text -->
<section class="max-w-4xl mx-auto text-center mb-8 md:mb-12 fade-in-section -mt-16 relative z-10">
<div class="bg-white p-10 rounded-lg shadow-lg">
<p id="intro-text" class="text-lg md:text-xl leading-relaxed text-gray-600"></p>
</div>
</section>
<!-- Feature Cards Section -->
<section class="grid grid-cols-1 md:grid-cols-2 gap-10 lg:gap-16 max-w-5xl mx-auto fade-in-section">
<!-- Card 1: Automated System -->
<div class="info-card flex flex-col items-center p-8 text-center">
<div class="icon-container mb-6">
<i class="ph-bold ph-device-tablet text-5xl"></i>
</div>
<h2 id="card1-title" class="text-xl font-semibold text-gray-700 mb-6 flex-grow"></h2>
<a id="card1-button" href="#" class="btn-custom mt-auto" target="_blank"></a>
</div>
<!-- Card 2: Management System -->
<div class="info-card flex flex-col items-center p-8 text-center">
<div class="icon-container mb-6">
<i class="ph-bold ph-desktop-tower text-5xl"></i>
</div>
<h2 id="card2-title" class="text-xl font-semibold text-gray-700 mb-6 flex-grow"></h2>
<a id="card2-button" href="#" class="btn-custom mt-auto" target="_blank"></a>
</div>
</section>
</div>
</main>
<!-- Footer Section -->
<footer style="background-color: var(--color-bg-footer);" class="text-gray-300 py-12">
<div class="container mx-auto px-6 text-center">
<h3 id="footer-contact-title" class="text-2xl font-semibold mb-6 text-white"></h3>
<div class="flex flex-col md:flex-row justify-center items-center space-y-4 md:space-y-0 md:space-x-8 text-lg">
<a id="footer-phone" href="#" class="flex items-center space-x-3 hover:text-white transition-colors duration-300" target="_blank">
<i class="ph ph-phone"></i>
<span></span>
</a>
<a id="footer-email" href="#" class="flex items-center space-x-3 hover:text-white transition-colors duration-300" target="_blank">
<i class="ph ph-envelope-simple"></i>
<span></span>
</a>
</div>
<div class="mt-10 border-t border-gray-700 pt-6">
<p id="copyright-notice" class="text-sm text-gray-500"></p>
</div>
</div>
</footer>
</body>
</html> </html>

View File

@ -0,0 +1,97 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="./resources/favicon.ico" />
<title>Automated system of data collection</title>
<meta name="yandex-verification" content="2cb5374be0668fe9" />
<script src="../resources/metadata/dbms/tools.js?v=9"></script>
<script src="../resources/metadata/dbms/window.js?v=10"></script>
<meta name="description" content="According to the implementation of the Road Map program to improve national and regional locust control in the Caucasus and Central Asia (CCA) developed a system of monitoring and analysis designed to control locusts in the CCA using a geographic information system and remote sensing technology">
<style type="text/css">
html,body
{
height:100%;
min-height:100%;
margin:0px;
padding:0px;
text-align:center;
background-color: #f0f0f0;
}
.content
{
max-width:960px;
height:100%;
min-height:100%;
margin:0 auto;
text-align:left;
background-color: #ffffff;
}
</style>
<script type="text/javascript">
function setCookie (name, value, expires, path, domain, secure)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + expires);
expires=exdate.toUTCString()
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
if(window.location.host.indexOf('locust.kz')>=0){
window.location.href = "ccalm.org";
}
document.addEventListener('DOMContentLoaded', () => {
const url = new URL(window.location.href);
const message = url.searchParams.get('msg');
if (message) {
alert2(trt('Alert'),trt(message));
url.searchParams.delete('msg');
window.history.replaceState({}, document.title, url);
}
});
</script>
</head>
<body>
<div class='content'>
<div style="padding: 5px; background-color: #ffa100;"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%"><tr><td style="width: 50px;"><a href="/"><img src="./resources/images/locust.png" style="width: 70px;"></a></td><td style="text-align: right; vertical-align: top;"><!--a href="#" onclick="setCookie ('lng', 'en', 365, '', '', ''); window.location.reload();">English</a--></td></tr></table></div>
<div style="padding: 5px;">
<h1 style="text-align: center;">Caucasus and Central Asia Locusts Management system (CCALM)</h1>
<p style="font-size: 14pt; text-indent: 25px;">
<img src="./resources/images/locust.png" align="right" style="margin: 5px;">
According to the implementation of the Road Map "program to improve national and regional locust control in the Caucasus and Central Asia (CCA)" developed a system of monitoring and analysis designed to control locusts in the CCA using a geographic information system and remote sensing technology.
</p>
<!--p style="font-size: 14pt; text-indent: 25px;">
To use the "Automated system of data collection" you have to agree to the <a href="#">terms</a> and <a href="#">sign up</a>.
<p-->
<center>
<table border="0"><tr><td style="width: 300px; padding: 20px">
<a target="_blank" href="https://play.google.com/store/apps/details?id=kz.istt.locust"><center>Automated system of data collection (ASDC)<br>
<img src="./resources/images/google_android_download.png"></center></a>
</td><td style="width: 300px; padding: 20px">
<a href="#" onclick="window.open('./engine'); return false;"><center>Caucasus and Central Asia Locusts Management system (CCALM)<br>
<img src="./resources/images/flex.png"></center></a>
</td></tr></table>
</center>
<br>
<center>For any questions contact us at tel./Fax 8(727)3967038, E-mail: <a href="mailto:info@ccalm.org">info@ccalm.org</a>.</center>
</div>
</div>
</body>
</html>