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
7afc8eba
Commit
7afc8eba
authored
Aug 07, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base de datos
parent
537ed2be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
6 deletions
+63
-6
ajax_post.php
ajax_post.php
+41
-0
index.php
index.php
+22
-6
No files found.
ajax_post.php
0 → 100644
View file @
7afc8eba
<?php
include
'conexion.php'
;
//echo $_POST['dato'];
$sql
=
'SELECT * FROM Preescolar WHERE CV_CCT LIKE "'
.
$_POST
[
'dato'
]
.
'" OR NOMBRECT LIKE "'
.
$_POST
[
'dato'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
echo
"1"
;
}
else
{
$sql
=
'SELECT * FROM Primaria WHERE CV_CCT LIKE "'
.
$_POST
[
'dato'
]
.
'" OR NOMBRECT LIKE "'
.
$_POST
[
'dato'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
echo
"1"
;
}
else
{
$sql
=
'SELECT * FROM Secundaria WHERE CV_CCT LIKE "'
.
$_POST
[
'dato'
]
.
'" OR NOMBRECT LIKE "'
.
$_POST
[
'dato'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
echo
"1"
;
}
else
{
$sql
=
'SELECT * FROM Media WHERE CV_CCT LIKE "'
.
$_POST
[
'dato'
]
.
'" OR NOMBRECT LIKE "'
.
$_POST
[
'dato'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
echo
"1"
;
}
else
{
$sql
=
'SELECT * FROM Superior WHERE CV_CCT LIKE "'
.
$_POST
[
'dato'
]
.
'" OR NOMBRECT LIKE "'
.
$_POST
[
'dato'
]
.
'"'
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
echo
"1"
;
}
else
{
echo
"0"
;
}
}
}
}
}
$conn
->
close
();
\ No newline at end of file
index.php
View file @
7afc8eba
...
...
@@ -85,20 +85,21 @@ $conn->close();*/
<datalist
id=
"Escuelas"
>
<?php
while
(
$row
=
$result1
->
fetch_assoc
())
{
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'
<br>de '
.
utf8_encode
(
$row
[
"C_NOM_LOC"
])
.
'
</option>'
;
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'</option>'
;
//echo '<option value="'.utf8_encode($row["NOMBRECT"]).'">de '.utf8_encode($row["C_NOM_LOC"]).' <br>clave: '.utf8_encode($row["CV_CCT"]).'</option>';
}
while
(
$row
=
$result2
->
fetch_assoc
())
{
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'
<br>de '
.
utf8_encode
(
$row
[
"C_NOM_LOC"
])
.
'
</option>'
;
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'</option>'
;
}
while
(
$row
=
$result3
->
fetch_assoc
())
{
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'
<br>de '
.
utf8_encode
(
$row
[
"C_NOM_LOC"
])
.
'
</option>'
;
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'</option>'
;
}
while
(
$row
=
$result4
->
fetch_assoc
())
{
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'
<br>de '
.
utf8_encode
(
$row
[
"C_NOM_LOC"
])
.
'
</option>'
;
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'</option>'
;
}
while
(
$row
=
$result5
->
fetch_assoc
())
{
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
' <br>de '
.
utf8_encode
(
$row
[
"C_NOM_LOC"
])
.
'</option>'
;
echo
'<option value="'
.
utf8_encode
(
$row
[
"CV_CCT"
])
.
'">'
.
utf8_encode
(
$row
[
"NOMBRECT"
])
.
'</option>'
;
//echo '<option value="'.utf8_encode($row["CV_CCT"]).'">'.utf8_encode($row["NOMBRECT"]).' <br>de '.utf8_encode($row["C_NOM_LOC"]).'</option>';
}
?>
</datalist>
...
...
@@ -114,7 +115,7 @@ $conn->close();*/
<div
class=
"d-flex justify-content-center mt-3 login_container"
>
<button
type=
"submit"
class=
"btn login_btn"
>
Siguiente
</button>
<button
type=
"submit"
id=
"next"
class=
"btn login_btn"
disabled
>
Siguiente
</button>
</div>
</form>
</div>
...
...
@@ -126,6 +127,7 @@ $conn->close();*/
<script>
$
(
"#input_escuela"
).
bind
(
'input'
,
function
()
{
var
dato
=
$
(
'#input_escuela'
).
val
();
$
(
'#clave_escuela'
).
val
(
$
(
'#input_escuela'
).
val
());
document
.
getElementById
(
'clave_escuela'
).
value
=
$
(
'#input_escuela'
).
val
();
var
valor
=
checkExists
(
$
(
'#input_escuela'
).
val
());
...
...
@@ -134,6 +136,20 @@ $conn->close();*/
document
.
getElementById
(
'input_escuela'
).
value
=
valor
;
$
(
'#nombre_escuela'
).
empty
();
$
(
'#nombre_escuela'
).
append
(
valor
);
$
.
post
(
"ajax_post.php"
,
{
dato
:
dato
},
function
(
data
,
status
){
if
(
data
==
"1"
){
$
(
'#next'
).
attr
(
"disabled"
,
false
);
}
else
{
$
(
'#next'
).
attr
(
"disabled"
,
true
);
}
});
});
function
checkExists
(
inputValue
)
{
...
...
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