query($sql1) or die('Erreur SQL !
'.$sql1.'
'.$mysqli->error); while($c = $req1->fetch_assoc()) { $chants[''][] = array($c['id'],1,1); } } else { $sql1 = 'SELECT * FROM '.$db['chant_sources'].' WHERE `source` = "'.$s.'" ORDER BY sequence ASC'; $req1 = $mysqli->query($sql1) or die('Erreur SQL !
'.$sql1.'
'.$mysqli->error); while($c = $req1->fetch_assoc()) { $chants[$c['page']][] = array($c['chant_id'],$c['sequence'],$c['extent']); } } $title = 'Sources - '.$sources[$s]['title']; include('include/header.php'); echo "

$title

\n"; echo "\n"; if(is_array($sources[$s]['pages'])) { foreach($sources[$s]['pages'] as $p) { if(array_key_exists($p,$chants)) { echo "\n"; } } } uksort($chants, 'strnatcmp'); foreach($chants as $p => $ch) { echo "\n"; } echo "
PageIncipit
$p"; echo "
    \n"; $ch = $chants[$p]; unset($chants[$p]); foreach($ch as $c) { $t = chant_from_id($c[0]); echo '
  • '; if($t[2]) { echo ''.format_incipit($t[1]).""; } else { echo ''.format_incipit($t[1]).''; } echo "
  • \n"; } echo "
\n"; echo "
$p
    "; $l = array(); foreach($ch as $c) { $t = chant_from_id($c[0]); $l[] = $t[1]."=-=".$t[0]."=-=".$c[0]."=-=".$c[1]."=-=".$c[2]; } natcasesort($l); foreach($l as $ll) { $ll = explode('=-=',$ll); echo '
  • '.$ll[0]."
  • \n"; } echo "
\n"; include('include/footer.php'); ?>