Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
2018_web_app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
inutralia
2018_web_app
Commits
65f44adc
Commit
65f44adc
authored
Dec 10, 2018
by
David Villalba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RECETARIO --> Funcionalidad filtros terminados.
parent
98f23780
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
index.php
fuel/app/classes/controller/recetario/index.php
+30
-1
inutraliaWS.php
fuel/app/classes/trait/inutraliaWS.php
+8
-2
filters.twig
fuel/app/views/recetario/filters.twig
+13
-4
No files found.
fuel/app/classes/controller/recetario/index.php
View file @
65f44adc
...
...
@@ -68,7 +68,36 @@ class Controller_Recetario_Index extends \Controller_App{
$view
->
groups_filters
=
$this
->
ws_options_get
();
$view
->
recipes
=
$this
->
ws_recipe_get
();
$inputs
=
array
();
$criterio_options
=
array
();
// Preparamos el array para que lo acepte la API
if
(
\Input
::
post
(
'desc'
)
!=
""
){
$inputs
[
'desc'
]
=
\Input
::
post
(
'desc'
);
}
if
(
!
is_null
(
\Input
::
post
(
'flags_or'
))){
$inputs
[
'flags_or'
]
=
implode
(
","
,
\Input
::
post
(
'flags_or'
));
$criterio_options
=
array_merge
(
$criterio_options
,
\Input
::
post
(
'flags_or'
));
}
if
(
!
is_null
(
\Input
::
post
(
'flags'
))){
$inputs
[
'flags'
]
=
implode
(
","
,
\Input
::
post
(
'flags'
));
$criterio_options
=
array_merge
(
$criterio_options
,
\Input
::
post
(
'flags'
));
}
$view
->
recipes
=
$this
->
ws_recipes_post
(
$inputs
);
$view
->
criterio_desc
=
\Input
::
post
(
'desc'
);
$view
->
criterio_options
=
$criterio_options
;
return
Response
::
forge
(
$view
);
...
...
fuel/app/classes/trait/inutraliaWS.php
View file @
65f44adc
...
...
@@ -131,9 +131,15 @@ trait Trait_InutraliaWS {
}
public
function
ws_
options_post
(
){
public
function
ws_
recipes_post
(
$data
){
return
json_decode
(
$this
->
request_generic
(
'options'
));
$data_json
=
json_encode
(
$data
);
$extra_options
=
array
(
CURLOPT_POSTFIELDS
=>
$data_json
);
return
json_decode
(
$this
->
request_generic
(
'recipes'
,
"post"
,
1
,
$extra_options
,
array
(
'Content-Length: '
.
strlen
(
$data_json
))));
}
...
...
fuel/app/views/recetario/filters.twig
View file @
65f44adc
...
...
@@ -11,7 +11,11 @@
</div>
<!--contenido desplegable filtros-->
<div
class=
"hidden"
id=
"content-filter-recetario"
>
<form>
<form
action=
"
{{
url
(
'recetario'
)
}}
"
method=
"post"
>
<labe>
Nombre de receta
</labe>
<input
class=
"form-control"
name=
"desc"
value=
"
{{
criterio_desc
}}
"
>
<br>
{%
for
group
in
groups_filters
%}
{# ETIQUETA DEL GRUPO #}
...
...
@@ -21,8 +25,13 @@
{%
for
option
in
group.options
%}
<div
class=
"col-md-3"
>
<div
class=
"form-group text-center"
>
<label
class=
"switch"
for=
"switch_filter_
{{
group.id
~
'_'
~
option.id
}}
"
>
<input
type=
"checkbox"
id=
"switch_filter_
{{
group.id
~
'_'
~
option.id
}}
"
/>
<label
class=
"switch"
for=
"switch_filter_
{{
option.id
}}
"
>
<input
type=
"checkbox"
{%
if
group.id
==
1
%}
name=
"flags_or[]"
{%
else
%}
name=
"flags[]"
{%
endif
%}
id=
"switch_filter_
{{
option.id
}}
"
value=
"
{{
option.id
}}
"
{%
if
option.id
in
criterio_options
%}
checked
{%
endif
%}
/>
<div
class=
"slider round"
></div>
</label>
<p>
{{
option.name
}}
</p>
...
...
@@ -34,7 +43,7 @@
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-6"
>
<button
class=
"btn btn-custom btn-other mt20"
>
aplicar
<i
class=
"fa fa-angle-double-right"
></i></button>
<button
type=
"submit"
class=
"btn btn-custom btn-other mt20"
>
aplicar
<i
class=
"fa fa-angle-double-right"
></i></button>
</div>
</div>
</form>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment