<?php

include ("header.php");

$sql="SELECT * FROM `referidos` WHERE ref_activo = 1";

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

?>



        <div class="content-wrapper">

            <!-- START PAGE CONTENT-->

            <div class="page-heading">

                <h1 class="page-title">Medicos Referidos</h1>

                <ol class="breadcrumb">

                    <li class="breadcrumb-item">

                    <button onclick="location.href='nreferidos.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> TELEFONO </th>

                                        <th> CELULAR </th>

                                        <th> EMAIL</th>

                                        <th> DOMICILIO</th>

                                        <th> MOD </th>

                                        <th> BORRAR </th>

                                    </tr>

                            </thead>

                                <tbody>          

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

                                    <tr>

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

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

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

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

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

                                        <td> <a href="nreferidos.php?id=<?php echo $row['ref_id']; ?>&edt=1"><div class="icon-item"><i class="fa fa-edit"></i></div></a> </td>

                                        <td> <a href="#" data-href="nreferidos.php?id=<?php echo $row['ref_id'] . '&borrar=1'; ?>" data-toggle="modal" data-target="#confirm-delete"><div class="icon-item"><i class="fa fa-trash"></i></div></a> </td>

                                    </tr>

                                    <?php } ?>

                                </tbody>

                        </table>

                </div>

            </div>                

<?php 

    include ('footer.php');

?>