[insert_php]

require (“Gestion_LOHAD_2.php”);

$id_album = $_GET[‘id_album’];
$id_chanson = $_GET[‘id_chanson’];

// On créé la requête
$id_album = $conn->real_escape_string($_GET[‘id_album’]);
$id_chanson = $conn->real_escape_string($_GET[‘id_chanson’]);
//echo “$id_album
“;
//echo “$id_chanson
“;

$result= (“SELECT * FROM tb_chanson,tb_interprete WHERE id_chanson = ‘$id_chanson’ AND tb_chanson.id_interprete = tb_interprete.id_interprete “) ;

$res = $conn->query($result);

$data1 = mysqli_fetch_assoc($res);

$titre = $data1[‘titre’];
$paroles = $data1[‘paroles’];
$paroles_trad = $data1[‘paroles_trad’];
$lien_remarq = $data1[‘lien_remarq’];
$autcomp = $data1[‘autcomp’];
$traducteurs = $data1[‘traducteurs’];
$interprete = $data1[‘interprete’];

if (empty($id_album))
{
$id_album = $data1[‘id_album’];
}

$result2= (“SELECT * FROM tb_album WHERE id_album = ‘$id_album’ “) ;

$res2 = $conn->query($result2);

$data2 = mysqli_fetch_assoc($res2);

$album = $data2[‘album’];
$moy_image = $data2[‘moy_image’];
$pochette = ““;
$date_paru = $data2[‘date_paru’];
$j1=substr($date_paru, 8, 2);
$m1=substr($date_paru, 5, 2);
$a1=substr($date_paru, 0, 4);
$date_paru =$j1.’/’.$m1.’/’.$a1;

//echo “$titre

“;

echo “

“;

echo ”

“;
echo “$pochette”;
echo ”

“;

echo ”

“;
echo “

$album – $date_paru

“;
echo “

$titre

“;
echo “

$autcomp

“;
echo ”

“;

echo ”

“;

echo “


“;

[/insert_php]

[insert_php]echo $paroles;[/insert_php]
[insert_php]echo $paroles_trad;[/insert_php]

[insert_php]

//echo “$paroles
“;
//echo “


“;
//echo “$paroles_trad

“;
echo “Traduction : $traducteurs
“;
echo “


“;

echo “$lien_remarq


“;

//nb interprétation
$rep_neb = (“SELECT id_chanson FROM tb_unite WHERE id_chanson = $id_chanson “);
$res_rep_neb = $conn->query($rep_neb);
$nb_int = mysqli_num_rows($res_rep_neb);

//prem inter
$rep_date_min = (“SELECT MIN(tb_concert.date) AS prem_date FROM tb_concert, tb_unite WHERE tb_concert.id_concert = tb_unite.id_concert AND tb_unite.id_chanson= $id_chanson”);
$res_rep_date_min = $conn->query($rep_date_min);
$date_min = mysqli_fetch_array($res_rep_date_min);
$datemin = $date_min[‘prem_date’] ;
$j1=substr($datemin, 8, 2);
$m1=substr($datemin, 5, 2);
$a1=substr($datemin, 0, 4);
$datemin =$j1.’/’.$m1.’/’.$a1;

//der inter
$rep_date_max = (“SELECT MAX(tb_concert.date) AS der_date FROM tb_concert, tb_unite WHERE tb_concert.id_concert = tb_unite.id_concert AND tb_unite.id_chanson= $id_chanson”);
$res_rep_date_max = $conn->query($rep_date_max);
$date_max = mysqli_fetch_array($res_rep_date_max);
$datemax = $date_max[‘der_date’] ;
$j1=substr($datemax, 8, 2);
$m1=substr($datemax, 5, 2);
$a1=substr($datemax, 0, 4);
$datemax =$j1.’/’.$m1.’/’.$a1;

echo “Nombre d’interprétations live : $nb_int
“;
echo “Première interprétation : $datemin
“;
echo “Dernière interprétation : $datemax
“;
echo “


“;
echo “Statistiques par tournées
“;

//requête tournée
$req_tour = (“SELECT * FROM tb_tournee WHERE id_tournee > 1 ORDER BY date_deb ASC” );
$res_req_tour = $conn->query($req_tour);
$i=0;
while ($rep_tour = mysqli_fetch_array($res_req_tour))
{
$id_tour = $rep_tour[‘id_tournee’];
$tournee = $rep_tour[‘tournee’];

$days[$i]=$rep_tour[‘tournee’];

//requete nb d’interprétation par tour
$req_song = (“SELECT COUNT(tb_unite.id_chanson) AS nb_chant
FROM tb_concert, tb_leg, tb_unite
WHERE tb_concert.id_leg = tb_leg.id_leg AND tb_leg.id_tournee = $id_tour
AND tb_concert.id_concert = tb_unite.id_concert AND tb_unite.id_chanson = $id_chanson”);
$res_req_song = $conn->query($req_song);
$song = mysqli_fetch_array($res_req_song);

$nb_chant=$song[‘nb_chant’];

$data.= “[‘”.$tournee.”‘, “.$nb_chant.”],”; // J’ai choisi d’afficher la valeur directement dans la légende en écrivant ‘”.$username.” : “.$nb_posts.”‘

$longueur = $nb_chant*2.5;

echo “

“;
echo “

“;
echo “

“;
if ($nb_chant==0)
{
echo “

“;
}
else
{
echo “

“;
}

echo “

“;
echo “

$tournee   $nb_chant

“;

$i=$i+1;

}

mysqli_close($conn);
[/insert_php]