Guest User

Untitled

a guest
May 28th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. <?php
  2. include "sesion.php";
  3. ?>
  4.  
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <link rel="stylesheet" type="text/css" href="css/stilo.css" />
  9. <title>Listado</title>
  10. <meta name="description" content="">
  11. <meta name="title" content="Registro de cesiones de Striker Manager">
  12. <meta charset="utf-8"/>
  13. </head>
  14. <body>
  15. <style>
  16. .muestro{
  17. text-decoration:underline;
  18. cursor:pointer;
  19. }
  20. .oculto{
  21. display:none;
  22. }
  23. .visible{
  24. display:block;
  25. }
  26.  
  27. </style>
  28.  
  29. <script type="text-javascript" language="javascript">
  30. function cogeposiciones(seleccion){
  31. var posicion=document.getElementById('posicion').value;
  32.  
  33. }
  34. </script>
  35.  
  36. <script>
  37. function mostrar() {
  38. var formu=document.getElementById("anexo");
  39. if (formu.className="oculto"){
  40. formu.className="visible";
  41. }
  42. }
  43.  
  44. function ocultar() {
  45. var formu=document.getElementById("anexo");
  46. if (formu.className="visible"){
  47. formu.className="oculto";
  48. }
  49. }
  50.  
  51. </script>
  52.  
  53. <?php
  54. require("conexion.php");
  55. ?>
  56. <?php
  57. if (isset($_GET['posicion'])){
  58. $posicion=$_GET['posicion'];
  59. $consulta = mysqli_query($conexion, "SELECT * FROM manager WHERE
  60. posicion='$posicion'");
  61. if (mysqli_num_rows($consulta) > 0)
  62. {
  63. echo "<p>Listado de {$posicion}</p>";
  64. echo " <table border='1px solid black'> <tr> <th>id</th> <th>nick</th> <th>posicion</th> <th>Acciones</th></tr> ";
  65. while($row = mysqli_fetch_array($consulta, MYSQLI_ASSOC))
  66. {
  67. $linkid=$row['idmanager'];
  68. $linknick=$row['nick'];
  69. $linkpos=$row['posicion'];
  70. echo "<tr>";
  71. echo "<td id='getid' name='getid'> ".$row['idmanager']." </td>";
  72. echo "<td> ".$row['nick']." </td>";
  73. echo "<td> ".$row['posicion']." </td>";
  74. echo "<td> <a href='' onclick='mostrar();'>Modificar</a>
  75. <a href='borrar.php?idmanager=$linkid'>Borrar</a></td>";
  76. echo "</tr>";
  77. }
  78. echo "</table>";
  79. }
  80. else
  81. {
  82. echo " <p>Aún no hay registros en la base de datos</p>";
  83. }
  84. }
  85. ?>
  86.  
  87.  
  88. <?php
  89. if (isset($_GET['nick'])){
  90. $nick=$_GET['nick'];
  91. $consulta = mysqli_query($conexion, "SELECT * FROM manager WHERE nick LIKE
  92. '$nick%'");
  93. if (mysqli_num_rows($consulta) > 0)
  94. {
  95. echo "<p>Listado de {$nick}</p>"; //concatenar
  96. echo " <table border='1px solid black'> <tr> <th>id</th> <th>nick</th> <th>posicion</th> </tr> ";
  97. while($row = mysqli_fetch_array($consulta, MYSQLI_ASSOC))
  98. {
  99. $linkid=$row['idmanager'];
  100. echo "<tr>";
  101. echo "<td id='getid' name='getid'> ".$row['idmanager']." </td>";
  102. echo "<td> ".$row['nick']." </td>";
  103. echo "<td> ".$row['posicion']." </td>";
  104. echo "<td> <a class='muestro' onclick='mostrar();'>Modificar</a>
  105. <a href='borrar.php?idmanager=$linkid'>Borrar</a></td>";
  106. echo "</tr>";
  107. }
  108. echo "</table>";
  109. }
  110. else
  111. {
  112. echo " <p>Aún no hay registros en la base de datos</p>";
  113. }
  114. }
  115. ?>
  116. <div class="oculto" id="anexo">
  117. <label for="nick"><input type="text" name="nick">
  118. <label for="posicion>
  119. <select id="posicion" name="posicion" required
  120. onchange="cogeposiciones()">
  121. <option value="" disabled selected>Selecciona</option>
  122. <?php
  123. $sql_select_pos="SELECT posicion FROM posiciones";
  124. $ejec_select_pos= mysqli_query($conexion, $sql_select_pos) or
  125. die("No se pudo realizar el select de posiciones");
  126. while($posiciones=mysqli_fetch_row($ejec_select_pos)){
  127. ?>
  128. <option value="<?php echo $posiciones[0];?>"><?php echo
  129. $posiciones[0];?></option>
  130. <?php
  131. }
  132. ?>
  133.  
  134. </select>
  135. <input type="button" value="Ocultar" onclick="ocultar();">
  136. <input type="button" value="Enviar">
  137. </div>
  138. </body>
  139. </html>
Add Comment
Please, Sign In to add comment