function themes($colegio_ID) { $class_style = new style(); $style = $class_style->obtenerStyle($colegio_ID); $styles = $class_style->obtenerStyles(); $html = "Seleccione un tema: <br><select id='selectStyle' name='selectStyle'>"; foreach ($styles as $key => $styleFolder) { if ($styleFolder == $style['style_path']) { $selected = "selected"; } else { $selected = ""; } $html .= "<option value='{$styleFolder}' {$selected}>{$styleFolder}</option>"; } $html .= "</select>"; $html .= "<input type='button' name='guardarTheme' id='guardarTheme' value='Guardar Tema' />"; $html .= "<script>\$('#guardarTheme').click(function(){\r var selectStyle = \$('#selectStyle').val();\r \$('#form_super').append(\"<input type='hidden' name='style_path' id='style_path' value='\"+selectStyle+\"'\");\r \$('#_action').val('guardarTheme');\r \$('#form_super').submit();\r });\r </script>"; print $html; }