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

jQuery Discussion :

Enregistrer les données avec Jformer


Sujet :

jQuery

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre habitué
    Inscrit en
    Août 2008
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 8
    Par défaut Enregistrer les données avec Jformer
    je n'arrive pas enregistrer mes données après le submit avec la fonction onSubmit de jformer j'ai essayer tous les test possible que je connais mais j pas pu connaitre le problème en plus aucun message d’alerte ou d'erreur n'est afficher
    voici le code de ma page
    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
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    <?php require_once('Connections/formulairecredit.php'); ?>
    <?php
    function dateen($d) {
        $annee = substr($d, 6, 4);
        $mois = substr($d, 3, 2);
        $jour = substr($d, 0, 2);
        return ($annee == "0000" || $annee == "" || $mois == "00" || $mois == "" || $jour == "00" || $jour == "") ? "" : $annee . '/' . $mois . '/' . $jour;
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test Jformer</title>
    <link rel="stylesheet" type="text/css" href="lib/jformer.css" />
    <script type="text/javascript" src="lib/jquery-1.5.2.min.js"></script>
    <script type="text/javascript" src="lib/jformer.js"></script>
    </head>
    <body>
    <div style="width:980px; margin:0 auto">
    <?php require_once('jformer.php'); ?>
    <?php
     
    include('arrays.php');
     
    // Create the form
    $survey = new JFormer('survey', array(
                'submitButtonText' => 'Envoyer',
                'title' => '<h1>Crédits Personnels</h1>',
                'pageNavigator' => true,
    						'splashPage' => array(
         				'content' => "<p><strong>Mediatix met à votre 'disposition des solutions de Crédits Immobiliers, quel que soit votre projet :  
     
    acquisition résidence principale, secondaire, parts de SCPI ou investissement locatif avec défiscalisation !</strong></p>
    <p>Mediatix vous accompagne et vous conseille tout au long de votre projet. Constituons ensemble votre dossier et nous le négocions, pour vous, auprès de nos banques partenaires. Profitez ainsi des meilleurs taux et conditions du marché en toute simplicité.<br />De plus, l'obtention de votre crédit immobilier par notre intermédiaire est entièrement gratuit, nous ne prenons aucun frais de dossier car nous sommes rémunérés par la banque comme apporteur d'affaires.<br />Non seulement vous ne payez rien, mais en plus vous obtenez le meilleur financement.<br />Nous négocions également pour vous l'assurance et la garantie, parce que votre crédit immobilier n'est pas qu'un taux d'intérêt, .</p>
    <p>En effet, votre crédit immobilier se décompose en 3 principaux éléments que nous devons négocier afin d'optimiser votre dossier de prêt :</p>
    <ul>
    <li><strong>1 - Le taux :</strong><br />Nous vous proposons les meilleurs taux négociés au mieux de vos intérêts</li>
    <li><strong>2 - L'assurance :</strong><br />Nous vous proposons des contrats d'assurance sur mesure vous permettant de réaliser jusqu'à 70% d'économie par rapport à l'assurance de la banque, tout en gardant les mêmes conditions.</li>
    <li><strong>3 - La garantie</strong><br />Parce qu'une garantie ne se prend pas à la légère, nous étudions ensemble celle qui est la mieux adaptée et la plus économique (caution, hypothèque, mutuelle…)</li>
    </ul>
    ",
    		 				'splashButtonText' => 'Demander un crédits Personnels'
     )
            ));
    $survey->action="creditpersonnel.php";
     
    // Create the form page
    $jFormPage1 = new JFormPage($survey->id . 'Page1', array(
                'title' => '<h2>Choix du projet</h2>'
            ));
    $jFormPage2 = new JFormPage($survey->id . 'Page2', array(
                'title' => '<h2>Identité</h2>'
            ));
    $jFormPage3 = new JFormPage($survey->id . 'Page3', array(
                'title' => '<h2>Informations personnelles</h2>'
            ));
    $jFormPage4 = new JFormPage($survey->id . 'Page4', array(
                'title' => '<h2>Budget</h2>'
            ));
    $jFormPage5 = new JFormPage($survey->id . 'Page5', array(
                'title' => '<h2>Assurance</h2>'
            ));
    // Create the form section
    $jFormSection1 = new JFormSection($survey->id . 'Section1', array(
                'title' => ''
            ));
    $jFormSection2 = new JFormSection($survey->id . 'Section2', array(
    					'title' => '<h3>Votre identification</h3>'
            ));
    $jFormSection2_1 = new JFormSection($survey->id . 'Section2_1', array(
    						'title' => '<h3>Votre situation familiale</h3>'
            ));
    $jFormSection2_2 = new JFormSection($survey->id . 'Section2_2', array(
    						'class' => 'identite-conjoint',
    						'dependencyOptions' => array(
                        'dependentOn' => array('titleCustomer', 'maritalStatusCustomer'),
                        'display' => 'hide',
                        'jsFunction' => '$("#titleCustomer option:selected").val()==1 && ($("#maritalStatusCustomer option:selected").val()=="m" || $("#maritalStatusCustomer option:selected").val()=="k");'
                    ),
    						'title' => "<h3>L'identité de votre conjoint</h3>"
            ));
    $jFormSection3 = new JFormSection($survey->id . 'Section3', array(
    					'title' => '<h3>Vos coordonnées</h3>'
            ));
    $jFormSection3_1 = new JFormSection($survey->id . 'Section3_1', array(
    						'title' => '<h3>Vos numéros de téléphone</h3>La saisie de plusieurs numéros peut accélérer le traitement de votre demande.'
            ));
    $jFormSection3_2 = new JFormSection($survey->id . 'Section3_2', array(
    						'title' => '<h3>Votre résidence principale</h3>'
            ));
    $jFormSection3_3 = new JFormSection($survey->id . 'Section3_3', array(
    						'title' => '<h3>Votre situation professionnelle</h3>'
            ));
    $jFormSection3_4 = new JFormSection($survey->id . 'Section3_4', array(
    						'dependencyOptions' => array(
                        'dependentOn' => 'activitySectorCustomer',
                        'display' => 'hide',
                        'jsFunction' => '$("#activitySectorCustomer option:selected").val()!="";'
                    ),
    						'title' => '<h3>Votre employeur</h3>'
            ));
    $jFormSection3_5 = new JFormSection($survey->id . 'Section3_5', array(
    						'title' => '<h3>Vos diplôme(s) et précédent(s) emploi(s)</h3>'
            ));
    $jFormSection3_6 = new JFormSection($survey->id . 'Section3_6', array(
    						'title' => '<h3>La situation professionnelle de votre conjoint</h3>'
            ));
    $jFormSection3_7 = new JFormSection($survey->id . 'Section3_7', array(
    						'dependencyOptions' => array(
                        'dependentOn' => 'maritalStatusCustomer',
                        'display' => 'hide',
                        'jsFunction' => '$("#maritalStatusCustomer option:selected").val()=="m";'
                    ),
    						'title' => "<h3>L'employeur de votre conjoint</h3>"
            ));
    $jFormSection4 = new JFormSection($survey->id . 'Section4', array(
    						'title' => '<h3>Revenus mensuels nets de votre foyer</h3>'
            ));
    $jFormSection4_1 = new JFormSection($survey->id . 'Section4_1', array(
    						'title' => '<h3>Charges mensuelles de votre foyer</h3>Saisissez le chiffre 0 si un champ ne vous concerne pas'
            ));
    $jFormSection4_2 = new JFormSection($survey->id . 'Section4_2', array(
    						'title' => '<h3>Vos coordonnées bancaires</h3>'
            ));	
    $jFormSection5 = new JFormSection($survey->id . 'Section5', array(
    						'title' => "<p>Pour bénéficier de l'assurance facultative, vous déclarez ne pas être atteint(e) d'affection nécessitant une surveillance ou un traitement médical régulier, ne pas être actuellement en arrêt de travail, ne pas avoir subi plus de 30 jours consécutifs ou non d'arrêt de travail pour maladie ou accident dans les 12 derniers mois.
    En outre, pour l'option incluant la garantie perte d'emploi suite à un licenciement, vous déclarez ne pas être âgé de plus de 55 ans, exercer une activité professionnelle salariée et ne pas faire actuellement l'objet d'une procédure de licenciement. </p>"
            ));
    // Add components to the section
    $jFormSection1->addJFormComponentArray(array(
    		new JFormComponentDropDown('projet', 'Type de projet :',
            $typeProjet,array(
    				'validationOptions' => array('required'),
            'tip' => '',
    		)),
        new JFormComponentSingleLineText('montant', 'Montant :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('mensualite', 'Mensualité :', array(
            'validationOptions' => array('decimal', 'mensualite_duree'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('duree', 'Ou la duréé :', array(
            'validationOptions' => array('decimal', 'duree_mensualite'),
            'tip' => '',
        ))
    ));
     
    $jFormSection2->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('titleCustomer', 'Civilité :',
            $titleCustomer,array(
    				'validationOptions' => array('required'),
            'tip' => '',
    		)),
    		new JFormComponentSingleLineText('nameCustomer', 'Nom :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('maidenNameCustomer', 'Nom jeune fille :', array(
    				'dependencyOptions' => array(
                        'dependentOn' => 'titleCustomer',
                        'display' => 'hide',
                        'jsFunction' => '$("#titleCustomer option:selected").val()==1;'
                    ),
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('firstNameCustomer', 'Prénom :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentDropDown('nationalityCustomer', 'Nationalité :',
            $nationalityCustomer,array(
    					'validationOptions' => array('required'),
            	'tip' => '',
    		)),
    		new JFormComponentSingleLineText('birthDate', "Date de naissance :", array(
            'validationOptions' => array('required', 'dateFr'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('birthLocationCustomer', 'Département de naissance :', array(
            'validationOptions' => array('required', 'departement_naissance'),
            'tip' => "99 pour l'étranger",
        )),
    		new JFormComponentSingleLineText('birthCityCustomer', 'Ville de naissance :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('emailCustomer', 'E-mail :', array(
            'validationOptions' => array('required', 'email'),
            'tip' => '',
        )),
    		new JFormComponentMultipleChoice('billing_shipping', '',
                array(
                    array('value' => '1', 'label' => "J'accepte de recevoir des offres commerciales de BNP Paribas Personal Finance par voie électronique."),
                )),
    ));
     
    $jFormSection2_1->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('maritalStatusCustomer', 'Situation familiale :',
            $maritalStatusCustomer,
            array('tip' => '','validationOptions' => array('required'),'tip' => '')),
    		new JFormComponentSingleLineText('childrenNumberCustomer', "Nombre d'enfant(s) à charge :", array(
            'validationOptions' => array('required', 'integer'),
            'tip' => '',
        ))
    ));
    $jFormSection2_2->addJFormComponentArray(array(
     
    		new JFormComponentSingleLineText('namePartner', 'Nom :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('firstNamePartner', 'Prénom :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    		new JFormComponentDropDown('nationalityPartner', 'Nationalité :',
            $nationalityCustomer,
            array('validationOptions' => array('required'),
                'tip' => '',
            'validationOptions' => array('required'),
            'tip' => '',
    		)),
    		new JFormComponentSingleLineText('birthDatePartner', "Date de naissance :", array(
            'validationOptions' => array('required', 'dateFr'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('birthLocationPartner', 'Département de naissance :', array(
            'validationOptions' => array('required', 'integer'),
            'tip' => "99 pour l'étranger",
        )),
    		new JFormComponentSingleLineText('birthCityPartner', 'Ville de naissance :', array(
            'validationOptions' => array('required', 'alpha'),
            'tip' => '',
        )),
    ));
     
    $jFormSection3->addJFormComponentArray(array(
     
    		new JFormComponentSingleLineText('addressCustomer', 'Adresse :', array(
            'validationOptions' => array('required'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('complementaryAddressCustomer', "Complément d'adresse :", array(
            'validationOptions' => array('required'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('zipCodeCustomer', "Code postal :", array(
            'validationOptions' => array('required', 'integer'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('cityCustomer', "Ville :", array(
            'validationOptions' => array('required'),
            'tip' => '',
        )),
    ));
     
    $jFormSection3_1->addJFormComponentArray(array(
     
    		new JFormComponentSingleLineText('phoneNumberCustomer', 'Domicile :', array(
            'validationOptions' => array('required', 'telephone'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('mobilePhoneNumberCustomer', 'Mobile :', array(
            'validationOptions' => array('required', 'telephone'),
            'tip' => '',
        )),
    		new JFormComponentSingleLineText('jobPhoneNumberCustomer', 'Professionnel :', array(
            'validationOptions' => array('required', 'telephone'),
            'tip' => '',
        )),
    ));
    $jFormSection3_2->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('housingTypeCustomer', "Mode d'habitation :",
            $housingTypeCustomer,
            array('tip' => '','validationOptions' => array('required'),'tip' => '')),
    		new JFormComponentSingleLineText('housingSeniorityCustomer', 'Dans votre logement actuel depuis :', array(
            'validationOptions' => array('required', 'dateFr'),
            'tip' => '',
        )),
    ));
     
    $jFormSection3_3->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('activitySectorCustomer', "Secteur d'activité :",
            $activitySectorCustomer,array(
    				'tip' => '',
    				'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorPrive', "Profession ou situation :",
            $activitySectorPrive,array(
    					'dependencyOptions' => array('dependentOn' => 'activitySectorCustomer',
    																				'display' => 'hide',
    																				'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0SPR";'),
    					'tip' => '',
    					'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorPublic', "Profession ou situation :",
            $activitySectorPublic,array(
    					'dependencyOptions' => array('dependentOn' => 'activitySectorCustomer',
    																			'display' => 'hide',
    																			'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0SPU";'),
    					'tip' => '',
    					'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorAgricole', "Profession ou situation :",
            $activitySectorAgricole,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomer',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0SAG";'),
    				'tip' => '',
    				'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorArtisantCommercant', "Profession ou situation :",
            $activitySectorArtisantCommercant,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomer',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0ACO";'),
    				'tip' => '',
    				'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorProfessionsLiberales', "Profession ou situation :",
            $activitySectorProfessionsLiberales,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomer',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0PLI";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    		new JFormComponentDropDown('activitySectorAutres', "Profession ou situation :",
            $activitySectorAutres,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomer',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0AUT";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    		new JFormComponentSingleLineText('dateJobSeniorityCustomer', "Chez l'employeur actuel<br />ou dans la même situation depuis :", array(
            'validationOptions' => array('required', 'dateFr'),
            'tip' => '',)),
     
    		new JFormComponentSingleLineText('employerIdCustomer', 'N° SIREN / SIRET / RCS :', array(
    				'dependencyOptions' => array(
    					'dependentOn' => array(
    						'activitySectorCustomer',
    						'activitySectorArtisantCommercant'),
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0ACO" && $("#activitySectorArtisantCommercant option:selected").val()!=""'),
            'validationOptions' => array('required', 'integer'),
            'tip' => 'Les 9 premiers chiffres',
        )),
     
    		new JFormComponentDropDown('contractTypeCustomerAgricole', "Contrat de travail :",
            $contractTypeCustomerAgricole,array('
    				dependencyOptions' => array(
    					'dependentOn' => array('activitySectorCustomer','activitySectorAgricole'),
    					'display' => 'hide',
    					'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0SAG" && $("#activitySectorAgricole option:selected").val()=="02";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    		new JFormComponentDropDown('contractTypeCustomerEtudiant', "Contrat de travail :",
            $contractTypeCustomerEtudiant,array(
    				'dependencyOptions' => array(
    					'dependentOn' => array('activitySectorCustomer','activitySectorAutres'),
    					'display' => 'hide',
    					'jsFunction' => '$("#activitySectorCustomer option:selected").val()=="0AUT" && $("#activitySectorAutres option:selected").val()=="89";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    		));
     
    $jFormSection3_4->addJFormComponentArray(array(				
    		new JFormComponentSingleLineText('employerNameCustomer', "Nom :", array(
            'validationOptions' => array(),
            'tip' => '',
        )),
     
    		new JFormComponentSingleLineText('employerPostalCityCustomer', "ville :", array(
            'validationOptions' => array(),
            'tip' => '',
        )),
    ));
     
    $jFormSection3_5->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('levelEducationCustomer', "Niveau d'étude :",
            $levelEducationCustomer,
            array('tip' => '','validationOptions' => array('required'),'tip' => '')),
     
    		new JFormComponentSingleLineText('degreeYearCustomer', "Année d'obtention :", array(
            'validationOptions' => array('required', 'integer'),
            'tip' => '',
        )),
     
    		new JFormComponentSingleLineText('employmentsNbCustomer', "Nombre d'emploi :", array(
            'validationOptions' => array('required', 'integer'),
            'tip' => "Nombre d'emploi(s) occupé(s) depuis le dernier diplôme",
        )),
    ));
     
    $jFormSection3_6->addJFormComponentArray(array(
     
    		new JFormComponentDropDown('activitySectorCustomerP', "Secteur d'activité :",
            $activitySectorCustomer,array(
    					'validationOptions' => array('required'),
    					'tip' => '')),
     
    		new JFormComponentDropDown('activitySectorPriveP', "Profession ou situation :",
            $activitySectorPrive,array(
    					'dependencyOptions' => array('dependentOn' => 'activitySectorCustomerP',
    																				'display' => 'hide',
    																				'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0SPR";'),
    					'tip' => '',
    					'validationOptions' => array('required'))),
     
    		new JFormComponentDropDown('activitySectorPublicP', "Profession ou situation :",
            $activitySectorPublic,array(
    					'dependencyOptions' => array('dependentOn' => 'activitySectorCustomerP',
    																			'display' => 'hide',
    																			'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0SPU";'),
    					'tip' => '',
    					'validationOptions' => array('required'))),
     
    			new JFormComponentDropDown('activitySectorAgricoleP', "Profession ou situation :",
            $activitySectorAgricole,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomerP',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0SAG";'),
    				'tip' => '',
    				'validationOptions' => array('required'))),
     
    			new JFormComponentDropDown('activitySectorArtisantCommercantP', "Profession ou situation :",
            $activitySectorArtisantCommercant,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomerP',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0ACO";'),
    				'tip' => '',
    				'validationOptions' => array('required'))),	
     
    			new JFormComponentDropDown('activitySectorProfessionsLiberalesP', "Profession ou situation :",
            $activitySectorProfessionsLiberales,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomerP',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0PLI";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    			new JFormComponentDropDown('activitySectorAutresP', "Profession ou situation :",
            $activitySectorAutres,array(
    					'dependencyOptions' => array(
    						'dependentOn' => 'activitySectorCustomerP',
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0AUT";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    			new JFormComponentSingleLineText('dateJobSeniorityCustomerP', "Chez l'employeur actuel<br />ou dans la même situation depuis :", array(
            'validationOptions' => array('required', 'dateFr'),
            'tip' => '',)),
    			new JFormComponentSingleLineText('employerIdCustomerP', 'N° SIREN / SIRET / RCS :', array(
    				'dependencyOptions' => array(
    					'dependentOn' => array(
    						'activitySectorCustomerP',
    						'activitySectorArtisantCommercantP'),
    						'display' => 'hide',
    						'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0ACO" && $("#activitySectorArtisantCommercantP option:selected").val()!=""'),
            'validationOptions' => array('required', 'integer'),
            'tip' => 'Les 9 premiers chiffres',
        )),
     
    		new JFormComponentDropDown('contractTypeCustomerAgricoleP', "Contrat de travail :",
            $contractTypeCustomerAgricole,array('
    				dependencyOptions' => array(
    					'dependentOn' => array('activitySectorCustomerP','activitySectorAgricoleP'),
    					'display' => 'hide',
    					'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0SAG" && $("#activitySectorAgricoleP option:selected").val()=="02";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
     
    		new JFormComponentDropDown('contractTypeCustomerEtudiantP', "Contrat de travail :",
            $contractTypeCustomerEtudiant,array(
    				'dependencyOptions' => array(
    					'dependentOn' => array('activitySectorCustomerP','activitySectorAutresP'),
    					'display' => 'hide',
    					'jsFunction' => '$("#activitySectorCustomerP option:selected").val()=="0AUT" && $("#activitySectorAutresP option:selected").val()=="89";'),
    				'validationOptions' => array('required'),
    				'tip' => '')),
    		));
    $jFormSection3_7->addJFormComponentArray(array(				
    		new JFormComponentSingleLineText('employerNameCustomerP', "Nom :", array(
            'validationOptions' => array(),
            'tip' => '',
        )),
     
    		new JFormComponentSingleLineText('employerPostalCityCustomerP', "ville :", array(
            'validationOptions' => array(),
            'tip' => '',
        )),
    ));
     
    $jFormSection4->addJFormComponentArray(array(
        new JFormComponentSingleLineText('netIncomeCustomer', 'Revenus mensuels nets de votre foyer :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois',
        )),
    		new JFormComponentSingleLineText('netIncomePartner', 'Les revenus de votre conjoint :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois',
        ))
    ));
     
    $jFormSection4_1->addJFormComponentArray(array(
        new JFormComponentSingleLineText('houseRentCustomer', 'Loyer / remboursement résidence principale :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois',)),
    		new JFormComponentSingleLineText('ctlmCreditCustomer', 'Crédit(s) en cours CETELEM :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois Cumul des mensualités',)),
    		new JFormComponentSingleLineText('otherCreditCustomer', 'Crédit(s) en cours hors CETELEM :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois Cumul des mensualités',)),
    		new JFormComponentSingleLineText('alimonyExpenseCustomer', 'Pension(s) alimentaire(s) :', array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois',)),
    		new JFormComponentSingleLineText('childrenKeepingExpenseCustomer', "Frais de garde d'enfant(s) :", array(
            'validationOptions' => array('required', 'money'),
            'tip' => '€ / mois',)),
    ));
     
    $jFormSection4_2->addJFormComponentArray(array(
    		new JFormComponentDropDown('bankCustomer', 'Votre banque :',
            $bankCustomer,
            array('validationOptions' => array('required'),
                'tip' => ''
    		)),
        new JFormComponentSingleLineText('bankSeniorityCustomer', 'Compte bancaire ouvert depuis :', array(
            'validationOptions' => array('required', 'integer'),
            'tip' => '',
    				'dependencyOptions' => array(
                        'dependentOn' => 'bankCustomer',
                        'display' => 'hide',
                        'jsFunction' => '$("#bankCustomer option:selected").val()!="";'
                    ),
        ))
    ));
     
    $jFormSection5->addJFormComponentArray(array(
        new JFormComponentMultipleChoice('insuranceChoiceCustomer', '', array(
            array('value' => 'Email', 'label' => "Je souhaite souscrire à l'assurance facultative et je confirme avoir lu la notice d'information"),
            array('value' => 'Text Message', 'label' => "Je ne souhaite pas souscrire à l'assurance facultative.<br />
    Dans ce cas, l'information m'a été communiquée que je demeurerai ou mes éventuels ayants droits redevable des sommes dues au titre de ce contrat en cas de décès, invalidité, arrêt de travail ou perte d'emploi.
    Merci de confirmer le choix effectué ci-dessus. "),
                ),
                array(
                    'multipleChoiceType' => 'radio',
                    'validationOptions' => array('required'),
        )),
     
    ));
    // Add the section to the page
    $jFormPage1->addJFormSection($jFormSection1);
    $jFormPage2->addJFormSections(array($jFormSection2 , $jFormSection2_1 , $jFormSection2_2));
    $jFormPage3->addJFormSections(array($jFormSection3 , $jFormSection3_1 , $jFormSection3_2 , $jFormSection3_3 , $jFormSection3_4 , $jFormSection3_5 , $jFormSection3_6 , $jFormSection3_7));
    $jFormPage4->addJFormSections(array($jFormSection4 , $jFormSection4_1 , $jFormSection4_2));
    $jFormPage5->addJFormSection($jFormSection5);
    // Add the page to the form
    $survey->addJFormPages(array($jFormPage1 , $jFormPage2 , $jFormPage3 , $jFormPage4 , $jFormPage5));
     
    // Set the function for a successful form submission
    function onSubmit($formValues) {
    /*$hostname_test_jformer = "localhost";
    $database_test_jformer = "test_jformer";
    $username_test_jformer = "root";
    $password_test_jformer = "mx16";
    $test_jformer = mysql_pconnect($hostname_test_jformer, $username_test_jformer, $password_test_jformer) or trigger_error(mysql_error(),E_USER_ERROR);
    mysql_query("SET NAMES UTF8");*/
    $err='';
    if($formValues->surveyPage5->surveySection5->insuranceChoiceCustomer->choice1){
    		$insuranceChoiceCustomer = 1;
    }
    else{
    	$insuranceChoiceCustomer = 0;
    }
    	$req_insert_client= "insert into clients (
    	titleCustomer,
      nameCustomer,
    	maidenNameCustomer,
    	firstNameCustomer,
    	nationalityCustomer,
    	birthDate,
    	birthLocationCustomer,
    	birthCityCustomer,
    	emailCustomer,
    	billing_shipping,
    	maritalStatusCustomer,
    	childrenNumberCustomer,
    	namePartner,
    	firstNamePartner,
    	nationalityPartner,
    	birthDatePartner,
    	birthLocationPartner,
    	birthCityPartner,
    	addressCustomer,
    	complementaryAddressCustomer,
    	zipCodeCustomer,
    	cityCustomer,
    	phoneNumberCustomer,
    	mobilePhoneNumberCustomer,
    	jobPhoneNumberCustomer,
    	housingTypeCustomer,
    	housingSeniorityCustomer,
    	activitySectorCustomer,
    	dateJobSeniorityCustomer,
    	employerIdCustomer,
    	contractTypeCustomer,
    	employerNameCustomer,
    	employerPostalCityCustomer,
    	levelEducationCustomer,
    	degreeYearCustomer,
    	employmentsNbCustomer,
    	activitySectorCustomerP,
    	dateJobSeniorityCustomerP,
    	employerIdCustomerP,
    	contractTypeCustomerP,
    	employerNameCustomerP,
    	employerPostalCityCustomerP,
    	netIncomeCustomer,
    	netIncomePartner,
    	houseRentCustomer,
    	ctlmCreditCustomer,
    	otherCreditCustomer,
    	alimonyExpenseCustomer,
    	childrenKeepingExpenseCustomer,
    	bankCustomer,
    	bankSeniorityCustomer,
    	insuranceChoiceCustomer
    	) values (
    	'".$formValues->surveyPage2->surveySection2->titleCustomer."',
      '".$formValues->surveyPage2->surveySection2->nameCustomer."',
      '".$formValues->surveyPage2->surveySection2->maidenNameCustomer."',
      '".$formValues->surveyPage2->surveySection2->firstNameCustomer."',
      '".$formValues->surveyPage2->surveySection2->nationalityCustomer."',
      '".dateen($formValues->surveyPage2->surveySection2->birthDate)."',
      '".$formValues->surveyPage2->surveySection2->birthLocationCustomer."',
      '".$formValues->surveyPage2->surveySection2->birthCityCustomer."',
      '".$formValues->surveyPage2->surveySection2->emailCustomer."',
      '".$formValues->surveyPage2->surveySection2->billing_shipping."',
      '".$formValues->surveyPage2->surveySection2_1->maritalStatusCustomer."',
      '".$formValues->surveyPage2->surveySection2_1->childrenNumberCustomer."',
      '".$formValues->surveyPage2->surveySection2_2->namePartner."',
      '".$formValues->surveyPage2->surveySection2_2->firstNamePartner."',
      '".$formValues->surveyPage2->surveySection2_2->nationalityPartner."',
      '".dateen($formValues->surveyPage2->surveySection2_2->birthDatePartner)."',
      '".$formValues->surveyPage2->surveySection2_2->birthLocationPartner."',
      '".$formValues->surveyPage2->surveySection2_2->birthCityPartner."',
      '".$formValues->surveyPage3->surveySection3->addressCustomer."',
      '".$formValues->surveyPage3->surveySection3->complementaryAddressCustomer."',
      '".$formValues->surveyPage3->surveySection3->zipCodeCustomer."',
      '".$formValues->surveyPage3->surveySection3->cityCustomer."',
      '".$formValues->surveyPage3->surveySection3_1->phoneNumberCustomer."',
      '".$formValues->surveyPage3->surveySection3_1->mobilePhoneNumberCustomer."',
      '".$formValues->surveyPage3->surveySection3_1->jobPhoneNumberCustomer."',
      '".$formValues->surveyPage3->surveySection3_2->housingTypeCustomer."',
      '".$formValues->surveyPage3->surveySection3_2->housingSeniorityCustomer."',
      '".$formValues->surveyPage3->surveySection3_3->activitySectorCustomer."',
      '".dateen($formValues->surveyPage3->surveySection3_3->dateJobSeniorityCustomer)."',
      '".$formValues->surveyPage3->surveySection3_3->employerIdCustomer."',
      '".$formValues->surveyPage3->surveySection3_3->contractTypeCustomer."',
      '".$formValues->surveyPage3->surveySection3_3->employerNameCustomer."',
      '".$formValues->surveyPage3->surveySection3_3->employerPostalCityCustomer."',
      '".$formValues->surveyPage3->surveySection3_5->levelEducationCustomer."',
      '".$formValues->surveyPage3->surveySection3_5->degreeYearCustomer."',
      '".$formValues->surveyPage3->surveySection3_5->employmentsNbCustomer."',
      '".$formValues->surveyPage3->surveySection3_3->activitySectorCustomerP."',
      '".dateen($formValues->surveyPage3->surveySection3_3->dateJobSeniorityCustomerP)."',
      '".$formValues->surveyPage3->surveySection3_3->employerIdCustomerP."',
      '".$formValues->surveyPage3->surveySection3_3->contractTypeCustomerP."',
      '".$formValues->surveyPage3->surveySection3_7->employerNameCustomerP."',
      '".$formValues->surveyPage3->surveySection3_7->employerPostalCityCustomerP."',
      '".$formValues->surveyPage4->surveySection4->netIncomeCustomer."',
      '".$formValues->surveyPage4->surveySection4->netIncomePartner."',
      '".$formValues->surveyPage4->surveySection4_1->houseRentCustomer."',
      '".$formValues->surveyPage4->surveySection4_1->ctlmCreditCustomer."',
      '".$formValues->surveyPage4->surveySection4_1->otherCreditCustomer."',
      '".$formValues->surveyPage4->surveySection4_1->alimonyExpenseCustomer."',
      '".$formValues->surveyPage4->surveySection4_1->childrenKeepingExpenseCustomer."',
      '".$formValues->surveyPage4->surveySection4_2->bankCustomer."',
      '".$formValues->surveyPage4->surveySection4_2->bankSeniorityCustomer."',
      '".$insuranceChoiceCustomer."')";
    	mysql_select_db($database_test_jformer, $test_jformer);
    	$res_insert_client=mysql_query($req_insert_client) or $err.="<br>Erreur client : ".mysql_error()." - ".$req_insert_client;
    	$req_insert_projet= "insert into projets (client_id , type, montant, mensualite, duree) values(
      ".mysql_insert_id().",
    	'".$formValues->surveyPage1->surveySection1->projet."',
    	'".$formValues->surveyPage1->surveySection1->montant."',
      '".$formValues->surveyPage1->surveySection1->mensualite."',
      '".$formValues->surveyPage1->surveySection1->duree."')";
    	$res_insert_projet=mysql_query($req_insert_projet) or $err.="<br>Erreur projet : ".mysql_error();
    		if($res_insert_projet && $res_insert_client){
    			$tab=array(
    			'successPageHtml' => '<p>Votre compte a été créé avec succès</p>'
        );
    	}
    	else{
    		$tab=array(
            'successPageHtml' => "<p>$err</p>"
        );
    	}
        return $tab;
    }
    // Process any request to the form
    $survey->processRequest();
    ?>
    </div>
    </body>
    </html>

  2. #2
    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
    le source html généré nous serait plus utile !
    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. enregistrer les données avec le binding navigateur
    Par adel.87 dans le forum Débuter
    Réponses: 11
    Dernier message: 08/10/2008, 16h15
  2. Réponses: 2
    Dernier message: 09/01/2008, 08h50
  3. Enregistrer les données d'une table dans un fichier texte word ou excel
    Par maamar1979 dans le forum Connexion aux bases de données
    Réponses: 2
    Dernier message: 14/06/2006, 13h41
  4. Réponses: 6
    Dernier message: 06/06/2006, 11h46
  5. enregistrer les données d'un FORMULAIRE sur une TABLE
    Par godzinho dans le forum Access
    Réponses: 15
    Dernier message: 11/03/2006, 18h03

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