0byt3m1n1
Path:
/
home
/
kassiope
/
www
/
cron
/
[
Home
]
File: import_clients.php
<?php include("../configuration.inc.php"); $file1 = 'customer_2021-09-30_150719.csv'; $file2 = 'address_2021-09-30_150956.csv'; // "id";"Titre";"Prénom";"Nom";"Adresse e-mail";"Société";"Ventes";"Activé";"Lettre d'informations";"Opt-in";"Inscription";"Dernière visite"; /* $fic=fopen($file1, "r"); $i=1 ; while(!feof($fic)) { if($i>1) { $ligne = fgets($fic, 1024); echo "ligne numéro " . $i . " : " . $ligne . ""; $chps = explode(';',str_replace('"','',$ligne)); $sql = "insert ignore into gaia_utilisateurs (code_client, civilite, prenom, nom_famille, email, societe, ventes, etat, newsletter, commercial, date_insert, date_update) values ( '".addslashes($chps[0])."', '".addslashes($chps[1])."', '".addslashes($chps[2])."', '".addslashes($chps[3])."', '".addslashes($chps[4])."', '".addslashes($chps[5])."', '".addslashes($chps[6])."', '".addslashes($chps[7])."', '".addslashes($chps[8])."', '".addslashes($chps[9])."', '".addslashes($chps[10])."', '".addslashes($chps[11])."' )"; mysql_query_override($sql); echo '<br />####################################<br />'; } $i ++; } fclose($fic) ; */ $fic=fopen($file2, "r"); $i=1 ; while(!feof($fic)) { if($i>1) { $ligne = fgets($fic, 1024); echo "ligne numéro " . $i . " : " . $ligne . ""; $chps = explode(';',str_replace('"','',$ligne)); $sql = "insert ignore into gaia_utilisateurs (code_client, civilite, prenom, nom_famille, email, societe, ventes, etat, newsletter, commercial, date_insert, date_update) values ( '".addslashes($chps[0])."', '".addslashes($chps[1])."', '".addslashes($chps[2])."', '".addslashes($chps[3])."', '".addslashes($chps[4])."', '".addslashes($chps[5])."', '".addslashes($chps[6])."', '".addslashes($chps[7])."', '".addslashes($chps[8])."', '".addslashes($chps[9])."', '".addslashes($chps[10])."', '".addslashes($chps[11])."' )"; //mysql_query_override($sql); echo '<br />####################################<br />'; } $i ++; } fclose($fic) ; ?>