|
@@ -2,10 +2,10 @@
|
|
<!-- https://towardsdatascience.com/4-ways-to-improve-your-plotly-graphs-517c75947f7e -->
|
|
<!-- https://towardsdatascience.com/4-ways-to-improve-your-plotly-graphs-517c75947f7e -->
|
|
|
|
|
|
<?php
|
|
<?php
|
|
-$selected_csv =
|
|
|
|
-
|
|
|
|
$branch = 'dev';
|
|
$branch = 'dev';
|
|
-$season = 'NNBAR2021';
|
|
|
|
|
|
+$availableSeasons = array("RHO2018", "NNBAR2021");
|
|
|
|
+
|
|
|
|
+$season = isset($_GET["season"])&&in_array($_GET["season"], $availableSeasons) ? $_GET["season"] : reset($availableSeasons);
|
|
$url = "https://cmd.inp.nsk.su/~compton/gitlist/compton_tables/raw/".$branch."/tables/".$season."/";
|
|
$url = "https://cmd.inp.nsk.su/~compton/gitlist/compton_tables/raw/".$branch."/tables/".$season."/";
|
|
$url_total_info = "https://cmd.inp.nsk.su/~compton/gitlist/compton_tables/raw/".$branch."/tables/".$season.".csv";
|
|
$url_total_info = "https://cmd.inp.nsk.su/~compton/gitlist/compton_tables/raw/".$branch."/tables/".$season.".csv";
|
|
$text = file_get_contents($url);
|
|
$text = file_get_contents($url);
|
|
@@ -22,7 +22,7 @@ function isSelected($a, $b){
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
-$selected_csv = isset($_GET["csv_file"]) ? $_GET["csv_file"] : reset($cleanArrs);
|
|
|
|
|
|
+$selected_csv = isset($_GET["csv_file"])&&in_array($_GET["csv_file"], $cleanArrs) ? $_GET["csv_file"] : reset($cleanArrs);
|
|
|
|
|
|
?>
|
|
?>
|
|
|
|
|
|
@@ -40,7 +40,17 @@ $selected_csv = isset($_GET["csv_file"]) ? $_GET["csv_file"] : reset($cleanArrs)
|
|
|
|
|
|
<form name="form" action="" method="get">
|
|
<form name="form" action="" method="get">
|
|
<p style="text-align: center;">Select energy point:</p>
|
|
<p style="text-align: center;">Select energy point:</p>
|
|
- <select name="csv_file" class="select-css" onchange="this.form.submit()">
|
|
|
|
|
|
+ <div style="margin: 0 auto; display: flex; justify-content: center;">
|
|
|
|
+ <select name="season" class="select-css" style="margin: 0;" onchange="this.form.submit()">
|
|
|
|
+ <?
|
|
|
|
+ foreach($availableSeasons as $s){
|
|
|
|
+ ?><option value="<?echo $s?>" <?echo isSelected($s, $season)?>><?echo $s?></option>
|
|
|
|
+ <?
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+ <select name="csv_file" class="select-css" style="margin: 0;" onchange="this.form.submit()">
|
|
<?
|
|
<?
|
|
foreach($cleanArrs as $file){
|
|
foreach($cleanArrs as $file){
|
|
?><option value="<?echo $file?>" <?echo isSelected($file, $selected_csv)?>><?echo $file?></option>
|
|
?><option value="<?echo $file?>" <?echo isSelected($file, $selected_csv)?>><?echo $file?></option>
|
|
@@ -48,6 +58,7 @@ $selected_csv = isset($_GET["csv_file"]) ? $_GET["csv_file"] : reset($cleanArrs)
|
|
}
|
|
}
|
|
?>
|
|
?>
|
|
</select>
|
|
</select>
|
|
|
|
+ </div>
|
|
</form>
|
|
</form>
|
|
|
|
|
|
|
|
|