IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI, CMS, Outils, Scripts et API PHP Discussion :

[Calendrier] plages horaires cliquables


Sujet :

EDI, CMS, Outils, Scripts et API PHP

  1. #21
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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.

  2. #22
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    C'est un exemple de couplage HTML / PHP.

    Selon toi qu'est ce qui est plus propre:
    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>
    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.

    My 2 cents.

  3. #23
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    Ha ok j'avais pas compris ça.
    Merci du coup de pouce.

  4. #24
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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.

  5. #25
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    Non et d'ailleurs je n'utilise pas Zend, j'ai mes propres outils

  6. #26
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    Haha très très fort merci quand même.

  7. #27
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    Citation Envoyé par City-zen Voir le message
    Haha très très fort merci quand même.
    J'ai pas compris

  8. #28
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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?

  9. #29
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    Avec une bête comparaison d'intervale lors de la construction du tableau, tu mets les classes picked là ou il faut.

  10. #30
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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...

  11. #31
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    Citation Envoyé par City-zen Voir le message
    En PHP je vois pas comment faire à part un if dans chaque TD ce qui serait vraiment pas top je pense comme méthode.
    La génération de ton tableau se fait bien à partir d'une boucle non ? Dans ce cas, c'est pas plus mal de tester les valeurs pour poser les classes aux bons endroits au moment de sa construction.

  12. #32
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>

  13. #33
    Expert éminent
    Avatar de Benjamin Delespierre
    Profil pro
    Développeur Web
    Inscrit en
    Février 2010
    Messages
    3 929
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2010
    Messages : 3 929
    Points : 7 762
    Points
    7 762
    Par défaut
    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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>';
    C'est un gag ??

    Pourquoi tu ne fais pas générer ça dans la boucle ?

  14. #34
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    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...

  15. #35
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    28
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 28
    Points : 7
    Points
    7
    Par défaut
    J'ai fais ça de la façon suivante:

    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>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;&nbsp;</th><th>&nbsp;</th>';
    		}
    		else{
    			for ($k=00; $k<80; $k=$k+20) {
    				if ($k==60){
    					echo '<th>&nbsp;</th>';	
    				}
    				else {
    					echo '<td time="'.$format_heur[$i].$j.':'.$k.':00.000+02:00">'.$k.'</td>';
    				}
    			}
    		}
    	}
    	echo '</tr>';
     
    }
    Je ne sais pas si c'est le plus propre possible.

    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.

Discussions similaires

  1. [Formule]nombre de données dans une plage horaire
    Par melitoriva dans le forum Excel
    Réponses: 3
    Dernier message: 04/05/2007, 17h47
  2. Gestion de plages horaires
    Par Galaad dans le forum ASP
    Réponses: 3
    Dernier message: 24/01/2007, 12h14
  3. calcul délais entre deux dates avec plages horaires
    Par leila eco dans le forum SAP Crystal Reports
    Réponses: 3
    Dernier message: 03/01/2007, 16h51
  4. [debutant] intersection de deux plages horaires
    Par absolut75 dans le forum Collection et Stream
    Réponses: 10
    Dernier message: 24/05/2006, 13h03
  5. [SQL2005] plages horaires
    Par The_badger_man dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 03/05/2006, 12h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo