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
a3bbfe3d
Commit
a3bbfe3d
authored
Aug 27, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nuevo sistema de busqueda
parent
c8387b85
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
58 deletions
+35
-58
encuesta.php
encuesta.php
+1
-0
index.php
index.php
+2
-2
insertar.php
insertar.php
+2
-2
lenguaje.php
lenguaje.php
+26
-52
salida.php
salida.php
+3
-2
script.js
script.js
+1
-0
No files found.
encuesta.php
View file @
a3bbfe3d
...
...
@@ -59,6 +59,7 @@ session_start();
<form
action=
"insertar.php"
method=
"post"
>
<input
type=
"hidden"
name=
"escuela"
value=
"
<?=
$_SESSION
[
"escuela"
]
?>
"
>
<input
type=
"hidden"
name=
"idioma"
value=
"
<?=
$_POST
[
'idioma'
];
?>
"
>
<input
type=
"hidden"
name=
"clave_escuela"
value=
"
<?=
$_POST
[
'clave_escuela'
];
?>
"
>
<div
class=
"input-group mb-3"
>
<div
class=
"input-group-append"
>
<span
class=
"input-group-text"
><i
class=
"fas fa-user"
></i></span>
...
...
index.php
View file @
a3bbfe3d
...
...
@@ -52,14 +52,14 @@
</div>
<div
class=
" justify-content-center container form_container"
>
<form
method=
"
pos
t"
action=
"lenguaje.php"
>
<form
method=
"
ge
t"
action=
"lenguaje.php"
>
<div
class=
"input-group"
id=
"search-div"
>
<div
class=
"input-group-append"
>
<span
class=
"input-group-text"
><i
class=
"fas fa-search"
></i></span>
</div>
<input
type=
"text"
autocomplete=
"off"
name=
"escuela"
id=
"search-box"
<input
type=
"text"
autocomplete=
"off"
id=
"search-box"
class=
"form-control col-md-12 custom-select"
value=
""
placeholder=
"Seleccione la clave o nombre de su escuela"
required
"
>
<input
type=
"hidden"
name=
"clave_escuela"
id=
"clave_escuela"
>
...
...
insertar.php
View file @
a3bbfe3d
...
...
@@ -16,7 +16,7 @@ $nombre = str_replace("'","''",$_POST['nombre']);
$comentario
=
str_replace
(
"'"
,
"''"
,
$_POST
[
'comentario'
]);
$edad
=
(
int
)
preg_replace
(
"/[^0-9]/"
,
''
,
$_POST
[
'edad'
]);
$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'
]
.
"','"
.
$nombre
.
"',"
.
$edad
.
",'"
.
$comentario
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
$sql
=
"INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'"
.
$_
POST
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$nombre
.
"',"
.
$edad
.
",'"
.
$comentario
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
echo
"New record created successfully"
;
...
...
@@ -28,6 +28,6 @@ $conn->close();
header
(
'Location: salida.php?idioma='
.
$_POST
[
'idioma'
]);
header
(
'Location: salida.php?idioma='
.
$_POST
[
'idioma'
]
.
"&clave_escuela="
.
$_POST
[
'clave_escuela'
]
);
exit
;
?>
lenguaje.php
View file @
a3bbfe3d
...
...
@@ -6,58 +6,30 @@
session_start
();
include
"conexion.php"
;
if
(
isset
(
$_POST
[
'clave_escuela'
]))
{
$_SESSION
[
"escuela"
]
=
$_POST
[
'escuela'
];
$_SESSION
[
"clave_escuela"
]
=
$_POST
[
'clave_escuela'
];
$_SESSION
[
"latitude"
]
=
""
;
$_SESSION
[
"longitude"
]
=
""
;
}
$sql
=
'SELECT * FROM Inicial WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$nombre_escuela
=
""
;
$clave_escuela
=
""
;
$sql
=
"SELECT e.NOMBRECT, e.CV_CCT FROM Superior e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT
UNION
SELECT e.NOMBRECT, e.CV_CCT FROM Media e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT
UNION
SELECT e.NOMBRECT, e.CV_CCT FROM Inicial e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT
UNION
SELECT e.NOMBRECT, e.CV_CCT FROM Preescolar e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT
UNION
SELECT e.NOMBRECT, e.CV_CCT FROM Primaria e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT
UNION
SELECT e.NOMBRECT, e.CV_CCT FROM Secundaria e WHERE e.CV_CCT ='"
.
$_GET
[
'clave_escuela'
]
.
"' GROUP BY e.CV_CCT"
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
while
(
$row
=
$result
->
fetch_assoc
())
{
$nombre_escuela
=
$row
[
'NOMBRECT'
];
$clave_escuela
=
$row
[
'CV_CCT'
];
$_SESSION
[
'clave_escuela'
]
=
$row
[
'CV_CCT'
];
}
}
else
{
$sql
=
'SELECT * FROM Preescolar WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
}
else
{
$sql
=
'SELECT * FROM Primaria WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
}
else
{
$sql
=
'SELECT * FROM Secundaria WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
}
else
{
$sql
=
'SELECT * FROM Media WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
}
else
{
$sql
=
'SELECT * FROM Superior WHERE CV_CCT ="'
.
$_SESSION
[
'clave_escuela'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
}
else
{
header
(
"location: index.php?err=1"
);
mysql_close
();
}
}
}
}
}
}
?>
<!DOCTYPE html>
<html>
...
...
@@ -113,12 +85,12 @@ if ($result->num_rows > 0) {
<form
action=
"encuesta.php"
method=
"post"
>
<input
type=
"hidden"
name=
"escuela"
value=
"
<?=
$
_SESSION
[
"escuela"
]
?>
"
>
<input
type=
"hidden"
name=
"escuela"
value=
"
<?=
$
nombre_escuela
?>
"
>
<input
type=
"hidden"
name=
"clave_escuela"
value=
"
<?=
$clave_escuela
;
?>
"
>
<div
class=
"mt-4 text-center"
style=
"margin-top: -20px!important; color: white;"
>
<b>
<h1>
Escuela:
</h1>
<h2
style=
"font-size: 25px;"
>
<?=
$
_SESSION
[
"escuela"
]
?>
</h2>
<h2
style=
"font-size: 25px;"
>
<?=
$
nombre_escuela
?>
</h2>
<div
class=
"d-flex justify-content-center links"
style=
"margin-top: 100px!important;"
>
<b>
¿EN QUÉ LENGUAJE DESEA CONTESTAR?
<br>
...
...
@@ -129,7 +101,9 @@ if ($result->num_rows > 0) {
<div
class=
"d-flex justify-content-center mt-3 login_container"
>
<div
class=
"col-md-6"
>
<button
id=
"bespa"
type=
"submit"
name=
"idioma"
value=
"Español"
class=
"btn login_btn"
>
Español
</button>
<button
id=
"bespa"
type=
"submit"
name=
"idioma"
value=
"Español"
class=
"btn login_btn"
>
Español
</button>
</div>
<div
class=
"col-md-6"
>
<button
type=
"submit"
name=
"idioma"
value=
"Maya"
class=
"btn login_btn"
>
Maya
</button>
...
...
salida.php
View file @
a3bbfe3d
<!--
/* Coded by Ing. Ulises Morales Ramirez */
-->
<?php
session_start
();
?>
<!DOCTYPE html>
<html>
...
...
@@ -99,8 +99,9 @@
</div>
<script>
function
redireccion
()
{
var
clave_escuela
=
"
<?php
echo
$_GET
[
'clave_escuela'
];
?>
"
;
setTimeout
(
function
()
{
window
.
location
.
replace
(
"lenguaje.php
"
);
window
.
location
.
replace
(
"lenguaje.php
?clave_escuela="
+
clave_escuela
);
},
2000
);
}
</script>
...
...
script.js
View file @
a3bbfe3d
...
...
@@ -13,6 +13,7 @@ $(document).ready(function () {
$
(
"#search-box"
).
css
(
"background"
,
"#FFF"
);
}
});
});
});
...
...
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