<?php

include ("header.php");

$sql="SELECT * FROM `pacientes` WHERE pac_activo = 1";

$resultado = mysqli_query($mysqli, $sql);

?>



        <div class="content-wrapper">

            <!-- START PAGE CONTENT-->

            <div class="page-heading">

                <h1 class="page-title">Pacientes</h1>

                <ol class="breadcrumb">

                    <li class="breadcrumb-item">

                    <button onclick="location.href='npacientes.php'" type="button" class="btn btn-primary">Nuevo</button>

                    </li>

                    

                </ol>

            </div>

            <div class="page-content fade-in-up">

                <div class="ibox">

                    <div class="ibox-head">

                        <div class="ibox-title">Listado</div>

                    </div>

                    <div class="ibox-body">

                        <table class="table table-striped table-bordered table-hover" id="dataTablePacientes" cellspacing="0" width="100%">

                            <thead>

                                <tr>

                                        <th> NOMBRE </th>

                                        <th> FECHA DE NACIMIENTO </th>

                                        <th> TELEFONO </th>

                                        <th> CELULAR </th>

                                        <th> EMAIL</th>

                                        <th> DOMICILIO</th>

                                        <th>VENTA</th>



                                    </tr>

                            </thead>

                                <tbody>          

                                    <?php $NUM=0;while($row = mysqli_fetch_array($resultado)) { $NUM=$NUM+1?>

                                    <tr>

                                        <td><?php echo utf8_decode($row['pac_nombre']); ?></td>

                                        <td><?php echo utf8_decode($row['pac_nacimiento']); ?></td>

                                        <td><?php echo $row['pac_telefono']; ?></td>

                                        <td><?php echo $row['pac_celular']; ?></td>

                                        <td> <?php echo $row['pac_email']; ?></td>									

                                        <td> <?php echo $row['pac_domicilio']; ?></td>                                              

                                        <td> <a href="nventas.php?id=<?php echo $row['pac_id']; ?>"><div class="icon-item"><i class="fa fa-file-pdf-o" aria-hidden="true"></i></div></a> </td>

                                       </tr>

                                    <?php } ?>

                                </tbody>

                        </table>

                </div>

            </div>                

<?php 

    include ('footer.php');

?>