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
|
<?php
/*Connexion à la base de données*/
$user="root";
$host="localhost";
$password="";
$database= "gestparq";
try
{
$bdd = new PDO('mysql:host='.$host.';dbname='.$database, $user, $password);
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
/*Définition des variables*/
$id="";
$code="V22J";
$type="BERLINE";
$pole="DAG";
$direction="DAG";
$service="DAG";
$conducteur="MICHEL GOARIN";
$remisage="NON";
$immat_vehicule="MP-254-MG";
$carte="VQ";
$logo="NON";
$marque="PEUGEOT 208 HDI 5 PORTES";
$premiere_circulation="21/10/2014";
$garantie="21/10/2016";
$dernier_passage="21/10/2014";
$kilometrage=25;
$echeance="21/10/2015";
$location="NON";
$observation="";
$interlocuteur="MICHEL GOARIN";
$date_depart_ct="21/10/2014";
$date_control="21/10/2014";
$controle_tech="X";
$date_depart_antipol="";
$date_antipol="";
$antipol="";
$date_depart_lim="";
$date_tachy="";
$controle_tachy="";
$date_depart_lim="";
$date_lim="";
$controle_lim="";
$controle_type="";
$nature_controle="CNT";
$exemption_controle="";
$fichier="peugeot_208_hdi_5_portes.jpg";
$lien="images/parc/peugeot_208_hdi_5_portes.jpg";
/* Insertion des données dans la base */
$req = $bdd->prepare('INSERT INTO `bdd_vehicule`(`ID`,`CODE`,`TYPE`,`POLE`,`DIRECTION`,`SERVICE`,`CONDUCTEUR`,`DOM`,`IMMAT_VEHICULE`,`CARTE_GRISE`,`LOGO`,`MARQUE`,`PREMIERE_CIRCULATION`,`FIN_GARANTIE`,`DERNIER_PASSAGE`,`KILOMETRAGE`,`ECHEANCES_VISITES`,`LOCATION`,`OBSERVATIONS`,`INTERLOCUTEUR`,`DERNIER_CT`,`PROCHAIN_CT`,`CT`,`DERNIER_ANTIPOL`,`PROCHAIN_ANTIPOL`,`ANTIPOL`,`DERNIER_TACHY`,`PROCHAIN_TACHY`,`TACHY`,`DERNIER_LIMITEUR`,`PROCHAIN_LIMITEUR`,`LIM`,`TYPE_CONTROLE`,`NATURE_CONTROLE`,`EXEMPTION_CONTROLE`,`IMAGE`,`LIEN`)
VALUES(:id, :code, :type, :pole, :direction, :service, :conducteur, :dom, :immat, :carte, :logo, :marque, :premiere_circulation, :garantie, :dernier_passage, :kilometrage, :echeances_visites, :location, :observations, :interlocuteur, :dernier_ct, :prochain_ct, :ct, :dernier_antipol, :prochain_antipol, :antipol, :dernier_tachy, :prochain_tachy, :tachy, :dernier_lim, :prochain_lim, :lim, :type_controle, :nature_controle, :exempt_controle, :fichier, :lien)');
$req->execute(array(
'id'=>$id,
'code'=>$code,
'type'=>$type,
'pole'=>$pole,
'direction'=>$direction,
'service'=>$service,
'conducteur'=>$conducteur,
'dom'=>$remisage,
'immat'=>$immat_vehicule,
'carte'=>$carte,
'logo'=>$logo,
'marque'=>$marque,
'premiere_circulation'=>$premiere_circulation,
'garantie'=>$garantie,
'dernier_passage'=>$dernier_passage,
'kilometrage'=>$kilometrage,
'echeances_visites'=>$echeance,
'location'=>$location,
'observations'=>$observation,
'interlocuteur'=>$interlocuteur,
'dernier_ct'=>$date_control,
'prochain_ct'=>$date_control,
'ct'=>$controle_tech,
'dernier_antipol'=>$date_depart_antipol,
'prochain_antipol'=>$date_antipol,
'antipol'=>$antipol,
'dernier_tachy'=>$date_depart_lim,
'prochain_tachy'=>$date_tachy,
'tachy'=>$controle_tachy,
'dernier_lim'=>$date_depart_lim,
'prochain_lim'=>$date_lim,
'lim'=>$controle_lim,
'type_controle'=>$controle_type,
'nature_controle'=>"",
'exempt_controle'=>$exemption_controle,
'fichier' => $fichier,
'lien' => $lien));
/*Fin d'insertion des valeurs*/
echo "C'est ok !!!";
?> |
Partager