?> " style="width: 500px;" /> </div> </div> <div style="clear:both; float: left;"> <div style="margin: 5px;"> <b>On?</b><br /><?php echo select_tag('cerca[POBLE]', options_for_select(ActivitatsPeer::selectPoblesActivitats($CERCA['TEXT']), $CERCA['POBLE'][0]), array('multiple' => 'multiple', 'style' => 'height:130px; width:180px;', 'id' => 'R_ON')); ?> </div> </div> <div style="float: left;"> <div style="margin: 5px;"> <b>Què?</b><br /><?php echo select_tag('cerca[CATEGORIA]', options_for_select(ActivitatsPeer::selectCategoriesActivitats($CERCA['POBLE'][0], $CERCA['TEXT']), $CERCA['CATEGORIA'][0]), array('multiple' => 'multiple', 'style' => 'height:130px; width:180px;', 'id' => 'R_CAT')); ?> </div> </div> <div style="float: left;"> <div style="margin: 5px;"> <div style="margin: 5px;"> Des de: <input type="text" id="DI" name="cerca[DATA_R][DI]" style="height:30px; width:100px;" /> Fins a: <input type="text" id="DF" name="cerca[DATA_R][DF]" style="height:30px; width:100px;" /> </div> </div> </div> <div style="clear:both; float: left; width:400px;"> <div id="RANG" style="float: left; margin-right:5px; margin-top:4px;"> Des de: <input type="text" id="DI" name="cerca[DATA_R][DI]" style="height:30px; width:100px;" /> Fins a: <input type="text" id="DF" name="cerca[DATA_R][DF]" style="height:30px; width:100px;" />
/** * Realitza totes les consultes AJAX D'activitats * */ public function executeAjaxACT(sfWebRequest $request) { $accio = $request->getParameter('ACCIO'); switch ($accio) { case 'POB_ON': $C = new Criteria(); $text = $request->getParameter('TEXT'); $idP = $request->getParameter('ON'); $sel = $request->getParameter('SEL'); $R = ActivitatsPeer::selectCategoriesActivitats($idP[0], $text); break; case 'POB_QUAN': $C = new Criteria(); $idP = $request->getParameter('ON'); $idC = $request->getParameter('CAT'); $sel = $request->getParameter('SEL'); $text = $request->getParameter('TEXT'); $R = ActivitatsPeer::selectDatesActivitats($idP[0], $idC[0], $text, null); break; case 'ENT_QUAN': $C = new Criteria(); $idE = $request->getParameter('ENT'); $sel = $request->getParameter('SEL'); $text = $request->getParameter('TEXT'); $R = ActivitatsPeer::selectDatesActivitats(null, null, $text, $idE[0]); break; } $RET = ""; foreach ($R as $K => $E) { $SELECTED = $sel == $K ? "SELECTED" : ""; $RET .= '<option ' . $SELECTED . ' value="' . $K . '">' . $E . '</option>'; } return $this->renderText($RET); }