main_generateur.php
5.47 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html>
<?php
if(isset($_GET['tab'])){
$tab=$_GET['tab'];
}else{
$tab="Global";
}
echo '<div class="d-md-flex flex-md-equal w-100 my-md-3 pl-md-3">';
echo '<div class="mr-md-3 pt-3 px-3 pt-md-5 px-md-5 text-center">';
/* Affichage image */
include('./Scripts/creation_img.php');
echo '</div>';
echo '<div class="bg-light mr-md-3 pt-3 px-3 pt-md-5 px-md-5 overflow-hidden">';
/* Commandes de l'appareil */
echo '<div class="my-3 py-3">';
echo '<h2 class="display-6 text-center">Panel de commande</h2>';
echo '</div>';
echo '<div class="bd-example">';
echo '<nav>';
echo '<div class="bg-warning nav nav-tabs mb-3" id="nav-tab" role="tablist">';
$chemin = getcwd().'/'.$Appareil[$i]['type'];
$files = array_diff(scandir($chemin),array('Menus','..','.'));
foreach($files as $Fich){
$trypath = $chemin.'/'.$Fich;
if(is_dir($trypath)){
echo '<button class="nav-link ';
if($tab==$Fich){
echo "active";
}
echo '" id="nav-'.$Fich.'-tab" data-bs-toggle="tab" data-bs-target="#nav-'.$Fich.'" type="button" role="tab" aria-controls="nav-'.$Fich.'" aria-selected="true">'.$Fich.'</button>';
}
}
echo '</div>';
echo '</nav>';
echo '<div class="tab-content" id="nav-tabContent">';
foreach($files as $Fich){
$path = $chemin.'/'.$Fich;
if(is_dir($path)){
echo '<div class="tab-pane fade ';
if($tab==$Fich){
echo "show active";
}
echo '" id="nav-'.$Fich.'" role=tabpanel" aria-labelledby="nav-'.$Fich.'-tab">';
echo '<p>';
$files = array_diff(scandir($path),array('..','.'));
foreach($files as $dir){
$path2 = $path.'/'.$dir;
if(is_dir($path2)){
$files2 = array_diff(scandir($path2),array('..','.'));
foreach($files2 as $form){
$path3 = $path2.'/'.$form;
if(is_file($path3) && strpos($path3,"form")!=false){
include($path3);
echo '<br/>';
}
}
}
}
echo '</p>';
echo '</div>';
}
}
echo '</div>';
echo '</div>';
echo '</div>';
?>
<style>
.func-button{
height: 30px;
width: 80px;
background: #fff;
border-radius: 10px;
position: absolute;
}
.func-button:hover{
background: #b8ff70;
}
.func-button:active{
background: #07e50a;
}
</style>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func1" name="func1" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func1" name="func1" value="FUNC1" class="btn-outline-danger"/>
</form>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func2" name="func2" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func2" name="func2" value="FUNC2" class="btn-outline-danger"/>
</form>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func3" name="func3" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func3" name="func3" value="FUNC3" class="btn-outline-danger"/>
</form>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func4" name="func4" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func4" name="func4" value="FUNC4" class="btn-outline-danger"/>
</form>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func5" name="func5" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func5" name="func5" value="FUNC5" class="btn-outline-danger"/>
</form>
<form method="post" action="main.php?tab=<?php echo $tab; ?>">
<input type="button" id="func6" name="func6" class="func-button" value="" onclick="this.form.submit()"/>
<input type="hidden" id="func6" name="func6" value="FUNC6" class="btn-outline-danger"/>
</form>
</div>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func1');
btn.style = "top : "+pos.bottom+"px; left : "+pos.x+"px";
</script>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func2');
var pos_x = pos.x+80;
btn.style = "top : "+(pos.bottom)+"px; left : "+(pos_x)+"px";
</script>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func3');
var pos_x = pos.x+160;
btn.style = "top : "+(pos.bottom)+"px; left : "+(pos_x)+"px";
</script>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func4');
var pos_x = pos.x+240;
btn.style = "top : "+(pos.bottom)+"px; left : "+(pos_x)+"px";
</script>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func5');
var pos_x = pos.x+320;
btn.style = "top : "+(pos.bottom)+"px; left : "+(pos_x)+"px";
</script>
<script type='text/javascript'>
var elem = document.getElementById('cam<?php echo $i ?>');
var pos = elem.getBoundingClientRect();
var btn = document.getElementById('func6');
var pos_x = pos.x+400;
btn.style = "top : "+(pos.bottom)+"px; left : "+(pos_x)+"px";
</script>
</html>