Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = 'localhost'; //servidor
- $username = 'root'; //usuario de la base de datos
- $password = ''; //password del usuario de la base de datos
- $database = 'gym'; //nombre de la base de datos
- $conn = @new mysqli($server, $username, $password, $database);
- if ($conn->connect_error) //verificamos si hubo un error al conectar, recuerden que pusimos el @ para evitarlo
- {
- die('Error de conexión: ' . $conn->connect_error); //si hay un error termina la aplicación y mostramos el error
- }
- @$bookid = $_POST['id'];
- @$mostrar=$_POST['mostrar'];
- if($mostrar){
- $sql="select * FROM pagosclientes where idCliente = '$bookid' ";
- $rsql= mysqli_query($conn,$sql) or die (mysql_error());
- $sw=0;
- }
- /************Formulario*****************/
- echo"<form action=asistencia.php method=POST>";
- echo "<table id='tabla3'> <tr>";
- echo "<th>idPagoCliente</th>";
- echo "<th>idCliente</th>";
- echo "<th>idTipoperiodo</th>";
- echo "<th>inicio</th>";
- echo"<input type=submit name=mostrar value=Obtener Datos>";//Pulsa el boton para "generar tabla"
- echo "</tr>";
- echo"</table>";
- echo"</form>";
- if(@$sw>0){
- echo "<table id='tabla4'>";
- while($row = mysqli_fetch_array($rsql)){
- echo"<tr>";
- echo "<td>";
- echo $row['idPagoCliente'];
- echo "</td>";
- echo "<td>" ;
- echo $row['idCliente'];
- echo "</td>";
- echo "<td>";
- echo $row['idTipoPeriodo'];
- echo "</td>";
- echo "<td>";
- echo $row['inicio'];
- echo "</td>";
- echo "<td>";
- echo $row['final'];
- echo "</td>";
- echo "<td>";
- echo $row['costo'];
- echo "</td>";
- echo"</tr>";
- }
- echo"</table>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement