Oui je connais le modèle MVC mais c'est vrai que j'ai pas encore vraiment la méthodologie et le réflexe pour le mettre en place.
J'ai pas vraiment compris l’intérêt du bout de code que tu m'as fourni.
Oui je connais le modèle MVC mais c'est vrai que j'ai pas encore vraiment la méthodologie et le réflexe pour le mettre en place.
J'ai pas vraiment compris l’intérêt du bout de code que tu m'as fourni.
C'est un exemple de couplage HTML / PHP.
Selon toi qu'est ce qui est plus propre:
Dans le premier cas, l'indentation deviens (très) vite un casse-tête. De plus, si tu as un IDE comme Eclipse ou NetBeans, la coloration syntaxique permet une meilleure lisibilité avec le deuxième type de code.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <html> bla bla bla <?php if ($condition) { echo "<span>blablabla</span>"; } ?> </html> // ou <html> bla bla bla <?php if ($condition): ?> <span>bla bla bla</span> <?php endif ?> </html>
My 2 cents.
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
Ha ok j'avais pas compris ça.
Merci du coup de pouce.
Est-ce que tu aurais déjà créé une connexion avec un google calendar?
J'ai importé Zend.
Je me perd un peu dans les include et les requires dont j'ai besoin.
Également dans mon choix d'authentification (ClientAuth, AuthSub).
Etant donné que je veux seulement créé une connexion avec le calendar afin d'enregistrer et d'extraire des donnés et que ça soit ouvert à tout les clients sans authentification.
Après niveau manip pour faire ça, je pense avoir trouvé ce qu'il me faut.
Non et d'ailleurs je n'utilise pas Zend, j'ai mes propres outils
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
Je disais que tu es très fort par rapport au fait que tu ai créé tes propres outils.
Sinon pour Zend ça fonctionne, ça sent la fin!!!
Le seul petit problème que je vais rencontrer, c'est comment rendre "picked" un td en fonction de son time. Si le lundi à 10h la plage est prise, je le vois grace au info que je récupère du calendar mais comment à partir de cette info et du time correspondant puis-je rendre le td picked?
Avec une bête comparaison d'intervale lors de la construction du tableau, tu mets les classes picked là ou il faut.
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
En PHP je vois pas comment faire à part un if dans chaque TD ce qui serait vraiment pas top je pense comme méthode.
Je pense qu'il doit y avoir une manière bien plus efficace en Javascript mais mes limites dans ce langage me bloquent encore une fois...
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
Non, ça n'est plus une boucle.
Voilà à quoi ressemble le code maintenant.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 if (isset($_POST["time"])) { require_once 'Zend/Loader.php'; require_once 'Zend/Gdata/Calendar.php'; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_Query'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; $user = "*********@gmail.com"; $pass = "*********"; // Create an authenticated HTTP client $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); // Create an instance of the Calendar service $service = new Zend_Gdata_Calendar($client); $cal = new Zend_Gdata_Calendar($client); $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); $service = new Zend_Gdata_Calendar($client); $eventURL = "https://www.google.com/calendar/feeds/phoneglasstoulouse%40gmail.com/private-7ee50cdf1fabe5ab581d44d425059c0a/basic"; // Create a new entry using the calendar service's magic factory method $event= $service->newEventEntry(); // Populate the event with the desired information // Note that each attribute is crated as an instance of a matching class $event->title = $service->newTitle("My Event"); $event->where = array($service->newWhere("Mountain View, California")); $event->content = $service->newContent(" This is my awesome event. RSVP required."); // Set the date using RFC 3339 format. $durée = 30; $min_fin = split("[:T]", $_POST["time"]); $min= $min_fin[2] + $durée; $h=$min_fin[1]; if ($min>=60){ $min=$min-60; $h=$h+1; } $time_fin = $min_fin[0]."T".$h.":".$min.":".$min_fin[3].":".$min_fin[4]; echo $time_fin; $when = $service->newWhen(); $when->startTime = $_POST["time"]; $when->endTime = $time_fin; $event->when = array($when); // Upload the event to the calendar server // A copy of the event as it is recorded on the server is returned $newEvent = $service->insertEvent($event); } <table id="plages"> <tr> <th></th> <th colspan="4">10h</th> <th colspan="4">11h</th> <th colspan="4">12h</th> <th colspan="4">13h</th> <th colspan="4">14h</th> <th colspan="4">15h</th> <th colspan="4">16h</th> <th colspan="4">17h</th> <th colspan="4">18h</th> <th colspan="4">19h</th> </tr> <?php $jour = array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"); $mois = array("","Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"); $mois_nbr = array("","01","02","03","04","05","06","07","08","09","10","11","12"); date_default_timezone_set('Europe/Paris'); $now = time(); $then = strtotime('+8 days', $now); // dans 4 semaines $current = $now; do { if (date('D', $current) == 'Sun') // ou Dim selon la locale continue; $dateDuJour[] = $jour[date("w",$current)]." ".date("d",$current)." ".$mois[date("n",$current)]." ".date("Y",$current); $format_heur[] = date("Y",$current)."-".$mois_nbr[date("n",$current)]."-".date("d",$current)."T"; } while (($current = strtotime('+1 days', $current)) && $current <= $then); echo '<tr><th>'.$dateDuJour[0].'</th><td time="'.$format_heur[0].'10:00:00.000+02:00">00</td><td time="'.$format_heur[0].'10:20:00.000+02:00">20</td><td time="'.$format_heur[0].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'11:00:00.000+02:00">00</td><td time="'.$format_heur[0].'11:20:00.000+02:00">20</td><td time="'.$format_heur[0].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'12:00:00.000+02:00">00</td><td time="'.$format_heur[0].'12:20:00.000+02:00">20</td><td time="'.$format_heur[0].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'13:00:00.000+02:00">00</td><td time="'.$format_heur[0].'13:20:00.000+02:00">20</td><td time="'.$format_heur[0].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[0].'16:00:00.000+02:00">00</td><td time="'.$format_heur[0].'16:20:00.000+02:00">20</td><td time="'.$format_heur[0].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'17:00:00.000+02:00">00</td><td time="'.$format_heur[0].'17:20:00.000+02:00">20</td><td time="'.$format_heur[0].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'18:00:00.000+02:00">00</td><td time="'.$format_heur[0].'18:20:00.000+02:00">20</td><td time="'.$format_heur[0].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'19:00:00.000+02:00">00</td><td time="'.$format_heur[0].'19:20:00.000+02:00">20</td><td time="'.$format_heur[0].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[1].'</th><td time="'.$format_heur[1].'10:00:00.000+02:00">00</td><td time="'.$format_heur[1].'10:20:00.000+02:00">20</td><td time="'.$format_heur[1].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'11:00:00.000+02:00">00</td><td time="'.$format_heur[1].'11:20:00.000+02:00">20</td><td time="'.$format_heur[1].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'12:00:00.000+02:00">00</td><td time="'.$format_heur[1].'12:20:00.000+02:00">20</td><td time="'.$format_heur[1].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'13:00:00.000+02:00">00</td><td time="'.$format_heur[1].'13:20:00.000+02:00">20</td><td time="'.$format_heur[1].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[1].'16:00:00.000+02:00">00</td><td time="'.$format_heur[1].'16:20:00.000+02:00">20</td><td time="'.$format_heur[1].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'17:00:00.000+02:00">00</td><td time="'.$format_heur[1].'17:20:00.000+02:00">20</td><td time="'.$format_heur[1].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'18:00:00.000+02:00">00</td><td time="'.$format_heur[1].'18:20:00.000+02:00">20</td><td time="'.$format_heur[1].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'19:00:00.000+02:00">00</td><td time="'.$format_heur[1].'19:20:00.000+02:00">20</td><td time="'.$format_heur[1].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[2].'</th><td time="'.$format_heur[2].'10:00:00.000+02:00">00</td><td time="'.$format_heur[2].'10:20:00.000+02:00">20</td><td time="'.$format_heur[2].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'11:00:00.000+02:00">00</td><td time="'.$format_heur[2].'11:20:00.000+02:00">20</td><td time="'.$format_heur[2].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'12:00:00.000+02:00">00</td><td time="'.$format_heur[2].'12:20:00.000+02:00">20</td><td time="'.$format_heur[2].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'13:00:00.000+02:00">00</td><td time="'.$format_heur[2].'13:20:00.000+02:00">20</td><td time="'.$format_heur[2].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[2].'16:00:00.000+02:00">00</td><td time="'.$format_heur[2].'16:20:00.000+02:00">20</td><td time="'.$format_heur[2].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'17:00:00.000+02:00">00</td><td time="'.$format_heur[2].'17:20:00.000+02:00">20</td><td time="'.$format_heur[2].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'18:00:00.000+02:00">00</td><td time="'.$format_heur[2].'18:20:00.000+02:00">20</td><td time="'.$format_heur[2].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'19:00:00.000+02:00">00</td><td time="'.$format_heur[2].'19:20:00.000+02:00">20</td><td time="'.$format_heur[2].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[3].'</th><td time="'.$format_heur[3].'10:00:00.000+02:00">00</td><td time="'.$format_heur[3].'10:20:00.000+02:00">20</td><td time="'.$format_heur[3].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'11:00:00.000+02:00">00</td><td time="'.$format_heur[3].'11:20:00.000+02:00">20</td><td time="'.$format_heur[3].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'12:00:00.000+02:00">00</td><td time="'.$format_heur[3].'12:20:00.000+02:00">20</td><td time="'.$format_heur[3].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'13:00:00.000+02:00">00</td><td time="'.$format_heur[3].'13:20:00.000+02:00">20</td><td time="'.$format_heur[3].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[3].'16:00:00.000+02:00">00</td><td time="'.$format_heur[3].'16:20:00.000+02:00">20</td><td time="'.$format_heur[3].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'17:00:00.000+02:00">00</td><td time="'.$format_heur[3].'17:20:00.000+02:00">20</td><td time="'.$format_heur[3].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'18:00:00.000+02:00">00</td><td time="'.$format_heur[3].'18:20:00.000+02:00">20</td><td time="'.$format_heur[3].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'19:00:00.000+02:00">00</td><td time="'.$format_heur[3].'19:20:00.000+02:00">20</td><td time="'.$format_heur[3].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[4].'</th><td time="'.$format_heur[4].'10:00:00.000+02:00">00</td><td time="'.$format_heur[4].'10:20:00.000+02:00">20</td><td time="'.$format_heur[4].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'11:00:00.000+02:00">00</td><td time="'.$format_heur[4].'11:20:00.000+02:00">20</td><td time="'.$format_heur[4].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'12:00:00.000+02:00">00</td><td time="'.$format_heur[4].'12:20:00.000+02:00">20</td><td time="'.$format_heur[4].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'13:00:00.000+02:00">00</td><td time="'.$format_heur[4].'13:20:00.000+02:00">20</td><td time="'.$format_heur[4].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[4].'16:00:00.000+02:00">00</td><td time="'.$format_heur[4].'16:20:00.000+02:00">20</td><td time="'.$format_heur[4].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'17:00:00.000+02:00">00</td><td time="'.$format_heur[4].'17:20:00.000+02:00">20</td><td time="'.$format_heur[4].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'18:00:00.000+02:00">00</td><td time="'.$format_heur[4].'18:20:00.000+02:00">20</td><td time="'.$format_heur[4].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'19:00:00.000+02:00">00</td><td time="'.$format_heur[4].'19:20:00.000+02:00">20</td><td time="'.$format_heur[4].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[5].'</th><td time="'.$format_heur[5].'10:00:00.000+02:00">00</td><td time="'.$format_heur[5].'10:20:00.000+02:00">20</td><td time="'.$format_heur[5].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'11:00:00.000+02:00">00</td><td time="'.$format_heur[5].'11:20:00.000+02:00">20</td><td time="'.$format_heur[5].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'12:00:00.000+02:00">00</td><td time="'.$format_heur[5].'12:20:00.000+02:00">20</td><td time="'.$format_heur[5].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'13:00:00.000+02:00">00</td><td time="'.$format_heur[5].'13:20:00.000+02:00">20</td><td time="'.$format_heur[5].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[5].'16:00:00.000+02:00">00</td><td time="'.$format_heur[5].'16:20:00.000+02:00">20</td><td time="'.$format_heur[5].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'17:00:00.000+02:00">00</td><td time="'.$format_heur[5].'17:20:00.000+02:00">20</td><td time="'.$format_heur[5].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'18:00:00.000+02:00">00</td><td time="'.$format_heur[5].'18:20:00.000+02:00">20</td><td time="'.$format_heur[5].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'19:00:00.000+02:00">00</td><td time="'.$format_heur[5].'19:20:00.000+02:00">20</td><td time="'.$format_heur[5].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[6].'</th><td time="'.$format_heur[6].'10:00:00.000+02:00">00</td><td time="'.$format_heur[6].'10:20:00.000+02:00">20</td><td time="'.$format_heur[6].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'11:00:00.000+02:00">00</td><td time="'.$format_heur[6].'11:20:00.000+02:00">20</td><td time="'.$format_heur[6].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'12:00:00.000+02:00">00</td><td time="'.$format_heur[6].'12:20:00.000+02:00">20</td><td time="'.$format_heur[6].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'13:00:00.000+02:00">00</td><td time="'.$format_heur[6].'13:20:00.000+02:00">20</td><td time="'.$format_heur[6].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[6].'16:00:00.000+02:00">00</td><td time="'.$format_heur[6].'16:20:00.000+02:00">20</td><td time="'.$format_heur[6].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'17:00:00.000+02:00">00</td><td time="'.$format_heur[6].'17:20:00.000+02:00">20</td><td time="'.$format_heur[6].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'18:00:00.000+02:00">00</td><td time="'.$format_heur[6].'18:20:00.000+02:00">20</td><td time="'.$format_heur[6].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'19:00:00.000+02:00">00</td><td time="'.$format_heur[6].'19:20:00.000+02:00">20</td><td time="'.$format_heur[6].'19:40:00.000+02:00">40</td></tr>'; ?> </table> <form action="calendrier" method="post"> <input type="text" id="time" name="time" value="" /> <input type="submit" value="Réserver" /> </form> <script type="text/javascript"> $(function () { $('#plages td:not(.picked)').click(function () { $('#plages td').removeClass('clicked'); $(this).toggleClass('clicked'); $('#time').val( $(this).attr('time') ); }); }); </script>
C'est un gag ??
Code : Sélectionner tout - Visualiser dans une fenêtre à part echo '<tr><th>'.$dateDuJour[0].'</th><td time="'.$format_heur[0].'10:00:00.000+02:00">00</td><td time="'.$format_heur[0].'10:20:00.000+02:00">20</td><td time="'.$format_heur[0].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'11:00:00.000+02:00">00</td><td time="'.$format_heur[0].'11:20:00.000+02:00">20</td><td time="'.$format_heur[0].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'12:00:00.000+02:00">00</td><td time="'.$format_heur[0].'12:20:00.000+02:00">20</td><td time="'.$format_heur[0].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'13:00:00.000+02:00">00</td><td time="'.$format_heur[0].'13:20:00.000+02:00">20</td><td time="'.$format_heur[0].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[0].'16:00:00.000+02:00">00</td><td time="'.$format_heur[0].'16:20:00.000+02:00">20</td><td time="'.$format_heur[0].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'17:00:00.000+02:00">00</td><td time="'.$format_heur[0].'17:20:00.000+02:00">20</td><td time="'.$format_heur[0].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'18:00:00.000+02:00">00</td><td time="'.$format_heur[0].'18:20:00.000+02:00">20</td><td time="'.$format_heur[0].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[0].'19:00:00.000+02:00">00</td><td time="'.$format_heur[0].'19:20:00.000+02:00">20</td><td time="'.$format_heur[0].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[1].'</th><td time="'.$format_heur[1].'10:00:00.000+02:00">00</td><td time="'.$format_heur[1].'10:20:00.000+02:00">20</td><td time="'.$format_heur[1].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'11:00:00.000+02:00">00</td><td time="'.$format_heur[1].'11:20:00.000+02:00">20</td><td time="'.$format_heur[1].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'12:00:00.000+02:00">00</td><td time="'.$format_heur[1].'12:20:00.000+02:00">20</td><td time="'.$format_heur[1].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'13:00:00.000+02:00">00</td><td time="'.$format_heur[1].'13:20:00.000+02:00">20</td><td time="'.$format_heur[1].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[1].'16:00:00.000+02:00">00</td><td time="'.$format_heur[1].'16:20:00.000+02:00">20</td><td time="'.$format_heur[1].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'17:00:00.000+02:00">00</td><td time="'.$format_heur[1].'17:20:00.000+02:00">20</td><td time="'.$format_heur[1].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'18:00:00.000+02:00">00</td><td time="'.$format_heur[1].'18:20:00.000+02:00">20</td><td time="'.$format_heur[1].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[1].'19:00:00.000+02:00">00</td><td time="'.$format_heur[1].'19:20:00.000+02:00">20</td><td time="'.$format_heur[1].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[2].'</th><td time="'.$format_heur[2].'10:00:00.000+02:00">00</td><td time="'.$format_heur[2].'10:20:00.000+02:00">20</td><td time="'.$format_heur[2].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'11:00:00.000+02:00">00</td><td time="'.$format_heur[2].'11:20:00.000+02:00">20</td><td time="'.$format_heur[2].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'12:00:00.000+02:00">00</td><td time="'.$format_heur[2].'12:20:00.000+02:00">20</td><td time="'.$format_heur[2].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'13:00:00.000+02:00">00</td><td time="'.$format_heur[2].'13:20:00.000+02:00">20</td><td time="'.$format_heur[2].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[2].'16:00:00.000+02:00">00</td><td time="'.$format_heur[2].'16:20:00.000+02:00">20</td><td time="'.$format_heur[2].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'17:00:00.000+02:00">00</td><td time="'.$format_heur[2].'17:20:00.000+02:00">20</td><td time="'.$format_heur[2].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'18:00:00.000+02:00">00</td><td time="'.$format_heur[2].'18:20:00.000+02:00">20</td><td time="'.$format_heur[2].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[2].'19:00:00.000+02:00">00</td><td time="'.$format_heur[2].'19:20:00.000+02:00">20</td><td time="'.$format_heur[2].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[3].'</th><td time="'.$format_heur[3].'10:00:00.000+02:00">00</td><td time="'.$format_heur[3].'10:20:00.000+02:00">20</td><td time="'.$format_heur[3].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'11:00:00.000+02:00">00</td><td time="'.$format_heur[3].'11:20:00.000+02:00">20</td><td time="'.$format_heur[3].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'12:00:00.000+02:00">00</td><td time="'.$format_heur[3].'12:20:00.000+02:00">20</td><td time="'.$format_heur[3].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'13:00:00.000+02:00">00</td><td time="'.$format_heur[3].'13:20:00.000+02:00">20</td><td time="'.$format_heur[3].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[3].'16:00:00.000+02:00">00</td><td time="'.$format_heur[3].'16:20:00.000+02:00">20</td><td time="'.$format_heur[3].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'17:00:00.000+02:00">00</td><td time="'.$format_heur[3].'17:20:00.000+02:00">20</td><td time="'.$format_heur[3].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'18:00:00.000+02:00">00</td><td time="'.$format_heur[3].'18:20:00.000+02:00">20</td><td time="'.$format_heur[3].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[3].'19:00:00.000+02:00">00</td><td time="'.$format_heur[3].'19:20:00.000+02:00">20</td><td time="'.$format_heur[3].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[4].'</th><td time="'.$format_heur[4].'10:00:00.000+02:00">00</td><td time="'.$format_heur[4].'10:20:00.000+02:00">20</td><td time="'.$format_heur[4].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'11:00:00.000+02:00">00</td><td time="'.$format_heur[4].'11:20:00.000+02:00">20</td><td time="'.$format_heur[4].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'12:00:00.000+02:00">00</td><td time="'.$format_heur[4].'12:20:00.000+02:00">20</td><td time="'.$format_heur[4].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'13:00:00.000+02:00">00</td><td time="'.$format_heur[4].'13:20:00.000+02:00">20</td><td time="'.$format_heur[4].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[4].'16:00:00.000+02:00">00</td><td time="'.$format_heur[4].'16:20:00.000+02:00">20</td><td time="'.$format_heur[4].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'17:00:00.000+02:00">00</td><td time="'.$format_heur[4].'17:20:00.000+02:00">20</td><td time="'.$format_heur[4].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'18:00:00.000+02:00">00</td><td time="'.$format_heur[4].'18:20:00.000+02:00">20</td><td time="'.$format_heur[4].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[4].'19:00:00.000+02:00">00</td><td time="'.$format_heur[4].'19:20:00.000+02:00">20</td><td time="'.$format_heur[4].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[5].'</th><td time="'.$format_heur[5].'10:00:00.000+02:00">00</td><td time="'.$format_heur[5].'10:20:00.000+02:00">20</td><td time="'.$format_heur[5].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'11:00:00.000+02:00">00</td><td time="'.$format_heur[5].'11:20:00.000+02:00">20</td><td time="'.$format_heur[5].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'12:00:00.000+02:00">00</td><td time="'.$format_heur[5].'12:20:00.000+02:00">20</td><td time="'.$format_heur[5].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'13:00:00.000+02:00">00</td><td time="'.$format_heur[5].'13:20:00.000+02:00">20</td><td time="'.$format_heur[5].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[5].'16:00:00.000+02:00">00</td><td time="'.$format_heur[5].'16:20:00.000+02:00">20</td><td time="'.$format_heur[5].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'17:00:00.000+02:00">00</td><td time="'.$format_heur[5].'17:20:00.000+02:00">20</td><td time="'.$format_heur[5].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'18:00:00.000+02:00">00</td><td time="'.$format_heur[5].'18:20:00.000+02:00">20</td><td time="'.$format_heur[5].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[5].'19:00:00.000+02:00">00</td><td time="'.$format_heur[5].'19:20:00.000+02:00">20</td><td time="'.$format_heur[5].'19:40:00.000+02:00">40</td></tr><tr><th>'.$dateDuJour[6].'</th><td time="'.$format_heur[6].'10:00:00.000+02:00">00</td><td time="'.$format_heur[6].'10:20:00.000+02:00">20</td><td time="'.$format_heur[6].'10:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'11:00:00.000+02:00">00</td><td time="'.$format_heur[6].'11:20:00.000+02:00">20</td><td time="'.$format_heur[6].'11:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'12:00:00.000+02:00">00</td><td time="'.$format_heur[6].'12:20:00.000+02:00">20</td><td time="'.$format_heur[6].'12:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'13:00:00.000+02:00">00</td><td time="'.$format_heur[6].'13:20:00.000+02:00">20</td><td time="'.$format_heur[6].'13:40:00.000+02:00">40</td><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><td time="'.$format_heur[6].'16:00:00.000+02:00">00</td><td time="'.$format_heur[6].'16:20:00.000+02:00">20</td><td time="'.$format_heur[6].'16:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'17:00:00.000+02:00">00</td><td time="'.$format_heur[6].'17:20:00.000+02:00">20</td><td time="'.$format_heur[6].'17:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'18:00:00.000+02:00">00</td><td time="'.$format_heur[6].'18:20:00.000+02:00">20</td><td time="'.$format_heur[6].'18:40:00.000+02:00">40</td><th> </th><td time="'.$format_heur[6].'19:00:00.000+02:00">00</td><td time="'.$format_heur[6].'19:20:00.000+02:00">20</td><td time="'.$format_heur[6].'19:40:00.000+02:00">40</td></tr>';
Pourquoi tu ne fais pas générer ça dans la boucle ?
On vous a menti
PHP, Injection de dépendances et composants
La POO en PHP en 10 minutes pour moins
Suivez-moi sur GitHub et Twitter
N'oubliez pas de vous servir des bouttons , et
Faire une boucle pour chaque jours me pose pas de problème.
Par heure non plus.
Mais gérer la ligne entière avec les cases vides, je vois pas comment mis prendre...
J'ai fais ça de la façon suivante:
Je ne sais pas si c'est le plus propre possible.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 for ($i=0; $i<8; $i++) { echo '<tr><th>'.$dateDuJour[$i].'</th>'; for ($j=10; $j<20; $j++) { if ($j==14 OR $j==15){ echo '<th> </th><th> </th><th> </th><th> </th>'; } else{ for ($k=00; $k<80; $k=$k+20) { if ($k==60){ echo '<th> </th>'; } else { echo '<td time="'.$format_heur[$i].$j.':'.$k.':00.000+02:00">'.$k.'</td>'; } } } } echo '</tr>'; }
Mais il y a un petit soucis concernant la variable $k qui doit avoir comme première valeur '00' et qui se simplifie en '0'.
Est-ce obligatoire de faire un if $k=0 $k='00' à l'intérieur de la boucle.
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager