ÁreaEnsayo $ObrEns_version por Rodax Software S.L"; return; } # Dibujar Cabecera function RefHeader($Itemid) { global $database; echo "
"; $database->setQuery("SELECT name from #__menu WHERE id='$Itemid'"); $menuname = $database->loadResult(); echo "$menuname"; echo "
"; return; } # Ver categorias function ShowCats($Itemid, $artref_showpicture) { global $database; echo ""; $query1="SELECT * FROM #__categories WHERE section = 'com_obrens' AND published = '1' ORDER BY ordering ASC"; $database->setQuery($query1); $rows = $database->loadObjectList(); $line=1; foreach($rows as $row1) { $linecolor = ($line % 2) + 1; echo ""; echo ""; $line++; } echo "
"; //Si tiene imagen asociada la categoria la pintamos if (($artref_showpicture=="1") && ($row1->image <> "")) { echo "id> "; } echo " id>$row1->title
$row1->description

"; //Dibujamos las entradas de las que consta $database->setQuery("SELECT count(id) FROM #__obrens WHERE published = '1' AND catid = '".$row1->id."'"); $count = $database->loadResult(); echo "id>$row1->titulo"; if($count!=1) { echo "($count ".LIT_ENTRADAS.")"; }else{ echo "($count ".LIT_ENTRADA.")"; } echo "

"; return; } # Ver obras por categoria function ShowList($obrens_vercabecera, $artref_showbeschrlink, $obrens_ordenlista) { global $database, $Itemid; echo ""; $cadena = "SELECT c.*, COUNT(DISTINCT s1.id) AS num" . "\nFROM #__categories AS c" . "\nLEFT JOIN #__obrens AS s1 ON s1.catid = c.id" . "\nWHERE c.section='com_obrens' AND c.published='1'" . "\nGROUP BY c.id" . "\nORDER BY c.ordering, c.title"; $database->setQuery($cadena); $rows = $database->loadObjectList(); $columnspan = 3; foreach($rows as $row1) { if ($row1->num > 0) { echo ""; echo ""; //Consultamos las obras de la categoria ordenadas por titulo $cadena = "SELECT * FROM #__obrens WHERE published='1' AND catid='$row1->id' ORDER BY ordering"; /*switch ($obrens_ordenlista) { case '1': $cadena .= "titulo"; break; case '2': $cadena .= "autor"; break; case '3': $cadena .= "id"; break; } */ $database->setQuery($cadena); $srows = $database->loadObjectList(); $line=1; foreach($srows as $srow1) { $linecolor = ($line % 2) + 1; # Listen aussehen echo ""; echo ""; echo ""; echo ""; echo ""; $line++; } } } echo "
"; echo "$row1->title
"; echo "$row1->description
$srow1->titulo$srow1->autor"; echo "

"; return; } # Devuelve un array dimensional que representa la tabla de voces function darDetallesObra($refid, $ncolfil) { global $database; global $rutalocal; global $obrens_rutafich; global $obrens_nomfich; global $obrens_extmid; $contador = 0; //Inicializamos array $arrTabla = array(); for ($j = 0; $j < $ncolfil + 1; $j++) { for ($i = 0; $i < $ncolfil + 1; $i++) { $arrTabla[$j][$i] = ""; $arrTabla[$i][$j] = ""; } } //Rellenamos cabeceras del array $database->setQuery( "SELECT * FROM #__obrens_cab_detalles WHERE idobra='$refid' order by id"); $rows1 = $database->loadObjectList(); //Obra mid $cadena = $obrens_rutafich . $refid . $obrens_nomfich . $refid . $obrens_extmid; if (file_exists($rutalocal . $cadena)) $arrTabla[0][0] = "" . LIT_OBRA . $obrens_extmid . ""; //Elmentos de la tabla foreach($rows1 as $rows1Aux) { $arrTabla[0][$rows1Aux->id + 1] = $rows1Aux->descripcion; $arrTabla[$rows1Aux->id + 1][0] = $rows1Aux->descripcion; } //Rellenamos contenido del array for ($j = 1; $j < $ncolfil + 1; $j++) { for ($i = 1; $i < $ncolfil + 1; $i++) { $cadena = $obrens_rutafich . $refid . $obrens_nomfich . $refid.$j.$i . $obrens_extmid; if (file_exists($rutalocal . $cadena)) { $contador++; $arrTabla[$j][$i] = "
"; $arrTabla[$i][$j] = "
"; } } } $arrTablaSal[0] = $contador; $arrTablaSal[1] = $arrTabla; return $arrTablaSal; } # Ver ensayo de obra function ShowObra($refid, $Itemid) { global $database; global $rutalocal; global $obrens_rutafich; global $obrens_nomfich; global $obrens_extpdf; global $obrens_extmid; global $obrens_extmus; //echo "
"; //CABECERA $database->setQuery( "SELECT * FROM #__obrens WHERE id='$refid'"); $rows = $database->loadObjectList(); foreach($rows as $row1) { echo ""; echo ''; echo '
'.$row1->titulo.'

