File "generateur_client.php"

Full Path: /home/analogde/www/DOSSIER/SFR/Massage_10_12_2016/generateur_client.php
File size: 9.53 KB
MIME-type: text/x-php
Charset: utf-8

<?php

/*
CREATE TABLE IF NOT EXISTS client (
  id int(11) NOT NULL AUTO_INCREMENT,
  nom varchar(30) NOT NULL,
  prenom varchar(30) NOT NULL,
  email varchar(30) NOT NULL,
  password varchar(30) NOT NULL,
  init_pass varchar(5) NOT NULL DEFAULT 1,
  PRIMARY KEY (id)
)
*/

	include('database.php');	
	DB_connexion(); 
	
	header( 'content-type: text/html; charset=utf-8' );
	$tab_utilisateur = array();
	$tab_email = array();
	
	$tab_utilisateur[] = "AIGOUY Pascal";  
	$tab_email[] = "Pascal.Aigouy@onsemi.com";  
	
	$tab_utilisateur[] = "AILLAS Patrick"; 
	$tab_email[] = "Patrick.Aillas@onsemi.com"; 
	
	$tab_utilisateur[] = "APCHER Alexandre";
	$tab_email[] = "Alexandre.Apcher@onsemi.com";
	
	$tab_utilisateur[] = "ATHANASSIADIS Julie";
	$tab_email[] = "julie.athanassiadis@onsemi.com";
			
	$tab_utilisateur[] = "ANDRE Philippe";	
	$tab_email[] = "Philippe.Andre@onsemi.com";	
		
	$tab_utilisateur[] = "BAQUIE Sophie";	
	$tab_email[] = "Sophie.Baquie@onsemi.com";	
	
	$tab_utilisateur[] = "BARBONI Marc";
	$tab_email[] = "Marc.Barboni@onsemi.com";
	
	$tab_utilisateur[] = "BASSO Christophe"; 
	$tab_email[] = "Christophe.Basso@onsemi.com"; 
	
	//$tab_utilisateur[] = "BERNAD Ignacio";
	//$tab_email[] = "BERNAD Ignacio";
	
	$tab_utilisateur[] = "BESOMBES Didier"; 	
	$tab_email[] = "Didier.Besombes@onsemi.com"; 
	
	$tab_utilisateur[] = "BORDES Laurent";
	$tab_email[] = "Laurent.Bordes@onsemi.com";
		
	$tab_utilisateur[] = "BORDIGNON Thierry";
	$tab_email[] = "Thierry.Bordignon@onsemi.com";
	
	$tab_utilisateur[] = "BRAS Sébastien";	
	$tab_email[] = "Sebastien.Bras@onsemi.com";	
		
	$tab_utilisateur[] = "BRUANDET Stéphane";
	$tab_email[] = "Stephane.Bruandet@onsemi.com";
	
	$tab_utilisateur[] = "BRUVIER Damien";
	$tab_email[] = "Damien.bruvier@onsemi.com";
	
	$tab_utilisateur[] = "CAMBOUNET Stéphanie";
	$tab_email[] = "Stephanie.Cambounet@onsemi.com";
	
	$tab_utilisateur[] = "CANNENTERRE-CONSEIL Stéphanie";
	$tab_email[] = "Stephanie.Cannenterre@onsemi.com";
	
	$tab_utilisateur[] = "CAPILLA José";
	$tab_email[] = "Jose.Capilla@onsemi.com";
		
	$tab_utilisateur[] = "CAUSSE Olivier";  
	$tab_email[] = "Olivier.Causse@onsemi.com";  
	
	$tab_utilisateur[] = "CHAOUI Hassan";
	$tab_email[] = "Hassan.Chaoui@onsemi.com";
	
	$tab_utilisateur[] = "CHEVALLIER Christophe";
	$tab_email[] = "Christophe.Chevallier@onsemi.com";
	
	$tab_utilisateur[] = "CLARYSSE Bernard";  
	$tab_email[] = "Bernard.Clarysse@onsemi.com";  
	
	$tab_utilisateur[] = "CLEMENS Julien";
	$tab_email[] = "Julien.Clemens@onsemi.com";
	
	$tab_utilisateur[] = "CLEMENS William";	
	$tab_email[] = "William.Clemens@onsemi.com";	
	
	$tab_utilisateur[] = "CLOU Bertrand";	
	$tab_email[] = "Bertrand.Clou@onsemi.com";	
	
	$tab_utilisateur[] = "COLOMINES Stéphane";	
	$tab_email[] = "Stephane.Colomines@onsemi.com";	
	
	$tab_utilisateur[] = "COMBES Myriam";
	$tab_email[] = "Myriam.Combes@onsemi.com";
	
	$tab_utilisateur[] = "CUNNAC Loïc";
	$tab_email[] = "Loic.Cunnac@onsemi.com";
	
	$tab_utilisateur[] = "DACOSTA Franck";
	$tab_email[] = "Franck.DaCosta@onsemi.com";
		
	$tab_utilisateur[] = "DEBOSQUE Philippe";
	$tab_email[] = "Philippe.Debosque@onsemi.com";
	
	$tab_utilisateur[] = "DELPY Patrice";	
	$tab_email[] = "Patrice.Delpy@onsemi.com";	
	
	$tab_utilisateur[] = "DE_SAINT_VICTOR Marion";	
	$tab_email[] = "Marion.DeSaintVictor@onsemi.com";	
			
	$tab_utilisateur[] = "DOS_SANTOS Marc";
	$tab_email[] = "Marc.dos-santos@onsemi.com";
	
	$tab_utilisateur[] = "DUCHEMANN Virginie";
	$tab_email[] = "Virginie.Duchemann@onsemi.com";
	
	$tab_utilisateur[] = "FERNANDES Henrique";	
	$tab_email[] = "Henrique.Fernandes@onsemi.com";	
	
	$tab_utilisateur[] = "FOULON Fabien";
	$tab_email[] = "Fabien.Foulon@onsemi.com";
	
	$tab_utilisateur[] = "GAUDRON Yann";	
	$tab_email[] = "Yann.Gaudron@onsemi.com";	
	
	$tab_utilisateur[] = "GENEST Pierre";   
	$tab_email[] = "Pierre.Genest@onsemi.com";   
	 
	$tab_utilisateur[] = "GERBER Remi"; 
	$tab_email[] = "Remi.Gerber@onsemi.com"; 
	      
 	$tab_utilisateur[] = "GONDON Mathieu";
	$tab_email[] = "Mathieu.Gondon@onsemi.com";
	
	$tab_utilisateur[] = "GOYON Catherine";  
	$tab_email[] = "Catherine.Goyon@onsemi.com";  
	
	$tab_utilisateur[] = "GRISSAULT Michael";
	$tab_email[] = "Mickael.Grissault@onsemi.com";
	
	$tab_utilisateur[] = "HARMALI Jean-Louis";
	$tab_email[] = "Jean-Louis.Harmali@onsemi.com";
	
	$tab_utilisateur[] = "JANEZ Nathalie";
	$tab_email[] = "Nathalie.Janez@onsemi.com";
	
	$tab_utilisateur[] = "KBAIER Anissa";
	$tab_email[] = "Anissa.Karray-Kbaier@onsemi.com";
	
	$tab_utilisateur[] = "LAVERNHE Jacques";	
	$tab_email[] = "Jacques.Lavernhe@onsemi.com";	
	
	$tab_utilisateur[] = "LAVIE Serge";
	$tab_email[] = "Serge.Lavie@onsemi.com";
	
	$tab_utilisateur[] = "LE_MEN Bérangère";
	$tab_email[] = "Berengere.LeMen@onsemi.com";
	
	$tab_utilisateur[] = "LOUVEL Jean Paul";
	$tab_email[] = "Jean-Paul.Louvel@onsemi.com";
	
	$tab_utilisateur[] = "LYBLIAMAY Maxime";
	$tab_email[] = "Maxime.Lybliamay@onsemi.com";
	
	$tab_utilisateur[] = "MALOU Amokrane";
	$tab_email[] = "Amokrane.Malou@onsemi.com";
	
	$tab_utilisateur[] = "MARCOS Emile";	
	$tab_email[] = "Emile.Marcos@onsemi.com";	
	
	$tab_utilisateur[] = "MATALON Jonathan"; 
	$tab_email[] = "Jonathan.Matalon@onsemi.com"; 
	
	$tab_utilisateur[] = "MARTIN J-Baptiste"; 
	$tab_email[] = "Jean-B.Martin@onsemi.com"; 
	
 	$tab_utilisateur[] = "MARTINEZ Olivier"; 
	$tab_email[] = "Olivier.Martinez@onsemi.com"; 
	
   	$tab_utilisateur[] = "MIGLIAVACCA Paolo";
	$tab_email[] = "Paolo.Migliavacca@onsemi.com";
	
	$tab_utilisateur[] = "ORGE Laurence";	
	$tab_email[] = "Laurence.Orge@onsemi.com";	
	
	$tab_utilisateur[] = "OUDOL Magali"; 
	$tab_email[] = "Magali.Oudol@onsemi.com"; 
	     
	$tab_utilisateur[] = "PALAO Rosalia";  
	$tab_email[] = "Rosalia.Palao@onsemi.com";  
	   
	$tab_utilisateur[] = "PENENT Sophie";	
	$tab_email[] = "Sophie.Penent@onsemi.com";	
	
	//$tab_utilisateur[] = "PRADILLE Michel";   
	//$tab_email[] = "PRADILLE Michel";   
	
	$tab_utilisateur[] = "RAMOND Stéphane";	
	$tab_email[] = "Stephane.Ramond@onsemi.com";	
	
	$tab_utilisateur[] = "REMAURY Bernard";
	$tab_email[] = "Bernard.Remaury@onsemi.com";
	
	$tab_utilisateur[] = "RIBAS Didier";    
	$tab_email[] = "Didier.Ribas@onsemi.com";    
	 
	$tab_utilisateur[] = "ROMEO Dominique";	
	$tab_email[] = "Dominique.Romeo@onsemi.com";	
	
	$tab_utilisateur[] = "ROUSSET Patrick";	
	$tab_email[] = "Patrick.Rousset@onsemi.com";	
	
	$tab_utilisateur[] = "RYAT Marc";
	$tab_email[] = "Marc.Ryat@onsemi.com";
	
	$tab_utilisateur[] = "SAINT-UPERY Geraldine";
	$tab_email[] = "Geraldine.SaintUpery@onsemi.com";
	
	$tab_utilisateur[] = "SALLES Richard";    
	$tab_email[] = "Richard.Salles@onsemi.com";    
	
	$tab_utilisateur[] = "SAMUDIO Jean-Louis";
	$tab_email[] = "Jean-Louis.Samudio@onsemi.com";
	
	$tab_utilisateur[] = "SAPHON Remy";	
	$tab_email[] = "Remy.Saphon@onsemi.com";	
	
	$tab_utilisateur[] = "SEVETIAN Pascal";	
	$tab_email[] = "Pascal.Sevetian@onsemi.com";	
	
	$tab_utilisateur[] = "SUTTO Thierry";
	$tab_email[] = "Thierry.Sutto@onsemi.com";
	
	$tab_utilisateur[] = "TEIL Vincent";	
	$tab_email[] = "Vincent.Teil@onsemi.com";	
	
	$tab_utilisateur[] = "TOURNIER Pascal";
	$tab_email[] = "Pascal.Tournier@onsemi.com";
	
	$tab_utilisateur[] = "TURCHI Joel";       
	$tab_email[] = "j.turchi@onsemi.com";       
	 
	$tab_utilisateur[] = "VANNIER Olivier";  
	$tab_email[] = "Olivier.Vannier@onsemi.com";  
	   
	$tab_utilisateur[] = "VAQUETTE Yann";	
	$tab_email[] = "Yann.Vaquette@onsemi.com";	
	
	$tab_utilisateur[] = "VERGES_COPIN Aude";
	$tab_email[] = "Aude.Verges-Copin@onsemi.com";
	
	$tab_utilisateur[] = "VIARD Thierry";   
	$tab_email[] = "Thierry.Viard@onsemi.com";   
	 
	$tab_utilisateur[] = "VOLTO Franck";    
	$tab_email[] = "Franck.Volto@onsemi.com";    
	  
	$tab_utilisateur[] = "VOORWINDEN Cor";
	$tab_email[] = "Cor.Voorwinden@onsemi.com";
	
	$tab_utilisateur[] = "WEISS Aurore";
	$tab_email[] = "Aurore.Weiss@onsemi.com";
	
	$tab_utilisateur[] = "admin";  
	$tab_email[] = "none";  
	
	
