1 |
<!DOCTYPE html>
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
2 |
<html>
|
3 |
<head>
|
3 |
<head>
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5 |
<title>ALCASAR Report</title>
|
5 |
<title>ALCASAR Report</title>
|
6 |
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
6 |
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
7 |
<link rel="stylesheet" href="/css/acc.css">
|
7 |
<link rel="stylesheet" href="/css/acc.css">
|
8 |
<script src="/js/jquery.min.js"></script>
|
8 |
<script src="/js/jquery.min.js"></script>
|
9 |
<script src="/js/bootstrap.min.js"></script>
|
9 |
<script src="/js/bootstrap.min.js"></script>
|
10 |
</head>
|
10 |
</head>
|
11 |
<body>
|
11 |
<body>
|
12 |
<?php
|
12 |
<?php
|
13 |
# Cette page permet de générer les journaux d'imputabilité dans une archive avec mot de passe.
|
13 |
# Cette page permet de générer les journaux d'imputabilité dans une archive avec mot de passe.
|
14 |
# Lors de la création de cette archive, tous les utilisateurs d'alcasar seront prévenus lors de leur prochaine connexion par un message d'alerte.
|
14 |
# Lors de la création de cette archive, tous les utilisateurs d'alcasar seront prévenus lors de leur prochaine connexion par un message d'alerte.
|
15 |
|
15 |
|
16 |
# Choice of language
|
16 |
# Choice of language
|
17 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
17 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
18 |
{
|
18 |
{
|
19 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
19 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
20 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
20 |
$Language = strtolower(substr(chop($Langue[0]),0,2));
|
21 |
}
|
21 |
}
|
22 |
if($Language == 'fr')
|
22 |
if($Language == 'fr')
|
23 |
{
|
23 |
{
|
24 |
$l_title = "Journaux d'imputabilité";
|
24 |
$l_title = "Journaux d'imputabilité";
|
25 |
$l_info = "Génération des journaux d'imputabilité";
|
25 |
$l_info = "Génération des journaux d'imputabilité";
|
26 |
$l_log_info = "Vous allez générer un document réservé aux autorités dans le cadre d'une requête judiciaire ou administrative. Tout les utilisateurs seront avertis de la génération de ce document.";
|
26 |
$l_log_info = "Vous allez générer un document réservé aux autorités dans le cadre d'une requête judiciaire ou administrative. Tout les utilisateurs seront avertis de la génération de ce document.";
|
27 |
$l_password = "Entrez votre mot de passe afin de protéger l'archive contenant le document généré";
|
27 |
$l_password = "Entrez votre mot de passe afin de protéger l'archive contenant le document généré";
|
28 |
$l_submit = "Continuer";
|
28 |
$l_submit = "Continuer";
|
29 |
$l_date1="Commençant le ...";
|
29 |
$l_date1="Commençant le ...";
|
30 |
$l_date2="Terminant le ...";
|
30 |
$l_date2="Terminant le ...";
|
31 |
$l_hours="à ...";
|
31 |
$l_hours="à ...";
|
32 |
$l_options_info = "Que désirez vous?";
|
32 |
$l_options_info = "Que désirez vous?";
|
33 |
$l_options_1="Tous les journaux";
|
33 |
$l_options_1="Tous les journaux";
|
34 |
$l_options_2="Selectionnez un intervale ...";
|
34 |
$l_options_2="Selectionnez un intervale ...";
|
35 |
$l_options_3="Selectionnez depuis une date ...";
|
35 |
$l_options_3="Selectionnez depuis une date ...";
|
36 |
$l_load="Chargement...";
|
- |
|
37 |
$l_create="Les utilisateurs ont été prévenus de cette action et l'archive a bien été crée, retenez bien votre mot de passe car il sera impossible de vous le redonner";
|
36 |
$l_create="Les utilisateurs ont été prévenus de cette action et l'archive a bien été crée, retenez bien votre mot de passe car il sera impossible de vous le redonner";
|
- |
|
37 |
$l_load="Chargement...";
|
38 |
$l_download="Télécharger l'archive";
|
38 |
$l_download="Télécharger l'archive";
|
39 |
$l_error="Vous devez remplir les informations du formulaire!";
|
39 |
$l_error="Vous devez remplir les informations du formulaire!";
|
40 |
$l_demandeur="Nom du demandeur :";
|
40 |
$l_demandeur="Nom du demandeur :";
|
41 |
$l_commentary="Raison :";
|
41 |
$l_commentary="Raison :";
|
42 |
$l_info_form="Information du demandeur :";
|
42 |
$l_info_form="Information du demandeur :";
|
43 |
$l_logtab="Dernières entrées :";
|
43 |
$l_logtab="Dernières entrées :";
|
44 |
$l_empty_log="Les journaux sont vides";
|
44 |
$l_empty_log="Les journaux sont vides";
|
- |
|
45 |
} else if($Language == 'es') {
|
- |
|
46 |
$l_title = "Registros de responsabilidad";
|
- |
|
47 |
$l_info = "Generación de registros de Imputabilidades";
|
- |
|
48 |
$l_log_info = "Está iniciando el proceso para generar un documento reservado para una investigación judicial o administrativa. Todos los usuarios serán advertidos.";
|
- |
|
49 |
$l_password = "Ingrese una contraseña para proteger el archivo que contiene el documento.";
|
- |
|
50 |
$l_submit = "Continuar";
|
- |
|
51 |
$l_date1="Desde el...";
|
45 |
|
52 |
$l_date2="Hasta...";
|
46 |
}
|
- |
|
- |
|
53 |
$l_hours=" a las...";
|
- |
|
54 |
$l_options_info = "¿Qué desea?";
|
- |
|
55 |
$l_options_1="Todos los registros";
|
- |
|
56 |
$l_options_2="Seleccione un rango...";
|
- |
|
57 |
$l_options_3="Seleccione desde una fecha específica...";
|
- |
|
58 |
$l_create="¡Los usuarios han sido advertidos y su archivo ha sido creado! ¡No olvide la contraseña!";
|
- |
|
59 |
$l_load="Cargando...";
|
- |
|
60 |
$l_download="Descargar archivo";
|
- |
|
61 |
$l_error="¡¡Es necesario que complete los criterios en el formulario!!";
|
- |
|
62 |
$l_demandeur="Nombre del solicitante:";
|
- |
|
63 |
$l_commentary="Motivo:";
|
- |
|
64 |
$l_info_form="Informacion del usuario";
|
- |
|
65 |
$l_logtab="Ultimas entradas:";
|
- |
|
66 |
$l_empty_log="Sin datos en los registros";
|
47 |
else
|
67 |
} else {
|
48 |
{
|
- |
|
49 |
$l_title = "Imputabilities logs";
|
68 |
$l_title = "Imputabilities logs";
|
50 |
$l_info = "Imputabilities logs generation";
|
69 |
$l_info = "Imputabilities logs generation";
|
51 |
$l_log_info = "You are in progress to generate a document reserved for a judicial or administrative investigation. All users will be warned.";
|
70 |
$l_log_info = "You are in progress to generate a document reserved for a judicial or administrative investigation. All users will be warned.";
|
52 |
$l_password = "Enter your password to protect the archive which contains the document.";
|
71 |
$l_password = "Enter your password to protect the archive which contains the document.";
|
53 |
$l_submit = "Proceed";
|
72 |
$l_submit = "Proceed";
|
54 |
$l_date1="Start at ...";
|
73 |
$l_date1="Start at ...";
|
55 |
$l_date2="End at ...";
|
74 |
$l_date2="End at ...";
|
56 |
$l_hours="at ...";
|
75 |
$l_hours="at ...";
|
57 |
$l_options_info = "What do you want?";
|
76 |
$l_options_info = "What do you want?";
|
58 |
$l_options_1="All logs";
|
77 |
$l_options_1="All logs";
|
59 |
$l_options_2="Select a range ...";
|
78 |
$l_options_2="Select a range ...";
|
60 |
$l_options_3="Select from a specific date ...";
|
79 |
$l_options_3="Select from a specific date ...";
|
61 |
$l_create="Users have been warned and your archive has been created! Don't forget your password!";
|
80 |
$l_create="Users have been warned and your archive has been created! Don't forget your password!";
|
62 |
$l_load="Loading...";
|
81 |
$l_load="Loading...";
|
63 |
$l_download="Download archive";
|
82 |
$l_download="Download archive";
|
64 |
$l_error="You need to submit form informations!!";
|
83 |
$l_error="You need to submit form informations!!";
|
65 |
$l_demandeur="Applicant name :";
|
84 |
$l_demandeur="Applicant name :";
|
66 |
$l_commentary="Reason :";
|
85 |
$l_commentary="Reason :";
|
67 |
$l_info_form="User Information";
|
86 |
$l_info_form="User Information";
|
68 |
$l_logtab="Last entries :";
|
87 |
$l_logtab="Last entries :";
|
69 |
$l_empty_log="Logs are empty";
|
88 |
$l_empty_log="Logs are empty";
|
70 |
}
|
89 |
}
|
71 |
$filename='/var/www/html/acc/backup/log_info.txt';
|
90 |
$filename='/var/www/html/acc/backup/log_info.txt';
|
72 |
if(isset($_POST['submit']))
|
91 |
if(isset($_POST['submit']))
|
73 |
{
|
92 |
{
|
74 |
$password=$_POST['password'];
|
93 |
$password=$_POST['password'];
|
75 |
$demandeur=$_POST['demandeur'];
|
94 |
$demandeur=$_POST['demandeur'];
|
76 |
$raison=$_POST['comment'];
|
95 |
$raison=$_POST['comment'];
|
77 |
# si le mot de passe est vide ou si il contient des espaces
|
96 |
# si le mot de passe est vide ou si il contient des espaces
|
78 |
if($password != "" && $demandeur != "" && $raison != "")
|
97 |
if($password != "" && $demandeur != "" && $raison != "")
|
79 |
{
|
98 |
{
|
80 |
# Génération de log
|
99 |
# Génération de log
|
81 |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR'];
|
100 |
$text=date("Y-m-d H:i:s")."|||".$demandeur."|||".$raison."|||".$_SERVER['REMOTE_ADDR'];
|
82 |
# supprimer les nouvelles lignes
|
101 |
# supprimer les nouvelles lignes
|
83 |
$text = str_replace("\n", ' ', $text);
|
102 |
$text = str_replace("\n", ' ', $text);
|
84 |
$text = str_replace("\r", ' ', $text);
|
103 |
$text = str_replace("\r", ' ', $text);
|
85 |
file_put_contents($filename, $text.PHP_EOL, FILE_APPEND);
|
104 |
file_put_contents($filename, $text.PHP_EOL, FILE_APPEND);
|
86 |
# Création des journaux dans une archive avec mot de passe.
|
105 |
# Création des journaux dans une archive avec mot de passe.
|
87 |
$filename_logs="imputabilities_logs.zip";
|
106 |
$filename_logs="imputabilities_logs.zip";
|
88 |
switch($_POST['submit'])
|
107 |
switch($_POST['submit'])
|
89 |
{
|
108 |
{
|
90 |
case 'query_all':
|
109 |
case 'query_all':
|
91 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password));
|
110 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password));
|
92 |
break;
|
111 |
break;
|
93 |
case 'query_range':
|
112 |
case 'query_range':
|
94 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
113 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
95 |
$date2_selected= $_POST['stop-year'].'-'.$_POST['stop-month'].'-'.$_POST['stop-day'].' '.$_POST['stop-hour'].':'.$_POST['stop-min'].':'.$_POST['stop-sec'];
|
114 |
$date2_selected= $_POST['stop-year'].'-'.$_POST['stop-month'].'-'.$_POST['stop-day'].' '.$_POST['stop-hour'].':'.$_POST['stop-min'].':'.$_POST['stop-sec'];
|
96 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected)." ".escapeshellarg($date2_selected));
|
115 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected)." ".escapeshellarg($date2_selected));
|
97 |
break;
|
116 |
break;
|
98 |
case 'query_simple':
|
117 |
case 'query_simple':
|
99 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
118 |
$date1_selected= $_POST['start-year'].'-'.$_POST['start-month'].'-'.$_POST['start-day'].' '.$_POST['start-hour'].':'.$_POST['start-min'].':'.$_POST['start-sec'];
|
100 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected));
|
119 |
exec("sudo alcasar-generate_log.sh ".escapeshellarg($password)." ".escapeshellarg($date1_selected));
|
101 |
break;
|
120 |
break;
|
102 |
}
|
121 |
}
|
103 |
# Interface permettant de télécharger les journaux d'imputabilité
|
122 |
# Interface permettant de télécharger les journaux d'imputabilité
|
104 |
echo "<h3>$l_create</h3>";
|
123 |
echo "<h3>$l_create</h3>";
|
105 |
echo "<a href=\"$filename_logs\" class=\"btn btn-info btn-lg\">";
|
124 |
echo "<a href=\"$filename_logs\" class=\"btn btn-info btn-lg\">";
|
106 |
echo " <span class=\"glyphicon glyphicon-download-alt\"></span> $l_download";
|
125 |
echo " <span class=\"glyphicon glyphicon-download-alt\"></span> $l_download";
|
107 |
echo "</a>";
|
126 |
echo "</a>";
|
108 |
}
|
127 |
}
|
109 |
else
|
128 |
else
|
110 |
{
|
129 |
{
|
111 |
echo "$l_error";
|
130 |
echo "$l_error";
|
112 |
}
|
131 |
}
|
113 |
}
|
132 |
}
|
114 |
else
|
133 |
else
|
115 |
{
|
134 |
{
|
116 |
# Interface permettant de configurer la génération des journaux d'imputabilité.
|
135 |
# Interface permettant de configurer la génération des journaux d'imputabilité.
|
117 |
echo "<div class=\"panel\">\n";
|
136 |
echo "<div class=\"panel\">\n";
|
118 |
echo "<div class=\"panel-header\">$l_title</div>";
|
137 |
echo "<div class=\"panel-header\">$l_title</div>";
|
119 |
echo "<div class=\"panel-row\">";
|
138 |
echo "<div class=\"panel-row\">";
|
120 |
echo " <div style=\"margin-top:16px;margin-left:15px;\">";
|
139 |
echo " <div style=\"margin-top:16px;margin-left:15px;\">";
|
121 |
echo " <div>";
|
140 |
echo " <div>";
|
122 |
echo " <fieldset>";
|
141 |
echo " <fieldset>";
|
123 |
echo " <h3>$l_info</h3>";
|
142 |
echo " <h3>$l_info</h3>";
|
124 |
echo " <p>$l_log_info</p>";
|
143 |
echo " <p>$l_log_info</p>";
|
125 |
echo " </fieldset>";
|
144 |
echo " </fieldset>";
|
126 |
echo "<h4> $l_options_info </h4>";
|
145 |
echo "<h4> $l_options_info </h4>";
|
127 |
echo "<div class=\"radio\">";
|
146 |
echo "<div class=\"radio\">";
|
128 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact1()\" style=\"margin-top: -1px;\" checked> $l_options_1 </label>";
|
147 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact1()\" style=\"margin-top: -1px;\" checked> $l_options_1 </label>";
|
129 |
echo "</div>";
|
148 |
echo "</div>";
|
130 |
echo "<div class=\"radio\">";
|
149 |
echo "<div class=\"radio\">";
|
131 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact2()\" style=\"margin-top: -1px;\" > $l_options_2 </label>";
|
150 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact2()\" style=\"margin-top: -1px;\" > $l_options_2 </label>";
|
132 |
echo "</div>";
|
151 |
echo "</div>";
|
133 |
echo "<div class=\"radio\">";
|
152 |
echo "<div class=\"radio\">";
|
134 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact3()\" style=\"margin-top: -1px;\"> $l_options_3 </label>";
|
153 |
echo "<label><input type=\"radio\" name=\"optradio\" onclick=\"radio_interact3()\" style=\"margin-top: -1px;\"> $l_options_3 </label>";
|
135 |
echo "</div>";
|
154 |
echo "</div>";
|
136 |
echo "<form name=\"form_log\" method=\"post\" action=\"log_generation.php\" role=\"form\">";
|
155 |
echo "<form name=\"form_log\" method=\"post\" action=\"log_generation.php\" role=\"form\">";
|
137 |
echo "<p> $l_password </p><input name=\"password\" type=\"password\" size=\"25\">";
|
156 |
echo "<p> $l_password </p><input name=\"password\" type=\"password\" size=\"25\">";
|
138 |
echo "<h2>$l_info_form</h2>";
|
157 |
echo "<h2>$l_info_form</h2>";
|
139 |
echo "<p>$l_demandeur</p><textarea name='demandeur' style=\"height:25px;\"></textarea>";
|
158 |
echo "<p>$l_demandeur</p><textarea name='demandeur' style=\"height:25px;\"></textarea>";
|
140 |
echo "<p>$l_commentary</p><textarea name='comment'></textarea>";
|
159 |
echo "<p>$l_commentary</p><textarea name='comment'></textarea>";
|
141 |
echo "<p id=\"query_option\"></br></br><button type=\"submit\" onClick=\"this.classList.add('disabled');\" class=\"btn btn-primary\" name=\"submit\" value=\"query_all\"> $l_submit </button></p>";
|
160 |
echo "<p id=\"query_option\"></br></br><button type=\"submit\" onClick=\"this.classList.add('disabled');\" class=\"btn btn-primary\" name=\"submit\" value=\"query_all\"> $l_submit </button></p>";
|
142 |
}
|
161 |
}
|
143 |
echo "<br><div style=\"height:1px;background:#717171;border-bottom:1px solid #313030:\"></div>";
|
162 |
echo "<br><div style=\"height:1px;background:#717171;border-bottom:1px solid #313030:\"></div>";
|
144 |
echo "<h2>$l_logtab</h2>";
|
163 |
echo "<h2>$l_logtab</h2>";
|
145 |
if(file_exists($filename)){
|
164 |
if(file_exists($filename)){
|
146 |
echo "<div class=\"container\">";
|
165 |
echo "<div class=\"container\">";
|
147 |
echo "<table class=\"table table-striped\">";
|
166 |
echo "<table class=\"table table-striped\">";
|
148 |
echo "<thead>";
|
167 |
echo "<thead>";
|
149 |
echo "<tr>";
|
168 |
echo "<tr>";
|
150 |
echo "<th>Date</th>";
|
169 |
echo "<th>Date</th>";
|
151 |
echo "<th>User</th>";
|
170 |
echo "<th>User</th>";
|
152 |
echo "<th>Reason</th>";
|
171 |
echo "<th>Reason</th>";
|
153 |
echo "<th>IP address</th>";
|
172 |
echo "<th>IP address</th>";
|
154 |
echo "</tr>";
|
173 |
echo "</tr>";
|
155 |
echo "</thead>";
|
174 |
echo "</thead>";
|
156 |
echo "<tbody>";
|
175 |
echo "<tbody>";
|
157 |
$fichier = fopen($filename, "r");
|
176 |
$fichier = fopen($filename, "r");
|
158 |
$content = file($filename);
|
177 |
$content = file($filename);
|
159 |
$content = array_reverse($content);
|
178 |
$content = array_reverse($content);
|
160 |
foreach($content as $line){
|
179 |
foreach($content as $line){
|
161 |
$infos=explode("|||", $line);
|
180 |
$infos=explode("|||", $line);
|
162 |
echo "<tr>";
|
181 |
echo "<tr>";
|
163 |
echo "<td>$infos[0]</td>";
|
182 |
echo "<td>$infos[0]</td>";
|
164 |
echo "<td>$infos[1]</td>";
|
183 |
echo "<td>$infos[1]</td>";
|
165 |
echo "<td>$infos[2]</td>";
|
184 |
echo "<td>$infos[2]</td>";
|
166 |
echo "<td>$infos[3]</td>";
|
185 |
echo "<td>$infos[3]</td>";
|
167 |
echo "</tr>";
|
186 |
echo "</tr>";
|
168 |
}
|
187 |
}
|
169 |
echo "</tbody>";
|
188 |
echo "</tbody>";
|
170 |
echo "</table>";
|
189 |
echo "</table>";
|
171 |
echo "</div>";
|
190 |
echo "</div>";
|
172 |
}
|
191 |
}
|
173 |
else
|
192 |
else
|
174 |
{
|
193 |
{
|
175 |
echo "<p>$l_empty_log</p>";
|
194 |
echo "<p>$l_empty_log</p>";
|
176 |
}
|
195 |
}
|
177 |
|
196 |
|
178 |
#javascript permettant de generer les dropdown des dates. Il faut s'assurer que les données envoyées soient au bon format afin d'etre traité dans alcasar-generation_logs.sh
|
197 |
#javascript permettant de generer les dropdown des dates. Il faut s'assurer que les données envoyées soient au bon format afin d'etre traité dans alcasar-generation_logs.sh
|
179 |
|
198 |
|
180 |
echo "<script>";
|
199 |
echo "<script>";
|
181 |
|
200 |
|
182 |
echo "function radio_interact1() {";
|
201 |
echo "function radio_interact1() {";
|
183 |
echo "document.getElementById(\"query_option\").innerHTML = '";
|
202 |
echo "document.getElementById(\"query_option\").innerHTML = '";
|
184 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_all\"> $l_submit</button>";
|
203 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_all\"> $l_submit</button>";
|
185 |
echo "';}";
|
204 |
echo "';}";
|
186 |
|
205 |
|
187 |
echo "function radio_interact2() {";
|
206 |
echo "function radio_interact2() {";
|
188 |
echo " document.getElementById(\"query_option\").innerHTML = '";
|
207 |
echo " document.getElementById(\"query_option\").innerHTML = '";
|
189 |
|
208 |
|
190 |
echo "$l_date1 <select name=\"start-year\">";
|
209 |
echo "$l_date1 <select name=\"start-year\">";
|
191 |
$year = date('Y');
|
210 |
$year = date('Y');
|
192 |
$years = $year-50;
|
211 |
$years = $year-50;
|
193 |
for ($i = $year; $i >= $years; $i--) {
|
212 |
for ($i = $year; $i >= $years; $i--) {
|
194 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
213 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
195 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
214 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
196 |
echo "<option value=\"$i\"$sel>$i</option>";
|
215 |
echo "<option value=\"$i\"$sel>$i</option>";
|
197 |
}
|
216 |
}
|
198 |
echo "</select>";
|
217 |
echo "</select>";
|
199 |
echo "-<select name=\"start-month\">";
|
218 |
echo "-<select name=\"start-month\">";
|
200 |
$month = date('m');
|
219 |
$month = date('m');
|
201 |
for ($i = 1; $i <= 12; $i++) {
|
220 |
for ($i = 1; $i <= 12; $i++) {
|
202 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
221 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
203 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
222 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
204 |
echo "<option value=\"$i\"$sel>$i</option>";
|
223 |
echo "<option value=\"$i\"$sel>$i</option>";
|
205 |
}
|
224 |
}
|
206 |
|
225 |
|
207 |
echo "</select>";
|
226 |
echo "</select>";
|
208 |
echo "-<select name=\"start-day\">";
|
227 |
echo "-<select name=\"start-day\">";
|
209 |
$day = date('d');
|
228 |
$day = date('d');
|
210 |
for ($i = 1; $i <= 31; $i++) {
|
229 |
for ($i = 1; $i <= 31; $i++) {
|
211 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
230 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
212 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
231 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
213 |
echo "<option value=\"$i\"$sel>$i</option>";
|
232 |
echo "<option value=\"$i\"$sel>$i</option>";
|
214 |
}
|
233 |
}
|
215 |
|
234 |
|
216 |
echo "</select>";
|
235 |
echo "</select>";
|
217 |
echo "$l_hours <select name=\"start-hour\">";
|
236 |
echo "$l_hours <select name=\"start-hour\">";
|
218 |
$hour = date('G');
|
237 |
$hour = date('G');
|
219 |
for ($i = 0; $i <= 23; $i++) {
|
238 |
for ($i = 0; $i <= 23; $i++) {
|
220 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
239 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
221 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
240 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
222 |
echo "<option value=\"$i\"$sel>$i</option>";
|
241 |
echo "<option value=\"$i\"$sel>$i</option>";
|
223 |
}
|
242 |
}
|
224 |
echo "</select>";
|
243 |
echo "</select>";
|
225 |
echo ":<select name=\"start-min\">";
|
244 |
echo ":<select name=\"start-min\">";
|
226 |
$min = date('i');
|
245 |
$min = date('i');
|
227 |
for ($i = 0; $i <= 59; $i++) {
|
246 |
for ($i = 0; $i <= 59; $i++) {
|
228 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
247 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
229 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
248 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
230 |
echo "<option value=\"$i\"$sel>$i</option>";
|
249 |
echo "<option value=\"$i\"$sel>$i</option>";
|
231 |
}
|
250 |
}
|
232 |
echo "</select>";
|
251 |
echo "</select>";
|
233 |
echo ":<select name=\"start-sec\">";
|
252 |
echo ":<select name=\"start-sec\">";
|
234 |
$sec = date('s');
|
253 |
$sec = date('s');
|
235 |
for ($i = 0; $i <= 59; $i++) {
|
254 |
for ($i = 0; $i <= 59; $i++) {
|
236 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
255 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
237 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
256 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
238 |
echo "<option value=\"$i\"$sel>$i</option>";
|
257 |
echo "<option value=\"$i\"$sel>$i</option>";
|
239 |
}
|
258 |
}
|
240 |
echo "</select>";
|
259 |
echo "</select>";
|
241 |
echo "</br>";
|
260 |
echo "</br>";
|
242 |
|
261 |
|
243 |
echo "$l_date2 <select name=\"stop-year\">";
|
262 |
echo "$l_date2 <select name=\"stop-year\">";
|
244 |
$year = date('Y');
|
263 |
$year = date('Y');
|
245 |
$years = $year-50;
|
264 |
$years = $year-50;
|
246 |
for ($i = $year; $i >= $years; $i--) {
|
265 |
for ($i = $year; $i >= $years; $i--) {
|
247 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
266 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
248 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
267 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
249 |
echo "<option value=\"$i\"$sel>$i</option>";
|
268 |
echo "<option value=\"$i\"$sel>$i</option>";
|
250 |
}
|
269 |
}
|
251 |
echo "</select>";
|
270 |
echo "</select>";
|
252 |
echo "-<select name=\"stop-month\">";
|
271 |
echo "-<select name=\"stop-month\">";
|
253 |
$month = date('m')+1;
|
272 |
$month = date('m')+1;
|
254 |
for ($i = 1; $i <= 12; $i++) {
|
273 |
for ($i = 1; $i <= 12; $i++) {
|
255 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
274 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
256 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
275 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
257 |
echo "<option value=\"$i\"$sel>$i</option>";
|
276 |
echo "<option value=\"$i\"$sel>$i</option>";
|
258 |
}
|
277 |
}
|
259 |
|
278 |
|
260 |
echo "</select>";
|
279 |
echo "</select>";
|
261 |
echo "-<select name=\"stop-day\">";
|
280 |
echo "-<select name=\"stop-day\">";
|
262 |
$day = date('d');
|
281 |
$day = date('d');
|
263 |
for ($i = 1; $i <= 31; $i++) {
|
282 |
for ($i = 1; $i <= 31; $i++) {
|
264 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
283 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
265 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
284 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
266 |
echo "<option value=\"$i\"$sel>$i</option>";
|
285 |
echo "<option value=\"$i\"$sel>$i</option>";
|
267 |
}
|
286 |
}
|
268 |
|
287 |
|
269 |
echo "</select>";
|
288 |
echo "</select>";
|
270 |
echo "$l_hours <select name=\"stop-hour\">";
|
289 |
echo "$l_hours <select name=\"stop-hour\">";
|
271 |
$hour = date('G');
|
290 |
$hour = date('G');
|
272 |
for ($i = 0; $i <= 23; $i++) {
|
291 |
for ($i = 0; $i <= 23; $i++) {
|
273 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
292 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
274 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
293 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
275 |
echo "<option value=\"$i\"$sel>$i</option>";
|
294 |
echo "<option value=\"$i\"$sel>$i</option>";
|
276 |
}
|
295 |
}
|
277 |
echo "</select>";
|
296 |
echo "</select>";
|
278 |
echo ":<select name=\"stop-min\">";
|
297 |
echo ":<select name=\"stop-min\">";
|
279 |
$min = date('i');
|
298 |
$min = date('i');
|
280 |
for ($i = 0; $i <= 59; $i++) {
|
299 |
for ($i = 0; $i <= 59; $i++) {
|
281 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
300 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
282 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
301 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
283 |
echo "<option value=\"$i\"$sel>$i</option>";
|
302 |
echo "<option value=\"$i\"$sel>$i</option>";
|
284 |
}
|
303 |
}
|
285 |
echo "</select>";
|
304 |
echo "</select>";
|
286 |
echo ":<select name=\"stop-sec\">";
|
305 |
echo ":<select name=\"stop-sec\">";
|
287 |
$sec = date('s');
|
306 |
$sec = date('s');
|
288 |
for ($i = 0; $i <= 59; $i++) {
|
307 |
for ($i = 0; $i <= 59; $i++) {
|
289 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
308 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
290 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
309 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
291 |
echo "<option value=\"$i\"$sel>$i</option>";
|
310 |
echo "<option value=\"$i\"$sel>$i</option>";
|
292 |
}
|
311 |
}
|
293 |
echo "</select>";
|
312 |
echo "</select>";
|
294 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_range\"> $l_submit</button>";
|
313 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_range\"> $l_submit</button>";
|
295 |
echo "';}";
|
314 |
echo "';}";
|
296 |
|
315 |
|
297 |
|
316 |
|
298 |
|
317 |
|
299 |
echo "function radio_interact3() {";
|
318 |
echo "function radio_interact3() {";
|
300 |
echo " document.getElementById(\"query_option\").innerHTML = '";
|
319 |
echo " document.getElementById(\"query_option\").innerHTML = '";
|
301 |
|
320 |
|
302 |
echo "$l_date1 <select name=\"start-year\">";
|
321 |
echo "$l_date1 <select name=\"start-year\">";
|
303 |
$year = date('Y');
|
322 |
$year = date('Y');
|
304 |
$years = $year-50;
|
323 |
$years = $year-50;
|
305 |
for ($i = $year; $i >= $years; $i--) {
|
324 |
for ($i = $year; $i >= $years; $i--) {
|
306 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
325 |
$sel = ($i == $year) ? ' selected="selected"' : '';
|
307 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
326 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
308 |
echo "<option value=\"$i\"$sel>$i</option>";
|
327 |
echo "<option value=\"$i\"$sel>$i</option>";
|
309 |
}
|
328 |
}
|
310 |
echo "</select>";
|
329 |
echo "</select>";
|
311 |
echo "-<select name=\"start-month\">";
|
330 |
echo "-<select name=\"start-month\">";
|
312 |
$month = date('m');
|
331 |
$month = date('m');
|
313 |
for ($i = 1; $i <= 12; $i++) {
|
332 |
for ($i = 1; $i <= 12; $i++) {
|
314 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
333 |
$sel = ($i == $month) ? ' selected="selected"' : '';
|
315 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
334 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
316 |
echo "<option value=\"$i\"$sel>$i</option>";
|
335 |
echo "<option value=\"$i\"$sel>$i</option>";
|
317 |
}
|
336 |
}
|
318 |
|
337 |
|
319 |
echo "</select>";
|
338 |
echo "</select>";
|
320 |
echo "-<select name=\"start-day\">";
|
339 |
echo "-<select name=\"start-day\">";
|
321 |
$day = date('d');
|
340 |
$day = date('d');
|
322 |
for ($i = 1; $i <= 31; $i++) {
|
341 |
for ($i = 1; $i <= 31; $i++) {
|
323 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
342 |
$sel = ($i == $day) ? ' selected="selected"' : '';
|
324 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
343 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
325 |
echo "<option value=\"$i\"$sel>$i</option>";
|
344 |
echo "<option value=\"$i\"$sel>$i</option>";
|
326 |
}
|
345 |
}
|
327 |
|
346 |
|
328 |
echo "</select>";
|
347 |
echo "</select>";
|
329 |
echo "$l_hours <select name=\"start-hour\">";
|
348 |
echo "$l_hours <select name=\"start-hour\">";
|
330 |
$hour = date('G');
|
349 |
$hour = date('G');
|
331 |
for ($i = 0; $i <= 23; $i++) {
|
350 |
for ($i = 0; $i <= 23; $i++) {
|
332 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
351 |
$sel = ($i == $hour) ? ' selected="selected"' : '';
|
333 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
352 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
334 |
echo "<option value=\"$i\"$sel>$i</option>";
|
353 |
echo "<option value=\"$i\"$sel>$i</option>";
|
335 |
}
|
354 |
}
|
336 |
echo "</select>";
|
355 |
echo "</select>";
|
337 |
echo ":<select name=\"start-min\">";
|
356 |
echo ":<select name=\"start-min\">";
|
338 |
$min = date('i');
|
357 |
$min = date('i');
|
339 |
for ($i = 0; $i <= 59; $i++) {
|
358 |
for ($i = 0; $i <= 59; $i++) {
|
340 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
359 |
$sel = ($i == $min) ? ' selected="selected"' : '';
|
341 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
360 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
342 |
echo "<option value=\"$i\"$sel>$i</option>";
|
361 |
echo "<option value=\"$i\"$sel>$i</option>";
|
343 |
}
|
362 |
}
|
344 |
echo "</select>";
|
363 |
echo "</select>";
|
345 |
echo ":<select name=\"start-sec\">";
|
364 |
echo ":<select name=\"start-sec\">";
|
346 |
$sec = date('s');
|
365 |
$sec = date('s');
|
347 |
for ($i = 0; $i <= 59; $i++) {
|
366 |
for ($i = 0; $i <= 59; $i++) {
|
348 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
367 |
$sel = ($i == $sec) ? ' selected="selected"' : '';
|
349 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
368 |
$i = str_pad($i, 2, '0', STR_PAD_LEFT);
|
350 |
echo "<option value=\"$i\"$sel>$i</option>";
|
369 |
echo "<option value=\"$i\"$sel>$i</option>";
|
351 |
}
|
370 |
}
|
352 |
echo "</select>";
|
371 |
echo "</select>";
|
353 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_simple\"> $l_submit</button>";
|
372 |
echo "</br></br><button type=\"submit\" class=\"btn btn-primary\" name=\"submit\" value=\"query_simple\"> $l_submit</button>";
|
354 |
echo "';}";
|
373 |
echo "';}";
|
355 |
echo "</script>";
|
374 |
echo "</script>";
|
356 |
|
375 |
|
357 |
echo "</form>";
|
376 |
echo "</form>";
|
358 |
echo "</div>";
|
377 |
echo "</div>";
|
359 |
echo "</div>";
|
378 |
echo "</div>";
|
360 |
echo "</div>";
|
379 |
echo "</div>";
|
361 |
?>
|
380 |
?>
|
362 |
</div>
|
381 |
</div>
|
363 |
</body>
|
382 |
</body>
|
364 |
</html>
|
383 |
</html>
|
365 |
|
384 |
|