/
series.php
133 lines (125 loc) · 4.83 KB
/
series.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
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
<?php
include('header.php');
include("class/statistics.php");
if (isset($_POST['test_stat']))
{
$data = array();
for ($y = 0; $y < $_GET['numbers_data']; $y++)
{
$data[$_POST['data_0_'.$y.'']] = $_POST['data_1_'.$y.''];;
}
$stat = new statistics($data);
$result = $stat->getResult();
}
if ($_SESSION['langue'] == 'en')
{
$text = array("Statistics Series", "The system does not manage the complex numbers.", "Numbers of data", "Generate", "Calculate", "Data", "You have to choose the size of the array to generate it");
}
else if ($_SESSION['langue'] == 'fr')
{
$text = array("Series statistiques", "Le système ne prend pas en charge les nombres complexes.", "Nombres de données", "Generer", "Calculer", "Données", "Vous devez choisir la taille du tableau de données pour le générer");
}
?>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12" style="margin-top: 10px;">
<div class="alert alert-warning" role="alert"><?php echo $text[1]; ?></div>
</div>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-gear fa-fw" style="margin-right: 10px;"></i><?php echo $text[0]; ?>
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<form class="form-horizontal" method="get">
<fieldset>
<div class="form-group">
<label class="col-md-5 control-label" for="textinput"><?php echo $text[2]; ?></label>
<div class="col-md-7">
<input id="textinput" name="numbers_data" type="text" placeholder="" class="form-control input-md">
</div>
</div>
</fieldset>
</div>
<div class="panel-footer">
<button type="submit" value="ds" class="btn btn-primary center-block" style="width: 100%"><strong><?php echo $text[3]; ?></strong></button>
</div>
</form>
</div>
</div>
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-gear fa-fw" style="margin-right: 10px;"></i><?php echo $text[5]; ?>
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<?php
if (isset($_GET['numbers_data']))
{
?>
<form class="form-inline" method="post">
<table class="table table-bordered table-hover" data-height="299">
<tbody>
<tr>
<th>Valeur de la variable</th>
<th>Effectif</th>
</tr>
<?php
for ($y = 0; $y < $_GET['numbers_data']; $y++)
{
echo "<tr>";
for ($x = 0; $x < 2; $x++)
{
echo '<th><input id="textinput" name="data_'.$x.'_'.$y.'" type="text" placeholder="" style="width : 100%;" class="form-control input-md"></th>';
}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<div class="panel-footer">
<button type="submit" name="test_stat" class="btn btn-primary center-block" style="width: 100%"><?php echo $text[4]; ?></button>
</div>
</form>
<?php
}
else
{
?>
<code><?php echo $text[6]; ?></code>
<?php
}
?>
</div>
</div>
</div>
<div class="row">
<?php
if (isset($result))
{
?>
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-gear fa-fw" style="margin-right: 10px;"></i><?php echo $text[5]; ?>
</div>
<div class="panel-body">
<p>Moyenne : <?php echo $result[0]; ?></p>
<p>Variance : <?php echo $result[1]; ?></p>
<p>Ecart type : <?php echo $result[2]; ?></p>
<p>Mediane : <?php echo $result[3]; ?></p>
<p>Mode : <?php echo $result[4]; ?></p>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php
include('footer.php');
?>