Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Formulario de paz
Project
Project
Details
Activity
Releases
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
Ulises Morales Ramírez
Formulario de paz
Commits
2cc34534
Commit
2cc34534
authored
Aug 09, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modificaciones:
responsivo no permita ingresar escuelas inexistentes
parent
25741ea1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
Escuelas.sql
Escuelas.sql
+4
-2
index.php
index.php
+17
-2
insertar.php
insertar.php
+2
-1
lenguaje.php
lenguaje.php
+2
-0
No files found.
Escuelas.sql
View file @
2cc34534
...
...
@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 09-08-2019 a las 14:
05:58
-- Tiempo de generación: 09-08-2019 a las 14:
34:27
-- Versión del servidor: 5.7.27-0ubuntu0.18.04.1
-- Versión de PHP: 7.2.19-0ubuntu0.18.04.1
...
...
@@ -3453,7 +3453,9 @@ CREATE TABLE `respuesta` (
`comentario`
varchar
(
250
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`fecha`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`REMOTE_ADDR`
varchar
(
300
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`HTTP_USER_AGENT`
varchar
(
300
)
COLLATE
utf8_unicode_ci
NOT
NULL
`HTTP_USER_AGENT`
varchar
(
300
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`latitude`
varchar
(
250
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`longitude`
varchar
(
250
)
COLLATE
utf8_unicode_ci
NOT
NULL
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
;
-- --------------------------------------------------------
...
...
index.php
View file @
2cc34534
...
...
@@ -51,7 +51,7 @@ $conn->close();*/
</head>
<body>
<body
onload=
"getLocation()"
>
<!--div class="text-center" style="z-index: -1"><img src="images/header.png" width="800px"></div-->
<div
class=
"ripple-background"
>
...
...
@@ -90,6 +90,8 @@ $conn->close();*/
class=
"form-control custom-select"
value=
""
placeholder=
"Seleccione la clave o nombre de su escuela"
required
"
>
<input
type=
"hidden"
name=
"clave_escuela"
id=
"clave_escuela"
>
<input
type=
"hidden"
name=
"latitude"
id=
"latitude"
>
<input
type=
"hidden"
name=
"longitude"
id=
"longitude"
>
</div>
<datalist
id=
"Escuelas"
>
...
...
@@ -125,7 +127,7 @@ $conn->close();*/
</div>
<div
class=
"mt-4"
>
<div
class=
"d-flex text-center justify-content-center links"
>
<h1
id=
"nombre_escuela"
></h1>
<h1
id=
"nombre_escuela"
></h1>
</div>
</div>
<div
class=
"mt-4"
>
...
...
@@ -210,6 +212,19 @@ $conn->close();*/
return
flag
;
}
function
getLocation
()
{
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
showPosition
);
}
else
{
x
.
innerHTML
=
"Geolocation is not supported by this browser."
;
}
}
function
showPosition
(
position
)
{
$
(
"#latitude"
).
val
(
position
.
coords
.
latitude
);
$
(
"#longitude"
).
val
(
position
.
coords
.
longitude
);
}
</script>
</body>
...
...
insertar.php
View file @
2cc34534
...
...
@@ -13,7 +13,7 @@ echo $_POST['edad'];
echo
$_POST
[
'comentario'
];
//$sql = "INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`) VALUES (null ,".$_SESSION['clave_escuela'].",,,,)";
$sql
=
"INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`
) VALUES (null ,'"
.
$_SESSION
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$_POST
[
'nombre'
]
.
"',"
.
$_POST
[
'edad'
]
.
",'"
.
$_POST
[
'comentario'
]
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"')"
;
$sql
=
"INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`
, `latitude`, `longitude`) VALUES (null ,'"
.
$_SESSION
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$_POST
[
'nombre'
]
.
"',"
.
$_POST
[
'edad'
]
.
",'"
.
$_POST
[
'comentario'
]
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
echo
"New record created successfully"
;
...
...
@@ -24,6 +24,7 @@ if ($conn->query($sql) === TRUE) {
$conn
->
close
();
/* Esto producirá un error. Fíjese en el html
* que se muestra antes que la llamada a header() */
header
(
'Location: salida.php?idioma='
.
$_POST
[
'idioma'
]);
...
...
lenguaje.php
View file @
2cc34534
...
...
@@ -11,6 +11,8 @@ if (isset($_POST['escuela'])) {
$_SESSION
[
"escuela"
]
=
$arr
[
0
];
$_SESSION
[
"localidad"
]
=
$arr
[
1
];
$_SESSION
[
"clave_escuela"
]
=
$_POST
[
'clave_escuela'
];
$_SESSION
[
"latitude"
]
=
$_POST
[
'latitude'
];
$_SESSION
[
"longitude"
]
=
$_POST
[
'longitude'
];
}
$sql
=
'SELECT * FROM Inicial WHERE CV_CCT LIKE "'
.
$_SESSION
[
"clave_escuela"
]
.
'" AND NOMBRECT LIKE "'
.
$_SESSION
[
"escuela"
]
.
'"'
;
...
...
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