'; echo ""; //Titulo echo ""; echo ""; //Autor echo ""; echo ""; echo ""; echo ""; } $cadena = ''; echo ""; echo "'; echo "'; echo "'; } echo ""; echo ('
".LIT_TITULO.":$row1->titulo
".LIT_AUTOR.":$row1->autor

Partitura:

"; //Partitura pdf $cadena = $obrens_rutafich . $refid . $obrens_nomfich . $refid . $obrens_extpdf; if (file_exists($rutalocal . $cadena)) { echo ""; echo " "; echo LIT_PARTITURA.$obrens_extpdf; echo '  (en formato PDF)'; echo '
"; } //Partitura mus $cadena = ''; $cadena = $obrens_rutafich . $refid . $obrens_nomfich . $refid . $obrens_extmus; if (file_exists($rutalocal . $cadena)) { echo ""; echo " "; echo LIT_PARTITURA.'.mus'; echo '  (en formato MUS)'; echo '
"; } // Partitura mid $cadena = ''; //Hallamos el numero de columnas que vamos a tener $database->setQuery( "SELECT count(id) as ncol FROM #__obrens_cab_detalles WHERE idobra='$refid'"); $row = NULL; $database->loadObject( $row ); $arrTablaEnt = darDetallesObra($refid, $row->ncol); $arrTabla = $arrTablaEnt[1]; $cadena = trim($arrTabla[0][0]); if ($cadena != '') { echo " "; echo $cadena; echo "  (en formato MIDI)"; echo '
'); //DETALLES //Rellenamos el array con el contenido correspondiente si tiene contenido if ($arrTablaEnt[0] != 0) { //Dibujamos la tabla detalle echo "
"; echo "
"; echo "

Ficheros MIDI por cuerdas:

"; echo ""; for ($j = 0; $j < $row->ncol + 1; $j++) { echo ""; for ($i = 0; $i < $row->ncol + 1; $i++) { if ($j == 0) { echo ""; } else { if ($i == 0) { echo ""; } else { if ($arrTabla[$j][$i] != "") echo ""; else echo ""; } } } echo ""; } echo ('
".$arrTabla[$j][$i]."".$arrTabla[$j][$i]."".$arrTabla[$j][$i]."".$arrTabla[$j][$i]."
'); } ?> setQuery( "SELECT * FROM #__categories WHERE section = 'com_obrens' AND published = '1' AND id='$catid'" ); $row = $database->loadObjectList(); foreach($row as $rows1) { echo "$rows1->id $rows1->title
$rows1->description
"; } echo ""; $line=1; $database->setQuery("SELECT * FROM #__obrens WHERE published='1' AND catid='$catid' ORDER BY ordering, titulo"); $srows = $database->loadObjectList(); foreach($srows as $srow1) { $linecolor = ($line % 2) + 1; echo ""; $line++; } echo "
"; echo ""; if ($artref_showpicture) echo ""; echo "
"; echo "
"; echo "$srow1->titulo"; echo "
$srow1->autor"; echo "
"; echo "
"; echo "
"; echo ""; echo "
$srow1->beschreibung
"; if ($artref_showbeschrlink) echo "

» ".ARTREF_MEHR."

"; echo "
"; echo "

"; echo "

« "._BACK."

"; return; } //Einzelne Kategorie Inhalt Auflistung function ShowCatList($Itemid, $vcatid, $artref_showphone, $artref_showmail, $artref_showwebsite, $artref_showstatus, $artref_showbeschrlink) { global $mosConfig_dbprefix; global $database, $stati, $vcatid, $startpage, $artref_refperside; //Rodax $art_perpage = 100;//$artref_refperside; echo ""; $columnspan = $artref_showstatus + 2; $database->setQuery( "SELECT c.*, COUNT(DISTINCT s1.id) AS num" . "\nFROM #__categories AS c" . "\nLEFT JOIN #__obrens AS s1 ON s1.catid = c.id" . "\nWHERE c.section='com_obrens' AND c.published='1'" . "\nGROUP BY c.id" . "\nORDER BY c.ordering, c.title" ); $rows = $database->loadObjectList(); foreach($rows as $row1) { if($row1->id == $vcatid){ if ($row1->num > 0) { echo ""; $line=1; // kopfteil echo ""; if ($artref_showstatus) echo ""; echo ""; #Liste befüllen $database->setQuery("SELECT * FROM #__obrens WHERE published='1' AND catid='$row1->id' ORDER BY ordering, titulo LIMIT $start,$art_perpage"); $srows = $database->loadObjectList(); foreach($srows as $srow1) { $linecolor = ($line % 2) + 1; $AREF_titulo = "$srow1->titulo"; echo ""; echo ""; echo ""; $i = $srow1->status; if ($artref_showstatus) echo ""; echo ""; $line++; } } } } echo "
$row1->title
$row1->description"; # Feststellen der Anzahl der verfügbaren Datensätze $database->setQuery("SELECT COUNT(id) AS amount FROM ".$mosConfig_dbprefix."artref WHERE catid = $vcatid"); $row = NULL; $database->loadObject( $row ); $count = $row->amount; # Berechnen der Gesamtseiten $gesamtseiten = floor($count / $art_perpage); $seitenrest = $count % $art_perpage; if ($seitenrest>0) { $gesamtseiten++; } # Feststellen der aktuellen Seite if (isset($startpage)) { if ($startpage>$gesamtseiten) { $startpage = $gesamtseiten; } else if ($startpage<1) { $startpage = 1; } } else { $startpage = 1; } echo "

