Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
musica_listas_umusic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
musica_listas_umusic
Commits
f48b947c
Commit
f48b947c
authored
Aug 22, 2019
by
Ana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cambios
parent
30ea27d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
16 deletions
+52
-16
src/FrontendBundle/Controller/SuscripcionController.php
src/FrontendBundle/Controller/SuscripcionController.php
+13
-7
templates/frontend/index.html.twig
templates/frontend/index.html.twig
+0
-9
templates/frontend/paginas/resultado.html.twig
templates/frontend/paginas/resultado.html.twig
+39
-0
No files found.
src/FrontendBundle/Controller/SuscripcionController.php
View file @
f48b947c
...
...
@@ -71,6 +71,7 @@ class SuscripcionController extends AbstractController
public
function
contratar
(
Request
$request
)
:
Response
{
$log
=
Utiles
::
setLog
(
'App\FrontendBundle\Controller::SuscripcionController::contratar'
,
'app/frontend/contratacion'
);
$em
=
$this
->
getDoctrine
()
->
getManager
(
'default'
);
$ua
=
$request
->
headers
->
get
(
'User-Agent'
);
$msisdn
=
$request
->
get
(
"msisdn"
);
$lisId
=
$request
->
get
(
"lisId"
);
$fechaActual
=
new
\DateTime
();
...
...
@@ -124,10 +125,13 @@ class SuscripcionController extends AbstractController
$json
->
setData
(
array
(
'success'
=>
'OK.'
));
$json
->
setStatusCode
(
JsonResponse
::
HTTP_OK
);
$url
=
$this
->
container
->
get
(
'router'
)
->
generate
(
'front_index'
,
array
(
'msisdn'
=>
$msisdn
,
'mensaje'
=>
"Suscripción realizada correctamente"
));
$statusCode
=
302
;
return
new
RedirectResponse
(
$url
,
$statusCode
);
return
$this
->
render
(
'frontend/paginas/resultado.html.twig'
,
[
"lista"
=>
$lista
,
"mensaje"
=>
"Suscripción realizada correctamente"
,
"isChrome"
=>
Utiles
::
isWindowsChrome
(
$ua
)
]);
}
else
{
$suscripcion
->
setSusVigente
(
PluSuscripcion
::
NO_VIGENTE
);
$em
->
persist
(
$suscripcion
);
...
...
@@ -135,10 +139,12 @@ class SuscripcionController extends AbstractController
$json
->
setData
(
array
(
'errors'
=>
$resultado
[
"descr"
]));
$json
->
setStatusCode
(
JsonResponse
::
HTTP_BAD_REQUEST
);
$url
=
$this
->
container
->
get
(
'router'
)
->
generate
(
'front_index'
,
array
(
'msisdn'
=>
$msisdn
,
'error'
=>
"Estimado usuario, no se ha podido realizar la suscripción"
));
$statusCode
=
302
;
return
new
RedirectResponse
(
$url
,
$statusCode
);
return
$this
->
render
(
'frontend/paginas/resultado.html.twig'
,
[
"lista"
=>
$lista
,
"error"
=>
"Estimado usuario, no se ha podido realizar la suscripción"
,
"isChrome"
=>
Utiles
::
isWindowsChrome
(
$ua
)
]);
}
}
...
...
templates/frontend/index.html.twig
View file @
f48b947c
...
...
@@ -13,15 +13,6 @@
<div
class=
"col-4"
>
<p
class=
"txt-top text-left"
>
<h6>
{%
if
error
is
defined
%}
<font
color=
"red"
>
{{
error
}}
</font>
{%
endif
%}
{%
if
mensaje
is
defined
%}
<font
color=
"green"
>
{{
mensaje
}}
</font>
{%
endif
%}
</h6>
Entra a alguna de las categorías y suscríbete
</p>
</div>
...
...
templates/frontend/paginas/resultado.html.twig
0 → 100644
View file @
f48b947c
{%
extends
'frontend/base.html.twig'
%}
{%
block
title
%}
Reproductor
{%
endblock
%}
{%
block
stylesheets
%}
<link
href=
"
{{
asset
(
'frontend/css/styles-player.css'
)
}}
"
rel=
"stylesheet"
>
{%
endblock
%}
{%
block
body
%}
<header
class=
"masthead-sc text-white"
>
<div
class=
"masthead-content"
>
<!-- header con mensaje -->
<form
action=
"
{{
path
(
'front_index'
)
}}
"
}}
>
<div
class=
"container subheader-info col-10 offset-1 mt-4 mb-3"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<p
class=
"numero-top text-left"
>
{{
lista.getLisNombre
()
}}
</p>
{%
if
error
is
defined
%}
<div
align=
"center"
>
<div
class=
"alert alert-danger"
>
{{
error
}}
</div>
</div>
{%
endif
%}
{%
if
mensaje
is
defined
%}
<div
align=
"center"
>
<div
class=
"alert alert-success"
>
{{
mensaje
}}
</div>
</div>
{%
endif
%}
<button
type=
"submit"
class=
"btn btn-codigo-suscripcion col-11 mt-4 mb-5"
>
Volver
</button>
</div>
</div>
</div>
</form>
</div>
</header>
{%
endblock
%}
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