Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "sesion.php";
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="css/stilo.css" />
- <title>Listado</title>
- <meta name="description" content="">
- <meta name="title" content="Registro de cesiones de Striker Manager">
- <meta charset="utf-8"/>
- </head>
- <body>
- <style>
- .muestro{
- text-decoration:underline;
- cursor:pointer;
- }
- .oculto{
- display:none;
- }
- .visible{
- display:block;
- }
- </style>
- <script type="text-javascript" language="javascript">
- function cogeposiciones(seleccion){
- var posicion=document.getElementById('posicion').value;
- }
- </script>
- <script>
- function mostrar() {
- var formu=document.getElementById("anexo");
- if (formu.className="oculto"){
- formu.className="visible";
- }
- }
- function ocultar() {
- var formu=document.getElementById("anexo");
- if (formu.className="visible"){
- formu.className="oculto";
- }
- }
- </script>
- <?php
- require("conexion.php");
- ?>
- <?php
- if (isset($_GET['posicion'])){
- $posicion=$_GET['posicion'];
- $consulta = mysqli_query($conexion, "SELECT * FROM manager WHERE
- posicion='$posicion'");
- if (mysqli_num_rows($consulta) > 0)
- {
- echo "<p>Listado de {$posicion}</p>";
- echo " <table border='1px solid black'> <tr> <th>id</th> <th>nick</th> <th>posicion</th> <th>Acciones</th></tr> ";
- while($row = mysqli_fetch_array($consulta, MYSQLI_ASSOC))
- {
- $linkid=$row['idmanager'];
- $linknick=$row['nick'];
- $linkpos=$row['posicion'];
- echo "<tr>";
- echo "<td id='getid' name='getid'> ".$row['idmanager']." </td>";
- echo "<td> ".$row['nick']." </td>";
- echo "<td> ".$row['posicion']." </td>";
- echo "<td> <a href='' onclick='mostrar();'>Modificar</a>
- <a href='borrar.php?idmanager=$linkid'>Borrar</a></td>";
- echo "</tr>";
- }
- echo "</table>";
- }
- else
- {
- echo " <p>Aún no hay registros en la base de datos</p>";
- }
- }
- ?>
- <?php
- if (isset($_GET['nick'])){
- $nick=$_GET['nick'];
- $consulta = mysqli_query($conexion, "SELECT * FROM manager WHERE nick LIKE
- '$nick%'");
- if (mysqli_num_rows($consulta) > 0)
- {
- echo "<p>Listado de {$nick}</p>"; //concatenar
- echo " <table border='1px solid black'> <tr> <th>id</th> <th>nick</th> <th>posicion</th> </tr> ";
- while($row = mysqli_fetch_array($consulta, MYSQLI_ASSOC))
- {
- $linkid=$row['idmanager'];
- echo "<tr>";
- echo "<td id='getid' name='getid'> ".$row['idmanager']." </td>";
- echo "<td> ".$row['nick']." </td>";
- echo "<td> ".$row['posicion']." </td>";
- echo "<td> <a class='muestro' onclick='mostrar();'>Modificar</a>
- <a href='borrar.php?idmanager=$linkid'>Borrar</a></td>";
- echo "</tr>";
- }
- echo "</table>";
- }
- else
- {
- echo " <p>Aún no hay registros en la base de datos</p>";
- }
- }
- ?>
- <div class="oculto" id="anexo">
- <label for="nick"><input type="text" name="nick">
- <label for="posicion>
- <select id="posicion" name="posicion" required
- onchange="cogeposiciones()">
- <option value="" disabled selected>Selecciona</option>
- <?php
- $sql_select_pos="SELECT posicion FROM posiciones";
- $ejec_select_pos= mysqli_query($conexion, $sql_select_pos) or
- die("No se pudo realizar el select de posiciones");
- while($posiciones=mysqli_fetch_row($ejec_select_pos)){
- ?>
- <option value="<?php echo $posiciones[0];?>"><?php echo
- $posiciones[0];?></option>
- <?php
- }
- ?>
- </select>
- <input type="button" value="Ocultar" onclick="ocultar();">
- <input type="button" value="Enviar">
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment