Corsi ECM

[insert_php]
define( “DB_HOST”, “editreeit.mydb-aruba.it” );
define( “DB_NAME”, “Swp1646987-prod” );
define( “DB_USR”, “Swp1646987” );
define( “DB_PWD”, “4787jd1068” );

define( “PREFIX”, “A_EDTR_ECM” );
function openDbConn(){
$dbh = new PDO( “mysql:host=” . DB_HOST . “;dbname=” . DB_NAME, DB_USR, DB_PWD );
$dbh->exec( “set names utf8” );

//echo “nPDO::errorInfo():n”;
//print_r($dbh->errorInfo());
return $dbh;
}
$dbh=openDbConn();
$sql = “SELECT * FROM `”.PREFIX.”_Corsi` WHERE `CRS_data_fine` > NOW() ORDER BY `CRS_data_inizio`”;
$stmt=$dbh->prepare($sql);
$stmt->execute();
$corsi = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo ‘

‘;

$j=0;
foreach($corsi as $k => $c){
$j++;
if ($c[‘CRS_tipo’] == 0) {
$pdflink = “https://www.editree.it/corsi-ecm/”.$c[‘CRS_nickname’].”/pdf/”.$c[‘CRS_ed’];
} else {
$pdflink = “https://www.editree.it/corsi-ecm/pdf/”.$c[‘CRS_pdf’];
}
echo ‘

Corso Residenziale ECM

‘.$c[‘CRS_titolo’].’

‘.$c[‘CRS_data’].’ – ‘.$c[‘CRS_sede’].’

Accreditato ECM – Codice Evento: ‘.$c[‘CRS_ecm’].’
Rivolto a: ‘.$c[‘CRS_prof-disc-text’].’
‘;
if ($c[‘CRS_responsabili’] != “”) {
echo ‘
Responsabili scientifici: ‘.$c[‘CRS_responsabili’].’
‘;
}
echo ‘
Relatori: ‘.$c[‘CRS_relatori’].’

‘;
if ($c[‘CRS_tipo’] == 0) {
echo ‘

‘;
}
if ($c[‘CRS_tipo’] == 1 && $c[‘CRS_linkext’] != “”) {
echo ‘

‘;
}
echo ‘

‘;

}

[/insert_php]