Bonjour !
Je viens vous exposer un problème que j'ai depuis un certain temps et je ne trouve pas encore la source.
Je vous expose le problème en détail :
J'ai un formulaire sur une page qui a deux fonctions, dans un premier temps il calcule la distance entre deux adresse postale avec l'API google map et JavaScrpit. Puis il envoie en Post les infos du formulaire vers une page récapitulatif.
La page récapitulatif expose au client le compte rendu de ce qu'il a rentré dans le formulaire et les résultats des calcules de couts, et des calcules de date (nous somme dans le cas d'un devis). De plus toutes les informations renseignés par le client sont enregistrer en BDD via une requête préparer SQL.
Dans les différentes étapes du dev tout fonctionnais bien jusqu’à l'incorporation du SQL. Actuellement mes infos envoyer en post n'arrive pas sur l'autre page. Et le code dans le navigateur s’arrête a l'include de la requête SQL.
Enfin je crée un token qui serra evoyer dans un lien par mail pour accédé a une page qui récapitule le devis, des fois que le client a besoin de le revoir.
Je vous met les codes concerner. (Attention c'est long)
Page du formulaire :
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 | <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Logistique Alsace / Entreposage</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="css/modern-business.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <script type="text/javascript" src="js/verification_formulaire.js"></script> <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA09qY5o0F96_hLg4YyfFG3xRoIzq7W9kjqpTzBbn7O9wu0Oc8uhR44zTSflabpsk8CmRkpT3W0E7hSA"></script> <script type="text/javascript"> var geocoder, location1, location2, gDir; var sec=0; function initialize() { geocoder = new GClientGeocoder(); gDir = new GDirections(); GEvent.addListener(gDir, "load", function() { var drivingDistanceMiles = gDir.getDistance().meters / 1609.344; var drivingDistanceKilometers = gDir.getDistance().meters / 1000; document.form1.distance.value=parseInt(drivingDistanceKilometers); document.form1.distancehidden.value=parseInt(drivingDistanceKilometers); document.getElementById('results').innerHTML = 'Départ : ' + location1.address + '<br />depivée : ' + location2.address + '<br /> '; clearInterval(interv); document.getElementsByTagName('body')[0].style.cursor = 'default'; }); } function incremente() { if (sec<10) { sec++ } else { alert("Désolés, nous ne parvenons pas à calculer la distance"); clearInterval(interv); document.getElementsByTagName('body')[0].style.cursor = 'default'; sec=0; document.getElementById('results').innerHTML = ''; document.form1.distance.value=''; } } function showLocation() { interv=setInterval("incremente()",1000); document.getElementsByTagName('body')[0].style.cursor = 'wait'; var depart=document.forms[0].adresse_dep.value + ' ' + document.forms[0].cp_dep.value + ' ' + document.forms[0].ville_dep.value + ' ' + document.forms[0].pays_dep.value; var depivee=document.forms[0].adresse_arr.value + ' ' + document.forms[0].cp_arr.value + ' ' + document.forms[0].ville_arr.value + ' ' + document.forms[0].pays_arr.value; geocoder.getLocations(depart, function (response) { if (!response || response.Status.code != 200) { alert("Désolés, nous ne parvenons pas à localiser l'adresse de départ"); clearInterval(interv); document.getElementsByTagName('body')[0].style.cursor = 'default'; } else { location1 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address}; geocoder.getLocations(depivee, function (response) { if (!response || response.Status.code != 200) { alert("Désolés, nous ne parvenons pas à localiser l'adresse d'depivée"); clearInterval(interv); document.getElementsByTagName('body')[0].style.cursor = 'default'; } else { location2 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address}; gDir.load('from: ' + location1.address + ' to: ' + location2.address); } }); } }); } </script> <!-- jQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </head> <body onload="initialize()" style="background-color : rgba(51, 122, 183, 0.4);"> <!-- Navigation --> <?php include("Menu.php") ?> <!-- Header Carousel --> <!-- Page Content --> <div class="container"> <!-- Marketing Icons Section --> <!-- /.row --> <div class="container"> <div class="col-sm-8 col-sm-offset-2"> <div class="panel panel-default"> <div class="panel-body"> <div class="col-lg-12" style="background-color: rgba(51, 122, 183);" > <div class="panel-body "> <center> <!-- Form Name --> <legend>Votre devis d'entreposage avec transport à partir du <?php echo $date_client ?></legend> <form id="form1" name="form1" class="form-horizontal" action="EntreposageT2.php" method="post" onsubmit="return valideForm(this)"> <fieldset> <input type="hidden" name="date_client" value="<?php echo $date_client;?>" placeholder="ex : France" required/> <input type="hidden" class="form-control" id="adresse_dep" name="adresse_dep" value="50 rue de la gare" rows=3 placeholder="ex : 1 rue de la paix" /> <input type="hidden" class="form-control" id="cp_dep" name="cp_dep" value="67118" placeholder="ex : 67000" required/> <input type="hidden" class="form-control" id="ville_dep" name="ville_dep" value="Geispolsheim" placeholder="ex : Strasbourg" required/> <input type="hidden" class="form-control" id="pays_dep" name="pays_dep" value="France" placeholder="ex : France" required/> <input type="hidden" class="form-control" id="pays_arr" name="pays_arr" value="France" placeholder="ex : France" required/> <!-- Form Name --> <legend><h1>Votre devis de messagerie</h1></legend> <!-- Text input--> <div class="control-group"> <h2>Adresse de déchargement</h2> <label class="control-label" for="adresse_arr">Adresse *</label> <div class="controls"> <input name="adresse_arr" id="adresse_arr" placeholder="ex : 1 rue de la paix" class="input-large" required="" type="text" autofocus> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="cp_arr">Code postal *</label> <div class="controls"> <input name="cp_arr" id="cp_arr" placeholder="ex : 67000" class="input-large" required="" type="text" max="10"> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="ville_arr">Ville *</label> <div class="controls"> <input id="ville_arr" name="ville_arr" placeholder="ex : Strasbourg" class="input-large" required="" type="text"> </div> </div> <!-- Text input--> <div class="control-group"> <h2>Vos informations</h2> <label class="control-label" for="entreprise">Raison social *</label> <div class="controls"> <input id="entreprise" name="entreprise" placeholder="ex : Pepsi-cola sarl" class="input-large" required="" type="text"> <p class="help-block">Nom complet de votre entreprise</p> </div> </div> <div class="control-group"> <label class="control-label" for="NTVA">TVA intracommunautaire</label> <div class="controls"> <input id="NTVA" name="NTVA" placeholder="ex : Pepsi-cola sarl" class="input-large" maxlength="12" required="" type="text"> <p class="help-block"></p> </div> </div> <!-- Password input--> <div class="control-group"> <label class="control-label" for="nom">Nom et prénom *</label> <div class="controls"> <input id="nom" name="nom" placeholder="ex : Jean dupond" class="input-large" required="" type="text"> <p class="help-block">Indiquez nous votre nom et prénom ou celui de la personne suceptible d'être contacter</p> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="Telephone">Telephone *</label> <div class="controls"> <input id="Telephone" name="Telephone" placeholder="ex : 0698784524" class="input-large" maxlength="10" required="" type="text"> <p class="help-block">Indiquez nous votre numéro de telephone (fix ou mobile) pour pouvoir vous joindre</p> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="email">Email *</label> <div class="controls"> <input id="email" name="email" placeholder="ex : monnom@mail.fr" class="input-large" required="" type="text"> <p class="help-block">Le devis vous serra envoyer en copie par mail.</p> </div> </div> <!-- Text input--> <div class="control-group"> <label class="control-label" for="email2">Confirmez votre mail *</label> <div class="controls"> <input id="email2" name="email2" placeholder="ex : monnom@mail.fr" class="input-large" required="" type="text"> <p class="help-block">Rentrer votre mail une nouvelle fois</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="nbp">Nombre de palettes *</label> <div class="controls"> <input id="nbp" name="nbp" placeholder="ex : 4" class="input-mini" required="" type="number" min="1"> <p class="help-block">Nombre de palettes qui compose le stock pris en charge</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="mois" style="color : red;" >Nombre de mois *</label> <div class="controls"> <input id="mois" name="mois" placeholder="ex : 2" class="input-mini" required="" type="number"> <p class="help-block" style="color : red;" >Si vous souhaitez enlever tout ou partie de votre marchandise c'est possible. Tous mois commencé serra facturé, Toute entrée et/ou sortie supplémentaire serra facturée 2,5 € par palette.</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="hm">Hauteur maximum *</label> <div class="controls"> <input id="hm" name="hm" placeholder="ex : 15" class="input-mini" required="" type="number" min="10"> cm <p class="help-block">Heuteur de votre palette la plus haute en cm</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="nb100x100">Nombre de palette format 100 x 100 *</label> <div class="controls"> <input id="nb100x100" name="nb100x100" placeholder="ex : 2" class="input-mini" required="" type="number" min="0" > <p class="help-block">Parmis vos palettes combiens sont au format 100 x 100 cm ?</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="nb120x120">Nombre de palette format 120 x 120 *</label> <div class="controls"> <input id="nb120x120" name="nb120x120" placeholder="ex : 2" class="input-mini" required="" type="number" min="0" > <p class="help-block">Parmis vos palettes combiens sont au format 120 x 120 cm ?</p> </div> </div> <!-- Number input--> <div class="control-group"> <label class="control-label" for="nb80x120">Nombre de palette format 80 x 120 *</label> <div class="controls"> <input id="nb80x120" name="nb80x120" placeholder="ex : 2" class="input-mini" required="" type="number" min="0" > <p class="help-block">Parmis vos palettes combiens sont au format 80 x 120 cm ?</p> </div> </div> <div class="control-group"> <label class="control-label" for="surfaceperso"> Si vous avez des pallettes de types spéciaux indiquez nous la surface total de celle-ci </label> <div class="controls"> <input id="surfaceperso" name="surfaceperso" placeholder="ex : 2" class="input-mini" required="" type="number" min="0" value="0" step="0.01" > m² <p class="help-block">Si toute ou partie de vos pallettes ne corespondent pas au 3 cas ci-dessus : indiquez nous la surface (en m²) </p> </div> </div> <div class="control-group"> <label class="control-label" for="EURO">Nombre de palette EURO à l'échange</label> <div class="controls"> <input id="EURO" name="EURO" placeholder="ex : 2" class="input-mini" required="" type="number" min="0" > <p class="help-block">Combien de palette euro compte votre chargement ?</p> </div> </div> <div class="control-group"> <label class="control-label" for="poid"> Poid total de votre chargement </label> <div class="controls"> <input id="poid" name="poid" placeholder="ex : 2" class="input-mini" type="number" required="" min="1" > Kg <p class="help-block">Poid aproximatif de votre chargement en kg</p> </div> </div> <!-- Textarea --> <div class="control-group"> <label class="control-label" for="Type_pal" required="">Informations complémentaires </label> <div class="controls"> <textarea id="Type_pal" name="Type_pal"> </textarea> </div> </div> <div class="control-group"> <label class="control-label" for="GER">Vos palletes sont elles gerbablent ? *</label> <div class="controls"> <input id="GER" name="GER" placeholder="oui / non" class="input-mini" required="" type="text" maxlength="3"> <p class="help-block">Entrer oui ou non en toute lettre</p> </div> </div> <input type="hidden" class="form-control" id="pays_arr" name="pays_arr" value="France" placeholder="ex : France" required/> <!-- Multiple Checkboxes --> <div class="control-group"> <label class="control-label" for="Flex">Flexibilité *</label> <div class="controls"> <input id="Flex" name="Flex" placeholder="oui / non" class="input-mini" required="" type="text" maxlength="3"> <p class="help-block">Etes vous flexible sur la date de prise en charge ? Vous serez prévenue le cas échéant. (Entrer oui ou non en toute lettre)</p> </div> </div> <input type="hidden" class="form-control" id="pays_arr" name="pays_arr" value="France" placeholder="ex : France" required/> <h3>Calculer votre devis ne vous engages d'aucune façon, et aucune facturation ne serra effectuer avant votre validation</h3> <p> <p>Distance à parcourir : <form method="post" action="pageachanger" ><input type="hidden" name="distancehidden" value=""><input type="text" name="distance" disabled class="date" /> km <input value="Calculer la distance" type="button" onclick="$('#envoyerform').attr('disabled', false);showLocation();return verifLength();" onSubmit="return verifLength()" /><input id="envoyerform" type="submit" name="submit" value="Calcul de votre devis" disabled ></form></p> <p id="results"></p> </p> </fieldset> </form> </center> </div> </div> </div> <?php include("Bas-de-page2.php") ?> </div> <!-- /.container --> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- jQuery --> <script src="js/jquery.js"></script> <!-- Script to Activate the Carousel --> </body> </html> |
Ensuite la page de réception du formulaire :
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 | <?php include('Checkfrom.php') ; ?> <!DOCTYPE html> <html lang="fr"> <head> <?php $departementD = substr($cp_dep, 0, 2); $departementA = substr($cp_arr, 0, 2); $l=date('l'); $d=date('d'); $Y=date('Y'); $m=date('m'); $H=date('H'); $timestamp_initial = time(); $date = array('',$l,$d,$Y,$m,$H); ?> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Logistique Alsace / Entreposage</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="css/modern-business.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="Style2.css" rel="stylesheet" type="text/css"> <link href="base.css" rel="stylesheet" type="text/css"> <link href="modele06.css" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body onload="initialize()" style="background-color: rgba(51, 122, 183,0.4);""> <!-- Navigation --> <?php include("Menu.php") ;?> <!-- Header Carousel --> <div class="container"> <!-- Marketing Icons Section --> <!-- /.row --> <div class="row" style="background-color: rgba(51, 122, 183);"> <div class="panel-heading" style="background-color: rgba(51, 122, 183);"> <center><h1 style="color:white;"> Votre devis d'entreposage avec prise en charge </h1> <h2 style="color:white;"> Récapitulatif </h2></center> </div> <?php switch ($departementD) { case 25: case 70: switch ($date['1']) { case 'Monday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } else { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } break; case 'Tuesday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; case 'Wednesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } else { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +6 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +6 days")); } break; case 'Thursday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +5 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +5 days")); break; case 'Friday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); break; case 'Saturday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); break; case 'Sunday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; } break; case 67: switch ($date['1']) { case 'Monday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); } break; case 'Tuesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); } break; case 'Wednesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); } break; case 'Thursday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 day")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); } break; case 'Friday': if ($date['5']<14) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } if ($date['5']>=14) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); } break; case 'Saturday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); break; case 'Sunday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; } break; case 68: switch ($date['1']) { case 'Monday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 day")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 day")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } break; case 'Tuesday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; case 'Wednesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 day")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +5 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +5 days")); } break; case 'Thursday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); break; case 'Friday': { if ($date['5']<14) $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } if ($date['5']>=14) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); } break; case 'Saturday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); break; case 'Sunday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; } break; case 90: switch ($date['1']) { case 'Monday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } break; case 'Tuesday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; case 'Wednesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } if ($date['5']>=12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +6 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +6 days")); } break; case 'Thursday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +5 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +5 days")); break; case 'Friday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); break; case 'Saturday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); break; case 'Sunday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; } break; case 57 : case 54 : case 88 : switch ($date['1']) { case 'Monday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; case 'Tuesday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } else { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); } break; case 'Wednesday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +2 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +2 days")); break; case 'Thursday': if ($date['5']<12) { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +1 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +1 days")); } else { $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +6 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +6 days")); } break; case 'Friday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +5 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +5 days")); break; case 'Saturday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +4 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +4 days")); break; case 'Sunday': $date_enl = date("d-m-Y", strtotime( date('Y-m-d') ."\n"." +3 days")); $Jour_liv = date("l", strtotime( date('l') ."\n"." +3 days")); break; } break; } switch ($departementA) { case 25: case 70: switch ($Jour_liv) { case 'Monday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Tuesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Wednesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Thursday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +5 days")); break; case 'Friday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +4 days")); break; case 'Saturday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +3 days")); break; case 'Sunday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; } break; case 67: switch ($Jour_liv) { case 'Monday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Tuesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Wednesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Thursday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Friday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +3 days")); break; case 'Saturday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Sunday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; } break; case 68: switch ($Jour_liv) { case 'Monday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Tuesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Wednesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Thursday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +4 days")); break; case 'Friday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +3 days")); break; case 'Saturday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Sunday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; } break; case 90: switch ($Jour_liv) { case 'Monday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Tuesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Wednesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Thursday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +5 days")); break; case 'Friday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +4 days")); break; case 'Saturday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +3 days")); break; case 'Sunday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; } case 57 : case 54 : case 88 : switch ($Jour_liv) { case 'Monday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Tuesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Wednesday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +2 days")); break; case 'Thursday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; case 'Friday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +5 days")); break; case 'Saturday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +4 days")); break; case 'Sunday': $date_liv = date("d-m-Y", strtotime( $date_enl ."\n"." +1 days")); break; } break; } ?> <?php include ("mois.php") ?> <div class="container" style="border-width: 5px; border-color: black;"> <div class="col-sm-8 col-sm-offset-2" style="background-color: rgb(255, 255, 255); border-width: 5px; border-color: black;"> <div class="panel panel-default"> <div id="global"> <div id="entete" style="background-color: white;"> <center><img src="images/logo.png"/> <br /> <strong>Logistique Alsace, 50 rue la gare 67118, Geispolsheim, 03.36.35.14.25</strong> <center> </div> <div id="navigation" > <hr> <table> <tr> <td style="padding-left: 30px;padding-right: 30px;"><strong>Mr/M</strong> :</td><td> <em><?php echo $nom; ?></em></td> </tr> <tr> <td style="padding-left: 30px;padding-right: 30px;"><strong>Entreprise</strong> :</td> <td><em><?php echo $entreprise; ?></em></td> </tr> <tr> <td style="padding-left: 30px;padding-right: 30px;"><strong>Téléphone</strong> :</td> <td><em><?php echo $Telephone; ?></em></td> </tr> <tr> <td style="padding-left: 30px;padding-right: 30px;"><strong>Mail</strong> :</td> <td><em><?php echo $email; ?></em></td> </tr> <tr> <td style="padding-left: 30px;padding-right: 30px;"><strong>Date</strong> :</td> <td><em><?php echo date('d-m-Y'); /* $date->format('d-m-Y H:i:s')*/; ?></em></td> </tr> </table></div> <div class="col-sm-8 col-sm-offset-2"> <div style="float:justify;"> <hr> <center> <table> <tr> <td style="padding-left: 30px; padding-left: 30px; padding-right: 30px; border: 1px solid black;"> <strong>Adresse de prise en charge</strong> </td> <td style="padding-left: 30px; padding-left: 30px; padding-right: 30px;"></td> <td style="padding-right: 30px; padding-left: 30px; border: 1px solid black;"> <strong>Adresse du dépot</strong> </td> </tr> <tr> <td style="padding-left: 30px; padding-right: 30px; border: 1px solid black;" > <em><?php echo $AdresseD; ?></em></br> <em><?php echo $cp_dep; ?></em></br> <em><?php echo $ville_dep; ?></em></br> <em><?php echo $pays_dep; ?></em></br> </td> <td style="padding-left: 30px; padding-left: 30px; padding-right: 30px;"></td> <td style="padding-right: 30px; padding-left: 30px; border: 1px solid black;"> <em><?php echo $AdresseA; ?></em></br> <em><?php echo $cp_arr; ?></em></br> <em><?php echo $ville_arr; ?></em></br> <em><?php echo $pays_arr; ?></em></br> </tr></td> </table> </center> </div> <hr> </div> <div style="float:left; width : 50%; padding-left: 30px;"> <br /><br /> <form name="form2" method="post" action="ConfirmationET.php"> <?php include('SQL-ET.php') ?> <?php include('Prepamail.php') ; ?> <input type="hidden" name="type" value="ET" /> <input type="hidden" name="mois" value="<?php echo $mois;?>" /> <center><button type="submit" class="btn btn-primary">Confirmer votre demande</button></center> </div> </div> </form> <div class="col-md-4" style="float:right;"> <div class="panel panel-default"> <div class="panel-heading" style="background-color: white;"> <center> <h4 style="color : #310e00;"><i class="fa fa-fw fa-compass">Montant de la prestation :</i></h4></center> </div> <?php include("fnc-prix.php") ?> <div class="panel-body" style="border:1px solid black;"> <h2 style="color : #310e00;"><center><?php echo $Tarif_final; ?> € HT</center></h2> </div> </div> </div> </div> </div> </div> <?php include("Bas-de-page.php") ?> </div> <!-- /.container --> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- jQuery --> <script src="js/jquery.js"></script> </body> </html> |
Et enfin ma requête SQL :
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 | <?php $NR = 'NR' ; $Date_jour = date("Y-m-d H:i:s"); $rand = mt_rand(); $TOKEN = $rand.$entreprise.$Ville_dep.$Date_jour ; $TOKEN = md5($TOKEN); include('Connexion-mysql.php'); $req = $bdd->prepare('INSERT INTO devis( TOKEN, Raison_social, TVA, Tel, Nom_Prenom, Mail, Nb_pal, Nb_mois, Hm, Pal100100, Pal120120, Pal80120, Surface_sup, Surface_total, EURO, Poids, Info_complementaire, Gerbable, Flexible, Date_debut_stockage, Date_fin_stokage, Date_liv, Date_enl, Ad_dep, Ad_arr, Cp_arr, Cp_dep, Ville_dep, Ville_arr, Pays_dep, Pays_arr, Prix) VALUES (:TOKEN, :Raison_social, :TVA, :Tel, :Nom_Prenom, :Mail, :Nb_pal, :Nb_mois, :Hm, :Pal100100, :Pal120120, :Pal80120, :Surface_sup, :Surface_total, :EURO, :Poids, :Info_complementaire, :Gerbable, :Flexible, :Date_debut_stockage, :Date_fin_stokage, :Ad_dep, :Ad_arr, :Cp_dep, :Cp_arr, :Ville_dep, :Ville_arr, :Pays_dep, :Pays_arr, :Prix'); $req->execute(array( 'TOKEN' => $TOKEN, 'Raison_social' => $entreprise, 'TVA' => $NTVA, 'Tel' => $Telephone, 'Nom_Prenom' => $nom, 'Mail' => $email, 'Nb_pal' => $Nbpaltte, 'Nb_mois' => $mois, 'Hm' => $hm, 'Pal100100' => $nb100x100, 'Pal120120' => $nb120x120, 'Pal80120' => $nb80x120, 'Surface_sup' => $surfaceperso, 'Surface_total'=> $surface, 'EURO' => $EURO, 'Poids' => $poid, 'Info_complementaire' => $Type_pal, 'Gerbable' => $GER, 'Flexible' => $Flex, 'Date_debut_stockage' => $date_enl, 'Date_fin_stokage' => $date2, 'Date_liv'=> $NR, 'Date_enl'=> $NR, 'Ad_dep' => $AdresseD, 'Ad_arr' => $AdresseA, 'Cp_dep' => $cp_dep, 'Cp_arr' => $cp_arr, 'Ville_dep' => $ville_dep, 'Ville_arr' => $ville_arr, 'Pays_dep' => $pays_dep, 'Pays_arr' => $pays_arr, 'Prix' => $Tarif_final, )); ?> |