Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nutrapharm_producto
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
nutrapharm_producto
Commits
5dd428bf
Commit
5dd428bf
authored
May 28, 2020
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actualizacion
parent
9d6265eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
98 deletions
+94
-98
app/Resources/views/producto/landing_producto.html.twig
app/Resources/views/producto/landing_producto.html.twig
+94
-96
src/NutrapharmBundle/Controller/DefaultController.php
src/NutrapharmBundle/Controller/DefaultController.php
+0
-2
No files found.
app/Resources/views/producto/landing_producto.html.twig
View file @
5dd428bf
{%
extends
'base.html.twig'
%}
{%
extends
'base.html.twig'
%}
{%
block
head
%}
{%
block
head
%}
{%
if
idp
==
"none"
and
fa
==
1
%}
{%
if
idp
==
"none"
and
fa
==
1
%}
<meta
property=
"fb:app_id"
content=
"270251791049405"
/>
<meta
property=
"fb:app_id"
content=
"270251791049405"
/>
<meta
property=
"og:url"
content=
"https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
{{
fa
}}
&r=0"
/>
<meta
property=
"og:url"
content=
"https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
{{
fa
}}
&r=0"
/>
<meta
property=
"og:type"
content=
"website"
/>
<meta
property=
"og:type"
content=
"website"
/>
...
@@ -10,23 +10,23 @@
...
@@ -10,23 +10,23 @@
<meta
property=
"og:image:width"
content=
"1200"
/>
<meta
property=
"og:image:width"
content=
"1200"
/>
<meta
property=
"og:image:height"
content=
"630"
/>
<meta
property=
"og:image:height"
content=
"630"
/>
<meta
property=
"og:image"
content=
"https://www.nutrapharmsa.com/imagenes/template/logo.png"
/>
<meta
property=
"og:image"
content=
"https://www.nutrapharmsa.com/imagenes/template/logo.png"
/>
{%
elseif
idp
!=
"none"
%}
{%
elseif
idp
!=
"none"
and
fa
==
0
%}
<meta
property=
"fb:app_id"
content=
"270251791049405"
/>
<meta
property=
"fb:app_id"
content=
"270251791049405"
/>
<meta
property=
"og:url"
content=
"https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
1
&r=0"
/>
<meta
property=
"og:url"
content=
"https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
{{
fa
}}
&r=0"
/>
<meta
property=
"og:type"
content=
"website"
/>
<meta
property=
"og:type"
content=
"website"
/>
<meta
property=
"og:title"
content=
"NutraPharm Comparacion Foto"
/>
<meta
property=
"og:title"
content=
"NutraPharm Comparacion Foto"
/>
<meta
property=
"og:description"
content=
"Producto Nutrapharm - Foto "
/>
<meta
property=
"og:description"
content=
"Producto Nutrapharm - Foto "
/>
<meta
property=
"og:image:width"
content=
"1200"
/>
<meta
property=
"og:image:width"
content=
"1200"
/>
<meta
property=
"og:image:height"
content=
"630"
/>
<meta
property=
"og:image:height"
content=
"630"
/>
<meta
property=
"og:image"
content=
"https://test-inovage.gearlabs.cl/uploads/users/
{{
idp
}}
.
{{
extInicial
}}
"
/>
<meta
property=
"og:image"
content=
"https://test-inovage.gearlabs.cl/uploads/users/
{{
idp
}}
.
{{
extInicial
}}
"
/>
{%
endif
%}
{%
endif
%}
<link
href=
"
{{
asset
(
'frontend/css/camara.css'
)
}}
"
rel=
"stylesheet"
/>
<link
href=
"
{{
asset
(
'frontend/css/camara.css'
)
}}
"
rel=
"stylesheet"
/>
{%
endblock
%}
{%
endblock
%}
{%
block
body
%}
{%
block
body
%}
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
{%
if
idp
==
"none"
and
fa
==
1
%}
{%
if
idp
==
"none"
and
fa
==
1
and
r
==
0
%}
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-md-3 control-label"
>
Nombre
</label>
<label
class=
"col-md-3 control-label"
>
Nombre
</label>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
{%
else
%}
{%
else
if
idp
!=
"none"
and
fa
==
0
and
r
==
1
%}
<label>
Foto Subida antes
</label>
<label>
Foto Subida antes
</label>
<img
src=
"https://test-inovage.gearlabs.cl/nutrapharm/get/photo?file_name=
{{
idp
}}
.
{{
extInicial
}}
"
/>
<img
src=
"https://test-inovage.gearlabs.cl/nutrapharm/get/photo?file_name=
{{
idp
}}
.
{{
extInicial
}}
"
/>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
@@ -90,32 +90,37 @@
...
@@ -90,32 +90,37 @@
</div>
</div>
</div>
</div>
<div
class=
"row"
>
{%
if
idp
==
"none"
and
fa
==
1
%}
<div
class=
"form-group"
>
<div
class=
"row"
>
<button
id=
"btnGuardar"
>
Guardar
</button>
<div
class=
"form-group"
>
<button
id=
"btnGuardar"
>
Guardar
</button>
</div>
</div>
</div>
<div
id=
"mensajeFormulario"
></div>
</div>
<span>
RELLENA TUS DATOS Y SUBE TU FOTO
</span>
<div
id=
"mensajeFormulario"
></div>
{%
else
%}
<span>
RELLENA TUS DATOS Y SUBE TU FOTO
</span>
<div
id=
"shareButtonContainer"
style=
"display:none"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<button
id=
"buttonShare"
class=
"btn"
>
Compartir
</button>
<button
id=
"buttonShare"
class=
"btn"
>
Compartir
En Facebook
</button>
</div>
</div>
{%
endif
%}
</div>
{%
endblock
%}
{%
endblock
%}
{%
block
javascripts
%}
{%
block
javascripts
%}
<script
src=
"
{{
asset
(
'frontend/js/capture.js'
)
}}
"
></script>
<script
src=
"
{{
asset
(
'frontend/js/capture.js'
)
}}
"
></script>
<script>
<script>
var
imagenSubida
=
false
;
var
imagenSubida
=
false
;
var
imagenTomada
=
false
;
var
imagenTomada
=
false
;
var
tipoUsuarioFormulario
=
1
;
//Por defecto
{%
if
idp
!=
"none"
and
fa
==
0
and
r
==
1
%}
var
usuarioNutraPharm
=
null
;
//por defecto
var
tipoUsuarioFormulario
=
3
;
//Segunda vez que entra por link de invitacion
{%
else
%}
var
tipoUsuarioFormulario
=
1
;
{%
endif
%}
var
usuarioNutraPharm
=
{{
idp
}}
;
//por defecto
var
upload
;
</script>
</script>
<script>
<script>
var
url
=
'
https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
{{
fa
}}
'
;
var
url
=
'
https://test-inovage.gearlabs.cl/nutrapharm/index?idp=
{{
idp
}}
&fa=
{{
fa
}}
&r=0
'
;
var
description
=
$
(
"
#comentarioFotoUsuario
"
).
val
();
var
description
=
$
(
"
#comentarioFotoUsuario
"
).
val
();
</script>
</script>
<script>
<script>
(
function
(
d
,
s
,
id
)
{
(
function
(
d
,
s
,
id
)
{
...
@@ -164,6 +169,8 @@
...
@@ -164,6 +169,8 @@
console
.
log
(
"
mostrando tomar foto...
"
);
console
.
log
(
"
mostrando tomar foto...
"
);
$
(
"
#tomarFotoContainer
"
).
show
();
$
(
"
#tomarFotoContainer
"
).
show
();
$
(
"
#subirFotoContainer
"
).
hide
();
$
(
"
#subirFotoContainer
"
).
hide
();
imagenTomada
=
false
;
imagenTomada
=
true
;
}
}
function
mostrarSubirFoto
(
event
)
{
function
mostrarSubirFoto
(
event
)
{
...
@@ -171,6 +178,8 @@
...
@@ -171,6 +178,8 @@
console
.
log
(
"
mostrando subir foto...
"
);
console
.
log
(
"
mostrando subir foto...
"
);
$
(
"
#tomarFotoContainer
"
).
hide
();
$
(
"
#tomarFotoContainer
"
).
hide
();
$
(
"
#subirFotoContainer
"
).
show
();
$
(
"
#subirFotoContainer
"
).
show
();
imagenTomada
=
false
;
imagenSubida
=
true
;
}
}
...
@@ -190,8 +199,6 @@
...
@@ -190,8 +199,6 @@
});
});
</script>
</script>
<script>
<script>
var
upload
;
var
Upload
=
function
(
file
)
{
var
Upload
=
function
(
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
};
};
...
@@ -213,96 +220,87 @@
...
@@ -213,96 +220,87 @@
var
formData
=
new
FormData
();
var
formData
=
new
FormData
();
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
true
);
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
true
);
if
(
imagenTomada
==
true
&&
imagenSubida
==
false
){
formData
.
append
(
"
upload_file
"
,
false
);
}
else
if
(
imagenSubida
==
true
&&
imagenTomada
==
true
){
formData
.
append
(
"
upload_file
"
,
true
);
}
console
.
log
(
this
.
file
);
console
.
log
(
this
.
file
);
if
(
this
.
file
!=
null
)
{
if
(
this
.
file
!=
null
)
{
formData
.
append
(
"
imagen
"
,
this
.
file
,
this
.
getName
());
formData
.
append
(
"
imagen
"
,
this
.
file
,
this
.
getName
());
}
}
{%
if
idp
==
"none"
and
fa
==
1
%}
{%
if
idp
==
"none"
and
fa
==
1
and
r
==
0
%}
formData
.
append
(
"
nombreUsuario
"
,
$
(
"
#nombreUsuario
"
).
val
());
formData
.
append
(
"
nombreUsuario
"
,
$
(
"
#nombreUsuario
"
).
val
());
formData
.
append
(
"
mailUsuario
"
,
$
(
"
#mailUsuario
"
).
val
());
formData
.
append
(
"
mailUsuario
"
,
$
(
"
#mailUsuario
"
).
val
());
formData
.
append
(
"
comentarioFotoUsuario
"
,
$
(
"
#comentarioFotoUsuario
"
).
val
());
formData
.
append
(
"
comentarioFotoUsuario
"
,
$
(
"
#comentarioFotoUsuario
"
).
val
());
formData
.
append
(
"
tipoUsuarioFormulario
"
,
tipoUsuarioFormulario
);
formData
.
append
(
"
tipoUsuarioFormulario
"
,
tipoUsuarioFormulario
);
formData
.
append
(
"
usuarioNutraPharm
"
,
usuarioNutraPharm
);
formData
.
append
(
"
usuarioNutraPharm
"
,
usuarioNutraPharm
);
formData
.
append
(
"
upload_file
"
,
true
);
{%
elseif
idp
!=
"none"
and
fa
==
0
%}
{%
elseif
idp
!=
"none"
and
fa
==
0
and
r
==
1
%}
formData
.
append
(
"
usuarioNutraPharm
"
,
"
{{
idp
}}
"
);
formData
.
append
(
"
usuarioNutraPharm
"
,
"
{{
idp
}}
"
);
formData
.
append
(
"
comentarioFotoUsuario
"
,
$
(
"
#comentarioFotoUsuario
"
).
val
());
formData
.
append
(
"
comentarioFotoUsuario
"
,
$
(
"
#comentarioFotoUsuario
"
).
val
());
formData
.
append
(
"
usuarioNutraPharm
"
,
usuarioNutraPharm
);
formData
.
append
(
"
usuarioNutraPharm
"
,
usuarioNutraPharm
);
formData
.
append
(
"
upload_file
"
,
true
);
formData
.
append
(
"
tipoUsuarioFormulario
"
,
tipoUsuarioFormulario
);
{%
endif
%}
{%
endif
%}
$
.
ajax
$
.
ajax
({
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
url
,
url
:
url
,
data
:
formData
,
data
:
formData
,
async
:
true
,
async
:
true
,
cache
:
false
,
cache
:
false
,
contentType
:
false
,
contentType
:
false
,
processData
:
false
,
processData
:
false
,
timeout
:
60000
,
timeout
:
60000
,
statusCode
:
{
statusCode
:
{
400
:
function
(
respuesta
)
{
400
:
function
(
respuesta
)
{
console
.
log
(
respuesta
.
responseText
);
console
.
log
(
respuesta
.
responseText
);
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
},
500
:
function
(
respuesta
)
{
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
}
},
},
500
:
function
(
respuesta
)
{
success
:
function
(
data
)
{
console
.
log
(
data
);
console
.
log
(
"
Guardado
"
);
{%
if
idp
!=
"none"
and
fa
==
0
%}
$
(
"
#shareButtonContainer
"
).
show
();
{%
endif
%}
$
(
"
#mensajeFormulario
"
).
html
(
"
Datos Guardados y/o Actualizados!!
"
);
},
complete
:
function
(
data
)
{
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
}
}
},
});
success
:
function
(
data
)
{
};
console
.
log
(
data
);
console
.
log
(
"
Guardado
"
);
{%
if
idp
!=
"none"
and
fa
==
0
%}
$
(
"
#shareButtonContainer
"
).
show
();
{%
endif
%}
$
(
"
#mensajeFormulario
"
).
html
(
"
Datos Gaudados y/o Actualizados!!
"
);
},
complete
:
function
(
data
)
{
$
(
"
#btnGuardar
"
).
prop
(
"
disabled
"
,
false
);
}
});
};
$
(
"
#btnGuardarComparacion
"
).
click
(
function
(
e
)
{
e
.
preventDefault
();
if
(
imagenSubida
==
true
)
{
}
if
(
typeof
upload
==
"
undefined
"
)
{
upload
=
new
Upload
(
null
);
}
upload
.
doUpload
();
});
$
(
"
#btnGuardar
"
).
click
(
function
(
e
)
{
e
.
preventDefault
();
$
(
"
#btnGuardar
"
).
click
(
function
(
e
)
{
if
(
imagenSubida
==
false
&&
imagenTomada
==
false
)
{
e
.
preventDefault
();
$
(
"
#mensajeFormulario
"
).
html
(
"
Debe seleccionar o tomar una imagen!
"
);
return
false
;
if
(
imagenSubida
==
true
)
{
}
}
if
(
typeof
upload
==
"
undefined
"
)
{
if
(
typeof
upload
==
"
undefined
"
)
{
upload
=
new
Upload
(
null
);
upload
=
new
Upload
(
null
);
}
}
upload
.
doUpload
();
upload
.
doUpload
();
});
});
$
(
"
#imgInp
"
).
on
(
"
change
"
,
function
(
e
)
{
$
(
"
#imgInp
"
).
on
(
"
change
"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
if
(
$
(
this
)[
0
].
files
.
length
!=
0
)
{
if
(
$
(
this
)[
0
].
files
.
length
!=
0
)
{
var
file
=
$
(
this
)[
0
].
files
[
0
];
var
file
=
$
(
this
)[
0
].
files
[
0
];
upload
=
new
Upload
(
file
);
upload
=
new
Upload
(
file
);
console
.
log
(
upload
)
console
.
log
(
upload
)
imagenSubida
=
true
;
imagenSubida
=
true
;
}
else
}
else
upload
=
new
Upload
(
null
);
upload
=
new
Upload
(
null
);
});
});
</script>
</script>
{%
endblock
%}
{%
endblock
%}
src/NutrapharmBundle/Controller/DefaultController.php
View file @
5dd428bf
...
@@ -35,8 +35,6 @@ class DefaultController extends Controller {
...
@@ -35,8 +35,6 @@ class DefaultController extends Controller {
$id
=
"none"
;
$id
=
"none"
;
$ext
=
"png"
;
$ext
=
"png"
;
$firstAttempt
=
1
;
$firstAttempt
=
1
;
}
else
if
(
$idPersona
!=
null
&&
$firstAttempt
!=
0
){
return
$this
->
redirect
(
$this
->
generateUrl
(
'nutrapharm_homepage'
,
array
(
"idp"
=>
$id
,
"fa"
=>
$firstAttempt
)),
301
);
}
}
else
{
else
{
$id
=
$idPersona
;
$id
=
$idPersona
;
...
...
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