Files
weval-consulting/api/enrich-tmp.php

35 lines
2.3 KiB
PHP

<?php
header('Content-Type: text/plain');
$k=$_GET['k']??'';
if($k!=='ENRICH2026'){echo 'auth';exit;}
$db=new PDO('pgsql:host=10.1.0.3;dbname=adx_system','admin','admin123');
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$data=[
['ABBES','Samira','abbes.samira@tunet.tn','74228892','Sfax','dermatologue','TN'],
['ABDELKEFI','Neila','abdelkafi.neila@live.fr','74298400','Sfax','dermatologue','TN'],
['AMDOUNI','Hayet','dr.amdounihayet@yahoo.fr','72471291','Menzel Bourguiba','dermatologue','TN'],
['AMMAR','Donia','ammardonia@yahoo.fr','71744627','La Marsa','dermatologue','TN'],
['ATTIA','Aicha','aichattia@gmail.com','73240239','Sousse','dermatologue','TN'],
['BACCOUCHE','Dorra','dorabaccouche@yahoo.fr','71282930','Tunis','dermatologue','TN'],
['MOKHTAR','Insaf','insafmokhtar@yahoo.fr','98439269','La Marsa','dermatologue','TN'],
['MOKNI','Mourad','mourad.mokni@rns.tn','','Tunis','dermatologue','TN'],
['MOULA','Hela','hela_moula@yahoo.fr','22206333','Tunis','dermatologue','TN'],
['MRABET','Nozha','drnoz4@yahoo.fr','99977878','Ben Arous','dermatologue','TN'],
['NOUIRA','Rafiaa','rafiaa.nouira@rns.tn','21402676','Sousse','dermatologue','TN'],
['NOURI','Mourad','mourad.nouri@planet.tn','21412201','Tunis','dermatologue','TN'],
['BOUYAHYAOUI','Youssef','bouyahyaouiyoussef@gmail.com','536700014','Oujda','dermatologue','MA'],
['BELGNAOUI','Fatima','contact@cabinetbelgnaoui.com','537711186','Rabat','dermatologue','MA'],
];
$st=$db->prepare("INSERT INTO ethica.medecins_validated (nom,prenom,email,telephone,ville,specialite,pays,source,google_verified) VALUES (?,?,?,?,?,?,?,'web_enrichment',true)");
$st2=$db->prepare("INSERT INTO ethica.medecins_real (nom,prenom,email,telephone,ville,specialite,pays,source) VALUES (?,?,?,?,?,?,?,'web_enrichment')");
$n=0;
foreach($data as $h){
try{$st->execute($h);$n++;}catch(Exception $e){echo "E1:".$e->getMessage()."\n";}
try{$st2->execute($h);}catch(Exception $e){}
}
echo "Inserted:$n\n";
foreach($db->query("SELECT specialite,pays,count(*) t,count(CASE WHEN email IS NOT NULL AND email!='' THEN 1 END) e FROM ethica.medecins_validated WHERE specialite='dermatologue' GROUP BY specialite,pays ORDER BY pays") as $r)
echo "{$r['specialite']} {$r['pays']}: {$r['e']}/{$r['t']}\n";
echo "TOTAL:".$db->query("SELECT count(*) FROM ethica.medecins_validated")->fetchColumn()."\n";
unlink(__FILE__);