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
35e508a3
Commit
35e508a3
authored
Aug 16, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nuevo sistema de busqueda
parent
8e0e1163
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
95 deletions
+197
-95
conexion.php
conexion.php
+2
-2
getData.php
getData.php
+61
-0
ownStyle.css
ownStyle.css
+3
-3
readEscuelas.php
readEscuelas.php
+94
-88
script.js
script.js
+37
-2
No files found.
conexion.php
View file @
35e508a3
<?php
<?php
$servername
=
"localhost"
;
$servername
=
"localhost"
;
$username
=
"sec_user"
;
$username
=
"sec_user"
;
//
$username = "root";
$username
=
"root"
;
$password
=
"5Qn6g2je6WkF7FX6CcBhAzUf"
;
$password
=
"5Qn6g2je6WkF7FX6CcBhAzUf"
;
//
$password = "PkJXPQFykKLmS3cWhqmZKNYE";
$password
=
"PkJXPQFykKLmS3cWhqmZKNYE"
;
$dbname
=
"Escuelas"
;
$dbname
=
"Escuelas"
;
// Create connection
// Create connection
...
...
getData.php
0 → 100644
View file @
35e508a3
<?php
include
'conexion.php'
;
$sql
=
'SELECT * FROM Inicial WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"C_NOM_LOC"
];
}
}
else
{
$sql
=
'SELECT * FROM Preescolar WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"C_NOM_LOC"
];
}
}
else
{
$sql
=
'SELECT * FROM Primaria WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"C_NOM_LOC"
];
}
}
else
{
$sql
=
'SELECT * FROM Secundaria WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"C_NOM_LOC"
];
}
}
else
{
$sql
=
'SELECT * FROM Media WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"LOCALIDAD"
];
}
}
else
{
$sql
=
'SELECT * FROM Superior WHERE CV_CCT ="'
.
$_POST
[
'clave'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
foreach
(
$result
as
$escuela
)
{
echo
$escuela
[
"CV_CCT"
]
.
','
.
$escuela
[
'NOMBRECT'
]
.
','
.
$escuela
[
"LOCALIDAD"
];
}
}
else
{
echo
"0"
;
}
}
}
}
}
}
$conn
->
close
();
ownStyle.css
View file @
35e508a3
...
@@ -319,6 +319,6 @@ input[type=number]::-webkit-outer-spin-button {
...
@@ -319,6 +319,6 @@ input[type=number]::-webkit-outer-spin-button {
-webkit-overflow-scrolling
:
touch
;
-webkit-overflow-scrolling
:
touch
;
}
}
#
country
-list
{
list-style
:
none
;
z-index
:
1
;
position
:
absolute
;
max-height
:
10px
;}
#
escuelas
-list
{
list-style
:
none
;
z-index
:
1
;
position
:
absolute
;
max-height
:
10px
;}
#
country
-list
li
{
padding
:
10px
;
background
:
#f0f0f0
;
border-bottom
:
#bbb9b9
1px
solid
;}
#
escuelas
-list
li
{
padding
:
10px
;
background
:
#f0f0f0
;
border-bottom
:
#bbb9b9
1px
solid
;}
#
country
-list
li
:hover
{
background
:
#ece3d2
;
cursor
:
pointer
;}
#
escuelas
-list
li
:hover
{
background
:
#ece3d2
;
cursor
:
pointer
;}
readEscuelas.php
View file @
35e508a3
<?php
<?php
include
"conexion.php"
;
include
"conexion.php"
;
if
(
!
empty
(
$_POST
[
"keyword"
]))
{
?>
if
(
!
empty
(
$_POST
[
"keyword"
]))
{
?>
<ul
id=
"country-list"
class=
"col-md-12 pull-right dropdown"
>
<ul
id=
"escuelas-list"
class=
"col-md-12 pull-right dropdown"
>
<?php
<?php
$sql
=
'SELECT * FROM Inicial WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" LIMIT 0,6'
;
$sql
=
'SELECT * FROM Inicial WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" LIMIT 0,6'
;
$result
=
$conn
->
query
(
$sql
);
$result
=
$conn
->
query
(
$sql
);
if
(
!
empty
(
$result
))
{
if
(
!
empty
(
$result
))
{
foreach
(
$result
as
$escuela
)
{
?>
foreach
(
$result
as
$escuela
)
{
?>
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"
>
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"-->
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
</li>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<?php
}
</li>
}
?>
<?php
}
}
?>
<?php
$sql
=
'SELECT * FROM Preescolar WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
<?php
$result
=
$conn
->
query
(
$sql
);
$sql
=
'SELECT * FROM Preescolar WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
if
(
!
empty
(
$result
))
{
$result
=
$conn
->
query
(
$sql
);
foreach
(
$result
as
$escuela
)
{
?>
if
(
!
empty
(
$result
))
{
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"
>
foreach
(
$result
as
$escuela
)
{
?>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"-->
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
</li>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<?php
}
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
}
?>
</li>
<?php
}
<?php
}
?>
$sql
=
'SELECT * FROM Primaria WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
$result
=
$conn
->
query
(
$sql
);
<?php
if
(
!
empty
(
$result
))
{
$sql
=
'SELECT * FROM Primaria WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
foreach
(
$result
as
$escuela
)
{
?>
$result
=
$conn
->
query
(
$sql
);
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"
>
if
(
!
empty
(
$result
))
{
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
foreach
(
$result
as
$escuela
)
{
?>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"-->
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
</li>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
<?php
}
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
}
?>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
</li>
<?php
<?php
}
$sql
=
'SELECT * FROM Secundaria WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
}
?>
$result
=
$conn
->
query
(
$sql
);
if
(
!
empty
(
$result
))
{
<?php
foreach
(
$result
as
$escuela
)
{
?>
$sql
=
'SELECT * FROM Secundaria WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"
>
$result
=
$conn
->
query
(
$sql
);
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
if
(
!
empty
(
$result
))
{
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
foreach
(
$result
as
$escuela
)
{
?>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"C_NOM_LOC"
];
?>
');"-->
</li>
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
<?php
}
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
}
?>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<?php
echo
"Localidad: "
.
$escuela
[
"C_NOM_LOC"
];
?>
<?php
</li>
$sql
=
'SELECT * FROM Media WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
<?php
}
$result
=
$conn
->
query
(
$sql
);
}
?>
if
(
!
empty
(
$result
))
{
foreach
(
$result
as
$escuela
)
{
?>
<?php
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"LOCALIDAD"
];
?>
');"
>
$sql
=
'SELECT * FROM Media WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
$result
=
$conn
->
query
(
$sql
);
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
if
(
!
empty
(
$result
))
{
<?php
echo
"Localidad: "
.
$escuela
[
"LOCALIDAD"
];
?>
foreach
(
$result
as
$escuela
)
{
?>
</li>
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"LOCALIDAD"
];
?>
');"-->
<?php
}
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
}
?>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<?php
<?php
echo
"Localidad: "
.
$escuela
[
"LOCALIDAD"
];
?>
$sql
=
'SELECT * FROM Superior WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
</li>
$result
=
$conn
->
query
(
$sql
);
<?php
}
if
(
!
empty
(
$result
))
{
}
?>
foreach
(
$result
as
$escuela
)
{
?>
<li
onClick=
"selectCountry('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"LOCALIDAD"
];
?>
');"
>
<?php
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
$sql
=
'SELECT * FROM Superior WHERE CV_CCT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%" OR NOMBRECT LIKE "%'
.
$_POST
[
'keyword'
]
.
'%"'
;
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
$result
=
$conn
->
query
(
$sql
);
<?php
echo
"Localidad: "
.
$escuela
[
"LOCALIDAD"
];
?>
if
(
!
empty
(
$result
))
{
</li>
foreach
(
$result
as
$escuela
)
{
?>
<?php
}
<!--li onClick="selectClave('
<?php
echo
$escuela
[
"NOMBRECT"
];
?>
','
<?php
echo
$escuela
[
"CV_CCT"
];
?>
','
<?php
echo
$escuela
[
"LOCALIDAD"
];
?>
');"-->
}
?>
<li
onClick=
"selectClave('
<?php
echo
$escuela
[
"CV_CCT"
];
?>
');"
>
<?php
echo
"Escuela: "
.
$escuela
[
"NOMBRECT"
]
.
"<br>"
;
?>
</ul>
<?php
echo
"Clave: "
.
$escuela
[
"CV_CCT"
]
.
"<br>"
;
?>
<?php
}
<?php
echo
"Localidad: "
.
$escuela
[
"LOCALIDAD"
];
?>
?>
</li>
<?php
}
}
?>
</ul>
<?php
}
?>
script.js
View file @
35e508a3
...
@@ -17,7 +17,42 @@ $(document).ready(function () {
...
@@ -17,7 +17,42 @@ $(document).ready(function () {
});
});
});
});
function
selectCountry
(
val
,
clave
,
localidad
)
{
function
selectClave
(
clave
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
"getData.php"
,
data
:
'clave='
+
clave
,
success
:
function
(
data
)
{
var
array
=
data
.
split
(
','
);
$
(
'#nombre_escuela'
).
empty
();
$
(
'#clave'
).
empty
();
$
(
'#titulo1'
).
empty
();
$
(
'#titulo2'
).
empty
();
$
(
"#search-box"
).
val
(
array
[
1
]);
$
(
'#suggesstion-box'
).
empty
();
$
(
"#suggesstion-box"
).
hide
();
$
(
'#clave_escuela'
).
val
(
array
[
0
]);
$
(
'#nombre_escuela'
).
append
(
''
+
$
(
'#search-box'
).
val
());
$
(
'#titulo1'
).
append
(
'<h1><b>Escuela: </b></h1>'
);
$
(
'#titulo2'
).
append
(
'<h3><b>Localidad:</b> '
+
array
[
2
]
+
'</h3>'
);
$
(
'#clave'
).
append
(
'<h3><b>Clave:</b> '
+
array
[
0
]
+
'</h3>'
);
$
(
'#search-div'
).
hide
();
$
(
'#clear'
).
show
();
$
(
'#next'
).
show
();
$
(
'#next'
).
focus
();
}
});
}
/*
function selectClave(val,clave,localidad) {
$('#nombre_escuela').empty();
$('#nombre_escuela').empty();
$('#clave').empty();
$('#clave').empty();
...
@@ -41,7 +76,7 @@ function selectCountry(val,clave,localidad) {
...
@@ -41,7 +76,7 @@ function selectCountry(val,clave,localidad) {
$('#next').focus();
$('#next').focus();
}
}
*/
function
selClear
()
{
function
selClear
()
{
$
(
'#nombre_escuela'
).
empty
();
$
(
'#nombre_escuela'
).
empty
();
...
...
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