forked from LeMoutonElectrique/StageAlexy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructLib.php
More file actions
163 lines (101 loc) · 3.93 KB
/
StructLib.php
File metadata and controls
163 lines (101 loc) · 3.93 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/*
* La Librairie de functions d'Alexy
*
* pour l'utiliser dans un fichier .php
* simplement
* include("alxLib.php")
*
* puis appeler les functions
* getHead("mon titre");
*
*/
/**
Fonction pour intégrer le head en pouvant choisir le titre avec un echo getHead();
*/
function getHead($titlehead){
if (empty($titlehead)) {
$titlehead = 'Vente de Jeux Videos en Ligne';
}
// la variable qui contiendra notre html
$result="";
// puis on y concaténe des chaines de caractéres
$result .= '<title>'.$titlehead.'</title>'."\n";
$result .= '<link rel="stylesheet" type="text/css" href="main.css">'."\n";
$result .= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>'."\n";
// puis on renvoie ça à l'appelant
return $result;
}
/**
Fonction pour intégrer le header et la suite de bouton qui le compose avec un echo getHeader();
*/
function getHeader(){
$Liste_Menu_Content = array("Panier","Contacts"," Nos Produits", "Accueil");
$Liste_Menu_Links = array("#","#","produits.php","index.php");
$Liste_Menu_Id = array("panier","contacts","produits","accueil");
$Menu_Deroulant_Content = array("PC","XBOX","SONY","RETRO");
$Menu_Deroulant_Content_Links = array("produits.php","produits.php","produits.php","produits.php");
$Menu_Deroulant_Content_Id = array("pc","xbox","sony","retro");
$result="";
echo "<header>\n";
echo "<nav>\n";
echo '<div class="menu_deroulant">'."\n";
for ($i=0; $i <2 ; $i++) {
echo "<a href=\"".$Liste_Menu_Links[$i]."\"><button id=\"".$Liste_Menu_Id[$i]."\">".$Liste_Menu_Content[$i]."</button></a>\n";
}
echo "<a href=\"".$Liste_Menu_Links[2]."\"><button id=\"".$Liste_Menu_Id[2]."\">".$Liste_Menu_Content[2]."</button></a>\n";
echo '<div class="menu_deroulant_content">'."\n";
for ($i=0; $i <count($Menu_Deroulant_Content) ; $i++) {
echo "<a href=\"".$Menu_Deroulant_Content_Links[$i]."\" id=\"".$Menu_Deroulant_Content_Id[$i]."\">".$Menu_Deroulant_Content[$i]."</a>\n";
};
echo '</div>'."\n";
echo '</div>'."\n";
echo '<div class="menu_deroulant">'."\n";
echo "<a href=\"".$Liste_Menu_Links[3]."\"><button id=\"".$Liste_Menu_Id[3]."\">".$Liste_Menu_Content[3]."</button></a>\n";
$result.= '</div>'."\n";
$result.= '</nav>'."\n";
$result.= '</header>'."\n";
return $result;
}
/*<div class="menu_deroulant">
<button class="menu_button">Catégories</button>
<div class="menu_deroulant_content">
<a href="#">Jeux</a>
<a href="#">Informatique</a>
<a href="#">Consoles</a>
</div>*/
function getMenuDéroulantContent(){
$Menu_Deroulant_Content = array("PC","XBOX","SONY","RETRO");
$Menu_Deroulant_Content_Links = array("produits.php","produits.php","produits.php","produits.php");
$Menu_Deroulant_Content_Id = array("pc","xbox","sony","retro");
$result="";
echo "<div id=\"menu_deroulant\">\n";
echo "<div id=\"menu_deroulant_content\">\n";
for ($i=0; $i <count($Menu_Deroulant_Content) ; $i++) {
echo "<a href=\"".$Menu_Deroulant_Content_Links[$i]."\" id=\"".$Menu_Deroulant_Content_Id[$i]."\">".$Menu_Deroulant_Content[$i]."</a>\n";
};
$result.= '</div>'."\n";
$result.= '</div>'."\n";
$result.= '</nav>'."\n";
$result.= '</header>'."\n";
return $result;
}
/**
Fonction pour intégrer le footer automatiquement avec un echo getFooter();
*/
function getFooter(){
$Column_List_Footer_Content = array("© 2018 VideoGames","Terms","Privacy","Security","Status","Help");
$Column_List_Footer_Id = array("copyright","terms","privacy","security","status","help");
$result="";
echo "<footer>\n";
echo "<table>\n";
echo "<tr>\n";
for ($l=0; $l < count($Column_List_Footer_Content) ; $l++) {
echo "<td id=\"".$Column_List_Footer_Id[$l]."\">".$Column_List_Footer_Content[$l]."</td>\n";
}
$result .= '</tr>'."\n";
$result .= '</table>'."\n";
$result .= '</footer>'."\n";
return $result;
}
?>