mScorePath = $aPath; } // fin du constructeur // ============================================================= // Affiche les partitions function Affiche ($scoreID) { if ($scoreID == "") { // Display the root of the scores. $this->AfficheRoot(); } else { $this->AfficheScore($scoreID); } } // ============================================================= // Affiche la list des partitions function AfficheRoot() { global $sql_bdd; global $table_repertoire; global $page_index, $racine; $pMonCadre = new Cadre($mName, "", ""); $pMonCadre->affiche_CadreHaut(true); /* On se connecte sur la base */ $connect_db = jb_sql_connect(false); $cpt = 0; //$theDirectory = opendir($this->mScorePath); // row 0: id // row 1: numero // row 2: nom // row 3: compo // row 4: style $theDirectory = scandir($this->mScorePath); sort($theDirectory); echo "
\n"; foreach ($theDirectory as $entryName) { if (($entryName != ".") && ($entryName != "..")) { if (($cpt % 3) == 0) echo "\n"; else echo "\n"; $resultat = mysql_db_query($sql_bdd, "select * from $table_repertoire". " where numero=$entryName", $connect_db); $row = mysql_fetch_row($resultat); echo "". "". "\n"; $cpt++; } } MYSQL_CLOSE; echo "
numero Compositeur Nom
$row[1]$row[3]". "$row[2]



\n"; $pMonCadre->affiche_CadreBas(true); } // ============================================================= // Affiche toutes les partitions pour un morceau function AfficheScore($aScoreID) { global $sql_bdd; global $table_repertoire; global $racine; $connect_db = jb_sql_connect(false); $resultat = mysql_db_query($sql_bdd, "select * from $table_repertoire". " where numero=$aScoreID", $connect_db); $row = mysql_fetch_row($resultat); $pMonCadre = new Cadre($row[3]." - ".$row[2], "", ""); $pMonCadre->affiche_CadreHaut(true); $theScorePath = $this->mScorePath . $aScoreID; $theDirectory = opendir($theScorePath); while ($entryName = readdir ($theDirectory)) { if (($entryName != ".") && ($entryName != "..")) { echo $this->GetTitre ($this->GetEntryName ($entryName)); echo "
\n"; $thePartitionDir = opendir($theScorePath . "/" . $entryName); while ($theNum = readdir ($thePartitionDir)) { if (($theNum != ".") && ($theNum != "..")) { $thePageDir = opendir($theScorePath . "/" . $entryName . "/" . $theNum); $theNumString = $theNum; while ($thePage = readdir ($thePageDir)) { if (($thePage != ".") && ($thePage != "..")) { $theName = substr($thePage, 0, strpos($thePage, '.')); echo ""; $theNumString = ""; } } closedir ($thePageDir); } } closedir($thePartitionDir); echo "
$theNumString". "". "$theName

\n"; } } closedir($theDirectory); MYSQL_CLOSE; $pMonCadre->affiche_CadreBas(true); } function GetTitre ($aName) { return "
\n". "\n". "\n". "\n". "
\n". " $aName
\n

\n"; } function GetEntryName ($aName) { if ($aName == "cla") return "Clarinette"; else if ($aName == "flu") return "Flute"; else if ($aName == "trb") return "Trombone"; else if ($aName == "pic") return "Piccolo"; else if ($aName == "per") return "Percussions"; else if ($aName == "htb") return "Hautbois"; else if ($aName == "trp") return "Trompette"; else if ($aName == "dir") return "Direction"; else if ($aName == "sax") return "Sax Alto"; else if ($aName == "sat") return "Sax Ténor"; else if ($aName == "sab") return "Sax Baryton"; else if ($aName == "cor") return "Cor"; else if ($aName == "eup") return "Euphonium"; else if ($aName == "bas") return "Basson"; else if ($aName == "cba") return "Contrebasse"; else if ($aName == "crn") return "Cornet"; else if ($aName == "coa") return "Cor Anglais"; else if ($aName == "clb") return "Clarinette Basse"; else if ($aName == "har") return "Harpe"; else if ($aName == "pia") return "Piano"; else if ($aName == "tub") return "Tuba"; else if ($aName == "sup") return "Parties supplementaires"; else if ($aName == "par") return "Parties"; else return $aName; } }; ?>