<?php include('meta.php') ?>
<?php
if ($_SESSION['type_user_live'] != "Admin") {
  	echo "<script language='Javascript'> location.href='home.php';</script>";
}
?>
<?php $bg_header = "bg_dieta"; include('header.php') ?>
	<div id="box_body"><!-- body center -->
	<script type="text/javascript">
	$(document).ready(function() {
    $('#allpatient').DataTable( {
        "language": {
        	"search": "Buscar:",
        	"lengthMenu":    "Mostrar _MENU_  productos en la tabla",
            "info":           "Mostrando de [ _START_ -  _END_ ] de un total de  _TOTAL_ registros",
            "infoEmpty":      "No hay elementos en la tabla",       
            "infoPostFix":    "",
            "infoFiltered": "(filtered from _MAX_ total records)",
            "loadingRecords": "Cargando registros...",
            "zeroRecords":    "No hay elementos en la tabla",
            "emptyTable":     "No hay elementos en la tabla",
            "paginate": {
            			"first":      "Primero",
            			"previous":   "Anterior",
            			"next":       "Siguiente",
            			"last":       "&Uacuteltimo"
            			},
        }
	} );
} );
	</script>
	<?php
		$result = mysqli_query($con,"SELECT id,name,age,cc,cell,proceso,last_visit FROM hc_paciente ORDER BY name");  
				echo "<table id='allpatient' class='display'> \n"; 
				echo "
				<thead>
					<tr>
					<th>Nombre</th>
					<th>Edad</th>
					<th>Cedula </th>
					<th>Teléfono </th>
					<th>Ultimo Registro </th>
					<th> </th>
					</tr>
					</thead>
					<tbody>	\n"; 
					while ($row = mysqli_fetch_row($result))
					{ 
					echo "<tr> 
							<td><strong>$row[1]</strong></td>
					      	<td>$row[2] años</td>
					      	<td>$row[3]</td>
					      	<td>$row[4]</td>
					      	<td>$row[5] / <span class='just'> $row[6]</span></td>


					      	<td><a class='btn btn-primary btn-sm' href='result_diet.php?id=$row[0]'><span class='glyphicon glyphicon-search '> Ver</span></a>
					      	</td>


					      	
					      </tr>";
					};
					echo " \n"; 
					echo " </tbody></table> \n"; 
				?> 


	</div><!-- END body center -->
<?php include('footer.php') ?>
