-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.php
71 lines (64 loc) · 2.68 KB
/
popup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
include("functions.php");
$titre = isset($_POST["titre"]) ? $_POST["titre"]:"Popup";
$id_sel= isset($_POST["id_sel"]) ? $_POST["id_sel"]:null;
$popupFunction = $_POST["popupFunction"];
/* Popup Head */
$popupHead = "<div id=\"popupHead\">";
$popupHead .= "<div id=\"popupTitle\">$titre</div>";
$popupHead .= "<div id=\"closePopup\" onclick=\"closePopup()\"></div>";
$popupHead .= "</div>";
/* Popup content */
$popupHead .= "<div id=\"popupBody\">";
if($popupFunction == "popupConfirmSimu") {
if(is_dir_empty("gen/histos/") == TRUE) {
echo "ok";
return;
}
else {
echo $popupHead;
echo "<div id=\"popupBodyText\">There are already simulation results. Would you like to clean them ?</div>";
echo "<a class=\"button red\" onclick=\"showSimulationResults()\" />No</a>";
echo "<a class=\"button green\" onclick=\"generate()\" />Yes</a>";
}
}
elseif($popupFunction == "confirmDelSimu"){
echo $popupHead;
echo "<div id=\"popupBodyText\">You're going to delete the simulation n° ".$id_sel.", would you like to continue?</div>";
echo "<a class=\"button red\" onclick=\"closePopup()\" />No</a>";
echo "<a class=\"button green\" onclick=\"delete_simu(".$id_sel.")\" />Yes</a>";
}
elseif ($popupFunction == "confirmExportSimu") {
echo $popupHead;
echo "<div id=\"popupBodyText\">You're going to export the simulation n° ".$id_sel.", would you like to continue?</div>";
echo "<a class=\"button red\" onclick=\"closePopup()\" />No</a>";
echo "<a href=\"exportsimu.php?id_sel=".$id_sel."\" class=\"button green\" onclick=\"closePopup()\" />Yes</a>";
}
elseif($popupFunction == "confirmImportSimu"){
echo $popupHead;
echo "<div id=\"popupBodyText\">You're going to import a new simulation, would you like to continue?</div>";
echo "<a class=\"button red\" onclick=\"closePopup()\" />No</a>";
echo "<a class=\"button green\" onclick=\"verifyFile()\" />Yes</a>";
}
elseif($popupFunction == "wrongFile"){
echo $popupHead;
echo "<div id=\"popupBodyText\">You have to select a ZIP archive exported from ARTEMIS to import a simulation, please verify the file and try again.</div>";
echo "<a href=\"index.php\" class=\"button green\" onclick=\"closePopup()\" />Ok</a>";
}
else if($popupFunction == "loadingSimu") {
$progress = 0;
echo $popupHead;
echo "Loading....";
/*echo "<div id=\"progressbar\">";
echo "$progress %";
echo "</div>";*/
}
else if($popupFunction == "critButton") {
echo $popupHead;
echo "New criticality level<br />";
echo "Name:<input type=\"text\" id=\"nameNCL\" />";
echo "Code:<input type=\"text\" id=\"codeNCL\" />";
echo "<input type=\"button\" value=\"Add\" onclick=\"addCriticalityState()\" />";
}
echo "</div>";
?>