/*function generer_mot_de_passe()
{
        $mot_de_passe = "";
       
        $chaine = "abcdefghjkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ023456789";
        $longeur_chaine = strlen($chaine);
		
		$nb_caractere = 6;
       
        for($i = 1; $i <= $nb_caractere; $i++)
        {
            $place_aleatoire = mt_rand(0,($longeur_chaine-1));
            $mot_de_passe .= $chaine[$place_aleatoire];
        }

        return $mot_de_passe;   
}
*/	
	
	mysqli_query($connexion, "SET NAMES 'utf8'");		
	
	//$sql="SELECT * FROM planning WHERE calendrier = '".$q."'";
	for( $i=0; $i < count($tab_utilisateur) ; $i++)		
	{			$pieces = explode(" ", $tab_utilisateur[$i]);
				$email = $tab_email[$i]; 
				//$mdp = generer_mot_de_passe();
				$mdp = "1234";
				$val = "1";
				$sql = "INSERT INTO client (id, nom, prenom,email,password,init_pass) 
						VALUES('', '$pieces[0]', '$pieces[1]', '$email' ,'$mdp','$val')"; 		
				
				echo $sql .'<br>'; 		
				$result = mysqli_query($connexion, $sql);	
				
				if(!$result)
				{
					die('Impossible d\'exécuter la requête :' . mysql_error());
				}
				
	}	
	
	//email_reservation($email_bailleur, $email_locataire, $nom, $prenom, $debut, $depart, $tel, $email, $nb_personne, $message_locataire);

	
	//print "<pre>";	
	//print_r($tab);		

		echo "done";
		
		
/*		CREATE TABLE IF NOT EXISTS gestion (
  id int(11) NOT NULL AUTO_INCREMENT,
  annee varchar(30) NOT NULL,
  mois varchar(30) NOT NULL,
  jour varchar(30) NOT NULL,
  client varchar(30) NOT NULL,
  mode varchar(30) NOT NULL,
  seance varchar(30) NOT NULL,
  compteur varchar(30) NOT NULL,
  montant varchar(30) NOT NULL,
  statut varchar(30) NOT NULL,
  cheque varchar(30) NOT NULL,
  banque varchar(30) NOT NULL,
  PRIMARY KEY (id)
)*/
?>