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

JavaScript Discussion :

[PHP-JS] calendrier cliquable javascript dans une page php


Sujet :

JavaScript

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Nouveau candidat au Club
    Inscrit en
    Mai 2008
    Messages
    1
    D�tails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 1
    Par d�faut [PHP-JS] calendrier cliquable javascript dans une page php
    Bonjour,
    voila c'est une page de reservation de gite ou jai voulu inserer un calendrier clikabl javascript
    le souci c ke le popup naparai po
    donk voila le script
    si vou pouviez maider
    merci davance
    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
    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
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    <html>
    <head>
    <title>Réserver un Gîte</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
     
    <body class="bost">
    <div align="center">
    <table id="Tableau_01" width="800" height="373" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td height="202" colspan="2"> <img src="images/BANNIERE.gif" width="800" height="202" alt=""></td>
    </tr>
    <tr background="images/index_02.gif">
    <td height="23" colspan="2">
    <p><font color="#FFFFFF">Bienvenue sur LES GÎTE DU VERTIGE : </font></p></td>
    </tr>
    <tr>
    <td width="193" height="148" bgcolor="#950000"><ul>
    <li></li>
    </ul></td>
    <td width="607"><div align="center">
    <center>
    <div align="center">
    <center>
    <table border="0" cellspacing="1" width="100%">
    <tr>
    <td width="22%" valign="top" align="center"><img border="0" src="images/queribus-p.jpg" width="149" height="96"><br>
    <font size="3">Château de Quéribus</font></td>
    <td width="60%" valign="top" align="center"> <p align="center"><b><font face="Verdana"><font size="6">Les
    Gîtes du Vertige</font><font size="7"><br>
    </font></font><font size="6"><img border="0" src="images/nav/bienvenue-anim.gif" width="292" height="93"></font></b></td>
    <td width="18%" valign="top" align="center"> <p align="center"><a href="mailto:[email protected]"><img border="0" src="../images/nav/mail-jaune-tournant.gif" width="90" height="70"></a><br>
    <b><font size="3">Nous contacter</font></b></td>
    </tr>
    </table>
    </center>
    </div>
    <div align="center"> </div>
    <b>FORMULAiRE DE RESERVATION</b> <br/>
    <form action=transfert.php method=GETonsubmit="return Verif(this.form)"
    <head>
    <script>
    function verifForm(formulaire){
    if( formulaire.nom.value == "")
    {
    alert('Veuillez saisir un Nom');
    document.forms['formulaire'].nom.focus(); return false;
    }
    if( formulaire.prenom.value == "")
    {
    alert('Veuillez saisir un Prenom');
    document.forms['formulaire'].prenom.focus(); return false;
    }
    if( formulaire.adresse.value == "")
    {
    alert('Veuillez saisir une Adresse');
    document.forms['formulaire'].adresse.focus(); return false;
    }
    if( formulaire.mp.value == "")
    {
    alert('Veuillez saisir un mot de passe');
    document.forms['formulaire'].mp.focus(); return false;
    }
    if( formulaire.mp2.value == "")
    {
    alert('Veuillez saisir un mot de passe 2');
    document.forms['formulaire'].mp2.focus(); return false;
    }
    if( formulaire.mp2.value != formulaire.mp.value)
    {
    alert('Les mots de passe doivent être identiques !');
    return false;
    }
    else
    formulaire.submit();
    }
    </script>
     
     
     
    </head>
     
     
    <br/>
     
    <table>
    <tr>
    <td> Nom : </td>
    <td> <input type ="text" name="nom" /> </td>
     
    </tr>
    <tr>
    <td> Prénom : </td>
    <td> <input type ="text" name="prenom" /> </td>
     
    </tr>
    <tr>
    <td> Adresse :</td>
    <td> <input type ="text" name="adresse" /> </td>
    </tr>
    <tr>
    <td> Saisir votre mot de passe : </td>
    <td> <input type ="password" name="mp" /> </td>
    </tr>
    <tr>
    <td> Confirmer votre mot de passe : </td>
    <td> <input type ="password" name="mp2" /> </td>
    </tr>
    <tr>
    </table>
    <?php
    $connexion=mysql_connect('localhost','root','lyonn') or die ("connexion impossible.");
    $db=mysql_select_db('gdv',$connexion) or die ("base de données non accessible");
    ?>
    <b> Sélectionnez votre gîte : </b> <br/>
    <br/>
    <select name="gite">
    <?php
    $resultat=mysql_query("SELECT NoGite,NomGite FROM GITE");
    if (! $resultat) { echo "Erreur requete"; exit;}
    while ($ligne=mysql_fetch_array($resultat))
    {
    ?>
    <option><?php echo ''.$ligne['NoGite'].'- '.$ligne['NomGite'];?> </option>
    <?php
    }
    mysql_close($connexion);
    ?>
    </select>
    <br/>
    <br/>
    <?php
    $connexion=mysql_connect('localhost','root','lyonn') or die ("connexion impossible.");
    $db=mysql_select_db('gdv',$connexion) or die ("base de données non accessible");
    ?>
    <b> Sélectionnez la saison : </b> <br/>
    <br/>
    <select name="saison">
    <?php
    $resultat2=mysql_query("SELECT CdSaison,LibSaison FROM SAISON");
    if (! $resultat2) { echo "Erreur requete"; exit;}
    while ($ligne=mysql_fetch_array($resultat2))
    {
    ?>
    <option><?php echo ''.$ligne['CdSaison'].'- '.$ligne['LibSaison'];?> </option>
    <?php
    }
    mysql_close($connexion);
    ?>
    </select>
     
    <table cellpadding="5" cellspacing="1" width="402" border="0">
    <tr>
    <td bgcolor="#ffffff" width="390">Date format européen (jj-mm-aaaa)</td>
    </tr>
    <form name="formulaire">
    <tr>
    <td bgcolor="#ffffff" valign="top" width="390">
    Choisir une date (j-mois-années)<br>
    <input type="Text" name="input1" value="" size="20">
    <a href="javascript:calendar1(this.popup);"><img src="images/cal.gif" width="16" height="16" border="0" alt="Cliquez ici pour obtenir la date."></a><br>
    </td>
    </tr>
    </form>
    <form>
    <script language="JavaScript">
    var cal1 = new calendar1(document.forms['formulaire'].elements['input1']);
    cal1.year_scroll = true;
    cal1.time_comp = false;
     
    //-->
    </script>
    </form>
    <form>
    <script type="text/javascript" language="JavaScript">
     
    var NUM_CENTYEAR = 30;
    var BUL_TIMECOMPONENT = false;
    var BUL_YEARSCROLL = true;
     
    var calendars = [];
    var RE_NUM = /^\-?\d+$/;
     
    function calendar1(obj_target) {
     
    this.gen_date = cal_gen_date1;
    this.gen_time = cal_gen_time1;
    this.gen_tsmp = cal_gen_tsmp1;
    this.prs_date = cal_prs_date1;
    this.prs_time = cal_prs_time1;
    this.prs_tsmp = cal_prs_tsmp1;
    this.popup = cal_popup1;
     
    if (!obj_target)
    return cal_error("Error calling the calendar: no target control specified");
    if (obj_target.value == null)
    return cal_error("Error calling the calendar: parameter specified is not valid target control");
    this.target = obj_target;
    this.time_comp = BUL_TIMECOMPONENT;
    this.year_scroll = BUL_YEARSCROLL;
     
    this.id = calendars.length;
    calendars[this.id] = this;
    }
     
    function cal_popup1 (str_datetime) {
    if (str_datetime) {
    this.dt_current = this.prs_tsmp(str_datetime);
    }
    else {
    this.dt_current = this.prs_tsmp(this.target.value);
    this.dt_selected = this.dt_current;
    }
    if (!this.dt_current) return;
     
    var obj_calwindow = window.open(
    'calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
    'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
    ',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
    );
    obj_calwindow.opener = window;
    obj_calwindow.focus();
    }
     
    function cal_gen_tsmp1 (dt_datetime) {
    return(this.gen_date(dt_datetime) + ' ' + this.gen_time(dt_datetime));
    }
     
    function cal_gen_date1 (dt_datetime) {
    return (
    (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "-"
    + (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "-"
    + dt_datetime.getFullYear()
    );
    }
    function cal_gen_time1 (dt_datetime) {
    return (
    (dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":"
    + (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":"
    + (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds())
    );
    }
     
    function cal_prs_tsmp1 (str_datetime) {
    if (!str_datetime)
    return (new Date());
     
    if (RE_NUM.exec(str_datetime))
    return new Date(str_datetime);
     
    var arr_datetime = str_datetime.split(' ');
    return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0]));
    }
     
    function cal_prs_date1 (str_date) {
     
    var arr_date = str_date.split('-');
     
    if (arr_date.length != 3) return cal_error ("Invalid date format: '" + str_date + "'.\nFormat accepted is dd-mm-yyyy.");
    if (!arr_date[0]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo day of month value can be found.");
    if (!RE_NUM.exec(arr_date[0])) return cal_error ("Invalid day of month value: '" + arr_date[0] + "'.\nAllowed values are unsigned integers.");
    if (!arr_date[1]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo month value can be found.");
    if (!RE_NUM.exec(arr_date[1])) return cal_error ("Invalid month value: '" + arr_date[1] + "'.\nAllowed values are unsigned integers.");
    if (!arr_date[2]) return cal_error ("Invalid date format: '" + str_date + "'.\nNo year value can be found.");
    if (!RE_NUM.exec(arr_date[2])) return cal_error ("Invalid year value: '" + arr_date[2] + "'.\nAllowed values are unsigned integers.");
     
    var dt_date = new Date();
    dt_date.setDate(1);
     
    if (arr_date[1] < 1 || arr_date[1] > 12) return cal_error ("Invalid month value: '" + arr_date[1] + "'.\nAllowed range is 01-12.");
    dt_date.setMonth(arr_date[1]-1);
     
    if (arr_date[2] < 100) arr_date[2] = Number(arr_date[2]) + (arr_date[2] < NUM_CENTYEAR ? 2000 : 1900);
    dt_date.setFullYear(arr_date[2]);
     
    var dt_numdays = new Date(arr_date[2], arr_date[1], 0);
    dt_date.setDate(arr_date[0]);
    if (dt_date.getMonth() != (arr_date[1]-1)) return cal_error ("Invalid day of month value: '" + arr_date[0] + "'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
     
    return (dt_date)
    }
     
     
    function cal_error (str_message) {
    alert (str_message);
    return null;
    }
    </script>
    </form>
     
    </table>
    </td></tr></table>
     
    <br/>
    <br/>
    <input type ="submit" VALUE="Envoyer" name="Envoyer" onClick="verifForm(this.form)"/>
    <input type ="reset" VALUE="Annuler" />
    </form>
    <form action="index2.html" >
    <input type ="submit" VALUE="Retour à l'acceuil" name='bouton'/>
    <br/>
    </form>
    </center>
    </div>
    <p align="center"> </p> </td>
    </tr>
    </table>
     
    </div>
    </body>
    </html>
    Configuration: Windows Vista
    Firefox 2.0.0.14

    et c un peu urgent...

  2. #2
    Membre �prouv�
    Profil pro
    D�veloppeur Web
    Inscrit en
    Juillet 2007
    Messages
    112
    D�tails du profil
    Informations personnelles :
    �ge : 38
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : D�veloppeur Web

    Informations forums :
    Inscription : Juillet 2007
    Messages : 112
    Par d�faut
    Penses � mettre des balises Code

    Maintenant, pour ce que tu veux faire, apparition disparition d'un div (visibility:hidden ou visible) me semblerait plus appropri� qu'une popup

    Ce n'est qu'un avis personnel

    Maintenant, quelques conseils pour avoir plus de r�ponses :

    Utilise des Balises Code
    Donne nous le r�sultat de l'interpr�tation php et non ton code brut, tu n'es pas dans la section php ici. Le fait que ton code ne puisse pas �tre vu tel qu'il est en rebutera plus d'un

    Ceci est un conseil pour tout le monde qui souhaite une r�ponse

  3. #3
    R�dacteur/Mod�rateur

    Avatar de SpaceFrog
    Homme Profil pro
    D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 659
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 75
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activit� : D�veloppeur Web Php Mysql Html Javascript CSS Apache - Int�grateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 659
    Billets dans le blog
    1
    Par d�faut
    sur le plan de la terminologie : rien n'est cliquable dans une page php ...
    php ne fait que gen�rer le html ..
    Ma page Developpez - Mon Blog Developpez
    Pr�sident du CCMPTP (Comit� Contre le Mot "Probl�me" dans les Titres de Posts)
    Deux r�gles du succ�s: 1) Ne communiquez jamais � quelqu'un tout votre savoir...
    Votre post est r�solu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de D�veloppez !

Discussions similaires

  1. Importation biblioth�ques javascript dans une page PHP/HTML
    Par carkiko dans le forum G�n�ral JavaScript
    R�ponses: 10
    Dernier message: 12/05/2015, 11h51
  2. R�ponses: 3
    Dernier message: 22/02/2010, 13h43
  3. R�ponses: 2
    Dernier message: 27/07/2007, 16h09
  4. Ins�rer un calendrier Flash/XML dans une page PHP
    Par paricilas dans le forum Flash
    R�ponses: 3
    Dernier message: 23/02/2007, 15h29
  5. [PHP-JS] Calculs dans une page php � l'aide javascript
    Par GClavet dans le forum G�n�ral JavaScript
    R�ponses: 7
    Dernier message: 31/10/2006, 09h10

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