public function __construct($immatricule, $nom, $prenom, $zone) { $this->con = Connexion::connect(); $this->immatricule = $immatricule; $this->nom = $nom; $this->prenom = $prenom; $this->zone = $zone; }
public function __construct($codeITP, $nom, $prenom, $adresse, $numTel, $jourLivraison, $promoteur, $teleOperateur, $teamLeader, $canalDeLivraison, $nomTitulaire, $gerant, $delaiPaiement, $typeDeContrat, $dateFinContrat, $potentielDeCommunication, $zoneGeographique, $planogramme) { $this->connexion = Connexion::connect(); $this->codeITP = $codeITP; $this->nom = $nom; $this->prenom = $prenom; $this->adresse = $adresse; $this->numTel = $numTel; $this->jourLivraison = $jourLivraison; $this->promoteur = $promoteur; $this->teleOperateur = $teleOperateur; $this->teamLeader = $teamLeader; $this->canalDeLivraison = $canalDeLivraison; // $this->nomTitulaire = $nomTitulaire; // $this->gerant = $gerant; // $this->delaiPaiement = $delaiPaiement; $this->typeDeContrat = $typeDeContrat; $this->dateFinContrat = $dateFinContrat; $this->potentielDeCommunication = $potentielDeCommunication; // $this->zoneGeographique = $zoneGeographique; $this->planogramme = $planogramme; // /*try { $connexion = new PDO('mysql:host=localhost;dbname=SMT;charset=utf8', "root", "khalil007"); } catch (PDOException $e) { print "Erreur !: " . $e->getMessage() . "<br/>"; die(); } $script = "INSERT INTO `SMT`.`Client` (`id`, `nom`, `prenom`, `adresse`, `telephone`, `jourLivraison`, `promoteur`, `teleOperateur`, `teamLeader`, `canalDeLivraison`, `nomTitulaire`, `gerant`, `delaiDePaiment`, `typeContrat`, `dateFinContrat`, `poDeCommunication`, `zoneGeo`, `planogramme`) VALUES ($i, $nom, $prenom, $adresse, $telephone, $j, $promoteur, $teleOperateur, $teamLeader, $canalDeLivraison,$nomTitulaire, $gerant, $delai, $typeDeContrat, CURRENT_TIMESTAMP , $potentielDeCommunication, $zoneGeographique, $planogramme);"; $sql = "INSERT INTO `SMT`.`Client` (`id`, `nom`, `prenom`, `adresse`, `telephone`, `jourLivraison`, `promoteur`, `teleOperateur`, `teamLeader`, `canalDeLivraison`, `nomTitulaire`, `gerant`, `delaiDePaiment`, `typeContrat`, `dateFinContrat`, `poDeCommunication`, `zoneGeo`, `planogramme`) VALUES ($codeITP, $nom, $prenom, $adresse, 2345432, $jourLivraison, $promoteur, $teleOperateur, $teamLeader, $canalDeLivraison,$nomTitulaire, $gerant, $delaiPaiement, $typeDeContrat, CURRENT_TIMESTAMP , $potentielDeCommunication, $zoneGeographique, $planogramme)"; // Script SQL d'ajout de client $connexion->exec($sql);*/ /* Ajouter après une requete sql qui crée le client dans la base de donnée. */ }
<?php include '../../jcart/JCart.php'; session_start(); include 'menu.php'; include '../../../Models/Connection.php'; $connexion = Connexion::connect(); if (isset($_POST['codeITP'])) { $idClient = $_POST['codeITP']; $sql = "SELECT * FROM Client WHERE idClient LIKE '%{$idClient}%'"; $reponse2 = $connexion->query($sql); // Affiche le nombre de ligne dans cette requete echo $reponse2->rowCount(); ?> <div class="col-sm-8 col-sm-offset-2 well "> <?php if ($reponse2->rowCount() != 0) { while ($row = $reponse2->fetch()) { ?> <div class="well col-sm-4" style="background-color: white;width:240px;margin-left:17px"> <form method="post" action="info_client.php" class="jcart" id="formClient"> <strong> <p class="text-info text-center"> <?php echo utf8_encode($row['nom']); ?> <?php echo utf8_encode($row['prenom']); ?> </p>
<?php /** * Chargement du site * * Ce fichier a pour objectif d'appeler les fichiers de conf et l'autoload, et d'appeller le frontControlleur */ try { ini_set('display_errors', 1); require_once 'config/Config.php'; require_once 'config/Autoload.php'; Autoload::charger(); Connexion::connect($dsn, $user, $pswd); FrontControleur::init(); } catch (PDOException $ex) { $vueErreur = $ex->getMessage(); require 'vue/includes/erreur.php'; } catch (Exception $e) { $vueErreur = $ex->getMessage(); require 'vue/includes/erreur.php'; }