Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Ma première tentative de MVC en PHP

Emmanuel ROY authored on 13/06/2017 21:55:21
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,179 @@
1
+<?php
2
+
3
+function choixCSScookie(){
4
+	if(isset($_COOKIE['interfaceIHM'])){
5
+		switch($_COOKIE['interfaceIHM']){
6
+			case 1:
7
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface01.css'>";
8
+			break;
9
+			case 2:
10
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface02.css'>";
11
+			break;
12
+			case 3:
13
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface03.css'>";
14
+			break;
15
+			case 4:
16
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface04.css'>";
17
+			break;
18
+			case 5:
19
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface05.css'>";
20
+			break;
21
+			case 6:
22
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface06.css'>";
23
+			break;
24
+			case 7:
25
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface07.css'>";
26
+			break;
27
+			case 8:
28
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface08.css'>";
29
+			break;
30
+			case 9:
31
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface09.css'>";
32
+			break;
33
+			case 10:
34
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface10.css'>";
35
+			break;
36
+			case 11:
37
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface11.css'>";
38
+			break;
39
+			case 12:
40
+				echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface12.css'>";
41
+			break;
42
+			default:
43
+			echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface01.css'>";
44
+		}
45
+	}else{
46
+		echo "<link id='interface' type='text/css' rel='stylesheet' href='stylesCSS/interface03.css'>";
47
+	}
48
+	if(isset($_COOKIE['tailleLecture'])){
49
+		switch($_COOKIE['tailleLecture']){
50
+			case 1:
51
+				echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture01.css'>";
52
+			break;
53
+			case 2:
54
+				echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture02.css'>";
55
+			break;
56
+			case 3:
57
+				echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture03.css'>";
58
+			break;
59
+			case 4:
60
+				echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture04.css'>";
61
+			break;
62
+			case 5:
63
+				echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture05.css'>";
64
+			break;
65
+			default:
66
+			echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture01.css'>";
67
+		}
68
+	}else{
69
+		echo "<link id='lecture' type='text/css' rel='stylesheet' href='stylesCSS/lecture03.css'>";
70
+	}
71
+	if(isset($_COOKIE['typographie'])){
72
+		switch($_COOKIE['typographie']){
73
+			case 1:
74
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie01.css'>";
75
+			break;
76
+			case 2:
77
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie02.css'>";
78
+			break;
79
+			case 3:
80
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie03.css'>";
81
+			break;
82
+			case 4:
83
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie04.css'>";
84
+			break;
85
+			case 5:
86
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie05.css'>";
87
+			break;
88
+			case 6:
89
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie06.css'>";
90
+			break;
91
+			case 7:
92
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie07.css'>";
93
+			break;
94
+			case 8:
95
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie08.css'>";
96
+			break;
97
+			case 9:
98
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie09.css'>";
99
+			break;
100
+			case 10:
101
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie10.css'>";
102
+			break;
103
+			case 11:
104
+				echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie11.css'>";
105
+			break;
106
+			default:
107
+			echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie01.css'>";
108
+		}
109
+	}else{
110
+		echo "<link id='typographie' type='text/css' rel='stylesheet' href='stylesCSS/typographie01.css'>";
111
+	}
112
+	return(0);
113
+}
114
+
115
+function choixInterface($interface){
116
+	setcookie('interfaceIHM', $interface, time()+3600*24*365, '/', '');
117
+	return(0);
118
+}
119
+
120
+function choixGlyph($glyph){
121
+	setcookie('typographie',$glyph, time()+3600*24*365, '/', '');
122
+	return(0);
123
+}
124
+
125
+function choixTailleLecture($taille){
126
+	setcookie('tailleLecture',$taille, time()+3600*24*365, '/', '');
127
+	return(0);
128
+}
129
+
130
+function CheckPreferencesInterfaces($int){
131
+	if(isset($_COOKIE['interfaceIHM'])){
132
+		if(recuperationCookieInterface() == $int){
133
+			echo " checked";
134
+		}
135
+	}else{
136
+		if($int == 3){
137
+		echo " checked";
138
+		}
139
+	}
140
+	return;
141
+}
142
+function CheckPreferencesPolices($int){
143
+	if(isset($_COOKIE['typographie'])){
144
+		if(recuperationCookieGlyph() == $int){
145
+			echo " checked";
146
+		}
147
+	}else{
148
+		if($int == 1){
149
+		echo " checked";
150
+		}
151
+	}
152
+	return;
153
+}
154
+function CheckPreferencesCaracteres($int){
155
+	if(isset($_COOKIE['tailleLecture'])){
156
+		if(recuperationCookieTailleLecture() == $int){
157
+			echo " checked";
158
+		}
159
+	}else{
160
+		if($int == 3){
161
+		echo " checked";
162
+		}
163
+	}
164
+	return;
165
+}
166
+
167
+function recuperationCookieInterface(){
168
+	if(isset($_COOKIE['interfaceIHM'])){return($_COOKIE['interfaceIHM']);}else{return 5;};
169
+}
170
+
171
+function recuperationCookieGlyph(){
172
+	if(isset($_COOKIE['typographie'])){return($_COOKIE['typographie']);}else{return 1;};
173
+}
174
+
175
+function recuperationCookieTailleLecture(){
176
+	if(isset($_COOKIE['tailleLecture'])){return($_COOKIE['tailleLecture']);}else{return 3;};
177
+}
178
+
179
+?>