".ARTREF_EintrinListA." ".$count." ".ARTREF_EintrinListB."
"; echo "

"; # Limit und Seite Vor- & Rueckfunktionen $start = ( $startpage - 1 ) * $art_perpage; echo "
   
"; if($srow1->picture==""){ echo "$AREF_titulo - ".ARTREF_BILDKLICKEN.""; }else{ echo "$AREF_titulo - ".ARTREF_BILDKLICKEN.""; } echo ""; if ($artref_showbeschrlink) { echo "$AREF_titulo
$srow1->autor"; } else { echo "$AREF_titulo
$srow1->autor"; } echo "
".ARTREF_STATUS.":
$stati[$i]

"; echo "

".ARTREF_Pages.": "; # Ausgeben der Seite zurueck Funktion $seiterueck = $startpage - 1; if ($seiterueck>0) { echo "« "; } #Ausgeben der einzelnen Seiten for ($i=1; $i <= $gesamtseiten; $i++) { if ($i==$startpage) { echo "$i "; } else { echo "$i "; } } # Ausgeben der Seite vorwärts Funktion $seitevor = $startpage + 1; if ($seitevor<=$gesamtseiten) { echo "» "; } echo "

"; echo "


« "._BACK."

"; return; } ################################################################################### #CUERPO ################################################################################### # Estilo de vista if ($obrens_verlista=="1" AND $func=="") $func = "list"; if ($obrens_verlista=="2" AND $func=="") $func = "cats"; # Cabecera RefHeader($Itemid); # Contenido switch ($func) { case 'viewcategory': ShowCatList($Itemid, $catid, $artref_showphone, $artref_showmail, $artref_showwebsite, $artref_showstatus, $artref_showbeschrlink); break; case 'cats': ShowCats($Itemid, $artref_showpicture); break; case 'list': ShowList($obrens_vercabecera, $artref_showbeschrlink, $obrens_ordenlista); break; case 'fullview': ShowObra($refid, $Itemid); break; default: $database->setQuery( "SELECT c.*, COUNT(DISTINCT s1.id) AS num" . "\nFROM #__categories AS c" . "\nLEFT JOIN #__obrens AS s1 ON s1.catid = c.id" . "\nWHERE c.section='com_obrens' AND c.published='1'" . "\nGROUP BY c.id" . "\nORDER BY c.ordering, c.titulo" ); $rows = $database->loadObjectList(); foreach($rows as $row1) { if ($row1->num > 0) { echo ""; echo ""; $line=1; $database->setQuery("SELECT * FROM #__obrens WHERE published='1' AND catid='$row1->id' ORDER BY ordering, titulo"); $srows = $database->loadObjectList(); foreach($srows as $srow1) { $linecolor = ($line % 2) + 1; echo ""; $line++; } echo "
$row1->title
$row1->description
"; echo ""; if ($artref_showpicture) echo ""; echo "
"; echo "
"; echo "$srow1->partiturapdf"; echo "$srow1->titulo"; echo "
$srow1->autor"; echo "
"; $i = $srow1->status; if ($artref_showstatus) echo "$stati[$i]"; echo "
"; echo "
"; if ($artref_showphone) echo ""; # Show Email if ($artref_showmail) { echo ""; } echo "
".LIT_PARTITURAMUS."$srow1->partituramus
".LIT_NCOLFIL.""; if ($srow1->ncolfil) { echo "$srow1->ncolfil"; } else { echo "-"; } echo "
"; if ($artref_showbeschrlink) echo "

» ".ARTREF_MEHR."

"; echo "
"; echo "

"; } } break; } # Footer if ($obrens_verfooter == "1") RefFooter($ObrEns_version); ?>