function formEditaHoraris($IDA, $FHorari, $MISSATGE, $EXTRES, $IDS) { ?> <form action="<?php echo url_for('gestio/gActivitats'); ?> " method="POST"> <?php if (isset($MISSATGE)) { ?> <div style="padding:20px; margin-left:20px; border:10px solid red; width:650px; background-color: black; color:yellow; font-weight:bold;"><?php echo '<ul>'; if (!isset($MISSATGE)) { $MISSATGE = array(); } foreach ($MISSATGE as $M) { echo '<li>' . $M . '</li>'; } echo '</ul>'; ?> </div> <?php } ?> <div class="REQUADRE"> <div class="OPCIO_FINESTRA"><?php echo link_to(image_tag('icons/Grey/PNG/action_delete.png'), 'gestio/gActivitats?accio=HORARI&IDA=' . $IDA . '&form=0'); ?> </div> <div class="TITOL">Edició horaris</div> <div class="FORMULARI"> <?php echo $FHorari; ?> <div class="clear row fb"> <span class="title row_title fb"><b>Espais: </b></span> <span class="row_field fb"> <?php $id = 1; $VAL = ""; foreach ($EXTRES['ESPAISOUT'] as $idE => $nom) { if (!empty($idE)) { $VAL .= '<span id="rowE[' . $id . ']"> <select name="espais[' . $id . ']" id="espais[' . $id . ']">' . EspaisPeer::selectJavascript($IDS, $idE) . '</select> <input type="button" style="width:30px;" onClick="esborraLiniaE(' . $id . ');" id="mesespais" value="-"></input> <br /> </span> '; $id++; } } echo '<input type="button" id="mesespais" style="width:30px;" value="+"></input><br />'; echo '<input type="hidden" id="idE" value="' . $id . '"></input>'; echo '<div id="divTxtE">' . $VAL . '</div>'; ?> </span> </div> <div class="clear row fb"> <span class="title row_title fb"><b>Material: </b></span> <span class="row_field fb"> <?php $id = 1; $VAL = ""; foreach ($EXTRES['MATERIALOUT'] as $M => $idM) { $VAL .= ' <span id="row[' . $id . ']"> <select onChange="ajax(this,' . $id . ')" name="generic[' . $id . ']"> id="generic[' . $id . ']">' . options_for_select(MaterialgenericPeer::select($IDS), $idM['generic']) . '</select> <select name="material[' . $id . ']" id="material[' . $id . ']">' . options_for_select(MaterialPeer::selectGeneric($idM['generic'], $IDS, $idM['material']), $idM['material']) . '</select> <input type="button" style="width:30px;" onClick="esborraLinia(' . $id . ');" id="mesmaterial" value="-"></input> <br /> </span> '; $id++; } echo '<input type="button" id="mesmaterial" style="width:30px;" value="+"></input><br />'; echo '<input type="hidden" id="idV" value="' . $id . '"></input>'; echo '<div id="divTxt">' . $VAL . '</div>'; ?> </span> </div> <div class="clear"></div> <div id="div_lloc_extern" class="clear row fb"> <span class="title row_title fb"><b>Opcions: </b></span> <span class="row_field fb"> <a href="#" id="a_lloc_extern">L'activitat es realitza a un lloc extern</a> </span> </div> <div id="formulari_lloc_extern"> <div><b>Població externa</b><br /><br /></div> <?php echo $EXTRES['ESPAIEXTERN']; ?> <div class="clear"></div> </div> <div class="clear row fb"> <div style="text-align:right"> <?php include_partial('botonera', array('element' => 'l\\\'horari', 'tipus' => 'Guardar', 'nom' => 'BHORARISAVE')); ?> <?php include_partial('botonera', array('element' => 'l\\\'horari', 'tipus' => 'Esborrar', 'nom' => 'BHORARIDELETE')); ?> </div> </div> </div> <div class="clear"></div> </div> <script type="text/javascript"> $(function() { $('#multi999Datepicker').datepick({numberOfMonths: 3, multiSelect: 999, showOn: 'both', buttonImageOnly: true, buttonImage: '<?php echo image_path('template/calendar_1.png'); ?> '}); }); </script> </form> <?php }
<div> <input type="hidden" name="IDC" value="<?php echo $IDC; ?> " /> <?php $id = 1; $VAL = ""; if (!isset($MATERIALOUT)) { $MATERIALOUT = array(); } foreach ($MATERIALOUT as $M => $idM) { $VAL .= ' <span id="row[' . $id . ']"> <select onChange="ajax(this,' . $id . ')" name="generic[' . $id . ']"> id="generic[' . $id . ']">' . options_for_select(MaterialgenericPeer::select($IDS), $idM['generic']) . '</select> <select name="material[' . $id . ']" id="material[' . $id . ']">' . options_for_select(MaterialPeer::selectGeneric($idM['generic'], $IDS, $idM['material']), $idM['material']) . '</select> <input type="button" onClick="esborraLinia(' . $id . ');" id="mesmaterial" value="-"></input> <br /> </span> '; $id++; } echo '<input type="button" id="mesmaterial" value="+"></input><br />'; echo '<input type="hidden" id="idV" value="' . $id . '"></input>'; echo '<div id="divTxt">' . $VAL . '</div>'; ?> </div> <br /> <div class="fb TITOL" style="width:100%">Material no inventariat</div>
public function executeGEstadistiques(sfWebRequest $request) { $this->setLayout('gestio'); $this->IDS = $this->getUser()->getSessionPar('idS'); $this->CERCA = $request->getParameter('cerca', $this->CERCA); $this->CERCA = $this->getCercaEstadistiquesComplet($this->CERCA); if ($request->hasParameter('BCERCA_ESP')) { $this->ESPAIS = EspaisPeer::select($this->IDS); $dit = mktime(0, 0, 0, $this->CERCA['MES'], 1, $this->CERCA['ANY']); $month = date('m', $dit); $year = date('Y', $dit); $site = $this->IDS; $Espais = $this->CERCA['ESPAI']; if (empty($this->CERCA['ESPAI'])) { foreach ($this->ESPAIS as $K => $V) { $Espais[$K] = $K; } } $this->DATA = mktime(0, 0, 0, $month, 1, $year); $this->OCUPACIO_ESPAIS = EspaisPeer::getEstadistiquesEspais($Espais, $site, $month, $year); } elseif ($request->hasParameter('BCERCA_MAT')) { $this->MATERIAL = MaterialPeer::selectGeneric($this->CERCA['MATERIAL_GENERIC'], $this->IDS, null); $dit = mktime(0, 0, 0, $this->CERCA['MES'], 1, $this->CERCA['ANY']); $month = date('m', $dit); $year = date('Y', $dit); $site = $this->IDS; $this->OCUPACIO_MATERIAL = MaterialPeer::getEstadistiquesMaterial($this->CERCA['MATERIAL'], $site, $month, $year); } }
function formCercaMaterials($CERCA, $IDS) { ?> <form action="<?php echo url_for('gestio/gEstadistiques'); ?> " id="FMATERIALS" method="POST"> <table class="FORMULARI" width="100%"> <tr><td> <div class="TITOL">Cerca materials</div> <div class="CERCA"> <div style="margin-bottom:10px;"> <?php echo select_tag('cerca[ANY]', options_for_select(selectAnys(), $CERCA['ANY']), array('class' => 'cinquanta')); ?> <?php echo select_tag('cerca[MES]', options_for_select(selectMesos(), $CERCA['MES'], array()), array('class' => 'cinquanta')); ?> <?php echo select_tag('cerca[MATERIAL_GENERIC]', options_for_select(MaterialgenericPeer::select($IDS, false, false), $CERCA['MATERIAL_GENERIC'])); ?> </div> <?php foreach (MaterialPeer::selectGeneric($CERCA['MATERIAL_GENERIC'], $IDS) as $K => $V) { echo '<div style="float:left; width:210px;">' . checkbox_tag('cerca[MATERIAL][' . $K . ']', $K, isset($CERCA['MATERIAL'][$K]), array()) . ' ' . $V . ' (M' . $K . ')</div>'; } ?> </div> </td></tr> <tr> <td colspan="2"> <input type="submit" name="BCERCA_MAT" value="Prem per buscar" /> </td> </tr> </table> </form> <?php }