function formLlistaActivitats($ACTIVITATS, $PAGINA, $IDS) { ?> <div class="REQUADRE"> <div class="TITOL">Llistat d'activitats <span style="color:gray; font-weight:normal; ">(Ordenat per <a id="ORDENA_HORARIS" href="#">horaris</a> / <a id="ORDENA_ESPAIS" href="#">espais</a> )</span></div> <table id="LLISTAT_ORDENAT_HORARIS" class="DADES"> <?php if (sizeof($ACTIVITATS) == 0) { echo '<TR><TD class="LINIA">No s\'ha trobat cap activitat.</TD></TR>'; } foreach ($ACTIVITATS as $idH => $A) { $AVIS = ""; $ESP = ""; $MAT = ""; $PUBLICAT = ""; if (!empty($A['ESPAIS'])) { $ESP = implode("<br />", $A['ESPAIS']); } if (!empty($A['MATERIAL'])) { $MAT = implode("<br />", $A['MATERIAL']); } if (strlen($A['AVIS']) > 2) { $AVIS = '<a href="#" class="tt2">' . image_tag('tango/32x32/emblems/emblem-important.png', array('size' => '16x16')) . '<span>' . $A['AVIS'] . '</span></a>'; } else { $AVIS = ""; } if ($A['PUBLICAT'] == 'OK') { $PUBLICAT = image_tag('template/exclamation.png', array('size' => '16x16')); } elseif ($A['PUBLICAT'] == 'FALTA_INFO') { $PUBLICAT = image_tag('template/stop.png', array('size' => '16x16')); } $j = 1; $PAR = ParImpar($j++); $url_act = link_to($A['NOM_ACTIVITAT'], 'gestio/gActivitats?accio=ACTIVITAT&IDA=' . $A['ID'], array('style' => 'font-size:12px')); $url_hor = ""; //link_to('Edita informació pràctica','gestio/gActivitats?accio=HORARI&IDA='.$A['ID'].'&IDH='.$idH,array('style'=>'font-size:10px')); $org = empty($A['ORGANITZADOR']) ? "" : "<span style=\"font-size:8px; color:gray; \"> (" . $A['ORGANITZADOR'] . ") </span>"; echo ' <tr><td style="background-color:#EEEEEE; border:1px solid #EEEEEE; height:15px;" colspan="6"></td></tr>'; echo ' <tr><td class="LIST2 ' . $PAR . '" colspan="6">' . $url_act . $AVIS . ' ' . $PUBLICAT . $org . ' <div style="float:right">' . $url_hor . '</div></td></tr>'; echo ' <TR> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:10px; color:#880000;">' . $A['HORA_PRE'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:green;">' . $A['HORA_INICI'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><b>' . $A['HORA_FI'] . '</b></TD>'; echo ' <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:#800000;">' . $ESP . '</span></TD>'; echo ' <TD class="LIST2 ' . $PAR . '">' . $MAT . '</TD> <TD class="LIST2 ' . $PAR . '">' . $A['DIA'] . '</TD> </TR>'; } ?> </table> <table id="LLISTAT_ORDENAT_ESPAIS" class="DADES" style="display: none;"> <?php if (sizeof($ACTIVITATS) == 0) { echo '<TR><TD class="LINIA">No s\'ha trobat cap activitat.</TD></TR>'; } $ESPAIS = array(); foreach ($ACTIVITATS as $idH => $A) { foreach ($A['ESPAIS'] as $idE => $E) { $ESPAIS[$idE][] = $idH; } } $ANT = ""; //Reordeno espais perquè apareguin com estan ordenats a la intranet. $ESPAIS_REAL = EspaisPeer::getEspaisSite($IDS); $ESPAIS_ORDENAT = array(); foreach ($ESPAIS_REAL as $OE) { $idE = $OE->getNom(); if (isset($ESPAIS[$idE])) { $ESPAIS_ORDENAT[$idE] = $ESPAIS[$idE]; } } foreach ($ESPAIS_ORDENAT as $idE => $HORA) { foreach ($HORA as $idH) { $A = $ACTIVITATS[$idH]; //Per cada horari, agafem l'espai i fem un vector on guardarem els resultats.' $AVIS = ""; $ESP = ""; $MAT = ""; $PUBLICAT = ""; if (!empty($A['ESPAIS'])) { $ESP = $A['ESPAIS'][$idE]; } if (!empty($A['MATERIAL'])) { $MAT = implode("<br />", $A['MATERIAL']); } if (strlen($A['AVIS']) > 2) { $AVIS = '<a href="#" class="tt2">' . image_tag('tango/32x32/emblems/emblem-important.png', array('size' => '16x16')) . '<span>' . $A['AVIS'] . '</span></a>'; } else { $AVIS = ""; } if ($A['PUBLICAT'] == 'OK') { $PUBLICAT = image_tag('template/exclamation.png', array('size' => '16x16')); } elseif ($A['PUBLICAT'] == 'FALTA_INFO') { $PUBLICAT = image_tag('template/stop.png', array('size' => '16x16')); } $j = 1; $PAR = ParImpar($j++); $url_act = link_to($A['NOM_ACTIVITAT'], 'gestio/gActivitats?accio=ACTIVITAT&IDA=' . $A['ID'], array('style' => 'font-size:12px')); $url_hor = $org = empty($A['ORGANITZADOR']) ? "" : "<span style=\"font-size:8px; color:gray; \"> (" . $A['ORGANITZADOR'] . ") </span>"; if ($ANT != $ESP) { echo ' <tr><td style="background-color:#AAAAAA; font-size:14px; color:EEEEEE; font-style:italic; border:1px solid #EEEEEE; height:15px;" colspan="6">' . $ESP . '</td></tr>'; } else { echo ' <tr><td style="background-color:#EEEEEE; border:1px solid #EEEEEE; height:15px;" colspan="6"> </td></tr>'; } $ANT = $ESP; echo ' <tr><td class="LIST2 ' . $PAR . '" colspan="6">' . $url_act . $AVIS . ' ' . $PUBLICAT . $org . ' <div style="float:right">' . $url_hor . '</div></td></tr>'; echo ' <TR> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:10px; color:#880000;">' . $A['HORA_PRE'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:green;">' . $A['HORA_INICI'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><b>' . $A['HORA_FI'] . '</b></TD>'; echo ' <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:#800000;">' . $ESP . '</span></TD>'; echo ' <TD class="LIST2 ' . $PAR . '">' . $MAT . '</TD> <TD class="LIST2 ' . $PAR . '">' . $A['DIA'] . '</TD> </TR>'; } } ?> </table> </div> <?php }
function formLlistaActivitats($ACTIVITATS, $PAGINA) { ?> <div class="REQUADRE"> <div class="TITOL">Llistat d'activitats </div> <table class="DADES"> <?php if (sizeof($ACTIVITATS) == 0) { echo '<TR><TD class="LINIA">No s\'ha trobat cap activitat.</TD></TR>'; } $i = 0; $j = 0; $Tall = 30; foreach ($ACTIVITATS as $idH => $A) { if ($i >= $Tall * ($PAGINA - 1) && $i < $Tall * ($PAGINA - 1) + $Tall) { $AVIS = ""; $ESP = ""; $MAT = ""; if (!empty($A['ESPAIS'])) { $ESP = implode("<br />", $A['ESPAIS']); } if (!empty($A['MATERIAL'])) { $MAT = implode("<br />", $A['MATERIAL']); } if (strlen($A['AVIS']) > 2) { $AVIS = '<a href="#" class="tt2">' . image_tag('tango/32x32/emblems/emblem-important.png', array('size' => '16x16')) . '<span>' . $A['AVIS'] . '</span></a>'; } else { $AVIS = ""; } $j = 1; $PAR = ParImpar($j++); $url_act = link_to($A['NOM_ACTIVITAT'], 'gestio/gActivitats?accio=ACTIVITAT_NO_EDIT&IDA=' . $A['ID'], array('style' => 'font-size:12px')); $url_hor = link_to('Edita informació pràctica', 'gestio/gActivitats?accio=HORARI&IDA=' . $A['ID'] . '&IDH=' . $idH, array('style' => 'font-size:10px')); $org = empty($A['ORGANITZADOR']) ? "" : "<span style=\"font-size:8px; color:gray; \"> (" . $A['ORGANITZADOR'] . ") </span>"; echo ' <tr><td style="background-color:#EEEEEE; border:1px solid #EEEEEE; height:15px;" colspan="6"></td></tr>'; echo ' <tr><td class="LIST2 ' . $PAR . '" colspan="6">' . $url_act . $AVIS . $org . ' <div style="float:right">' . $url_hor . '</div></td></tr>'; echo ' <TR> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:10px; color:#880000;">' . $A['HORA_PRE'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:green;">' . $A['HORA_INICI'] . '</span></TD> <TD class="LIST2 ' . $PAR . '"><b>' . $A['HORA_FI'] . '</b></TD>'; echo ' <TD class="LIST2 ' . $PAR . '"><span style="font-weight:bold; font-size:12px; color:#800000;">' . $ESP . '</span></TD>'; echo ' <TD class="LIST2 ' . $PAR . '">' . $MAT . '</TD> <TD class="LIST2 ' . $PAR . '">' . $A['DIA'] . '</TD> </TR>'; } $i++; } $sof = sizeof($ACTIVITATS); $TALL = intval($sof / $Tall) + 1; if ($TALL > 1) { echo '<TR><TD class="LINIA" colspan="5" align="CENTER">'; for ($i = 1; $i <= $TALL; $i++) { echo link_to("pàg " . $i . " - ", 'gestio/gActivitats?PAGINA=' . $i); } echo '</TD></TR>'; } ?> </table> </div> <?php }
?> ">Veure les resoltes</a>)</DIV> <TABLE class="DADES"> <?php if ($INCIDENCIES->getNbResults() == 0) { echo '<TR><TD class="LINIA" colspan="4">No s\'ha trobat cap incidencia amb aquestes dades.</TD></TR>'; } else { $i = 0; echo '<TR> <th class="titol">Incidència</TH> <th class="titol">Estat</TH> <th class="titol">Data Alta</TH> <th class="titol">Data Resolució</TH> </TR>'; foreach ($INCIDENCIES->getResults() as $I) { $PAR = ParImpar($i++); echo '<TR> <TD class="' . $PAR . '">' . link_to($I->getTitol(), 'gestio/gIncidencies' . getParam('E', $I->getIdincidencia(), $PAGINA)) . '</TD> <TD class="' . $PAR . '">' . $I->getEstatText() . '</TD> <TD class="' . $PAR . '">' . $I->getDataalta('d/m/Y') . '</TD> <TD class="' . $PAR . '">' . $I->getDataresolucio('d/m/Y') . '</TD> </TR>'; } } ?> <TR><TD colspan="4" class="TITOL"><?php echo gestorPagines($INCIDENCIES); ?> </TD></TR> </TABLE>