I make a payroll system which I have problems with the query module I have the tables called worker that is my main table, hence the foreign keys of my tables "area", "position" and cg_turno. In my insert module I have no problem as I insert by description and in my BD they are inserted by ID. What I need is that it shows the description in the graphical interface since in my BD it is registered only with the IDs of the foreign keys. Thanks / Regards.
<!DOCTYPE html>
<?php
session_start();
if (@!$_SESSION['user']) {
header("Location:index.php");
}elseif ($_SESSION['rol']==2) {
header("Location:index2.php");
}
?>
<html lang="en">
<meta charset="utf-8">
<title>Gestión de Nómina</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body data-offset="40" background="images/fondotot.jpg" style="background-attachment: fixed">
<div id="page">
<div class="header">
<a href="#menu"></a>
Sistema Integral de Nómina
</div><br> </br>
<div class="container">
<header class="header">
<div class="row">
<?php
include("include/cabecera.php");
?>
</div>
</header>
<!-- Navbar
================================================== -->
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
<ul class="nav">
<li class=""><a href="index2.php">BIENVENIDO</a></li>
</ul>
<form action="#" class="navbar-search form-inline" style="margin-top:6px">
</form>
<ul class="nav pull-right">
<li><a href="">Bienvenido <strong><?php echo $_SESSION['user'];?></strong> </a></li>
<li><a href="desconectar.php"> Cerrar Sesión </a></li>
</ul>
</div><!-- /.nav-collapse -->
</div>
</div><!-- /navbar-inner -->
</div>
<br />
<p>  <strong>Impresión de Reporte</strong>
<a href="app/reportes/reporte_trabajador.php" target="_blank"><img src="images/printer.png" width="50" height="50"
<!-- ======================================================================================================================== -->
<div class="row">
<div class="span12">
<div class="caption">
<!--///////////////////////////////////////////////////Empieza cuerpo del documento interno////////////////////////////////////////////-->
<center><h2> Administración de Trabajadores Registrados</h2></center>
<div class="well well-small">
<hr class="soft"/>
<center><h4>Trabajadores Registrados</h4></center>
<div class="row-fluid">
<?php
require("connect_db.php");
$sql=("SELECT * FROM trabajador");
//la variable $mysqli viene de connect_db que lo traigo con el require("connect_db.php");
$query=mysqli_query($mysqli,$sql);
echo "<table border='1'; class='table table-hover';>";
echo "<tr class='warning'>";
echo "<td>No. de Control</td>";
echo "<td>Nombre</td>";
echo "<td>Apellido Paterno</td>";
echo "<td>Apellido Materno</td>";
echo "<td>NSS</td>";
echo "<td>CURP</td>";
echo "<td>RFC</td>";
echo "<td>Puesto</td>";
echo "<td>Area</td>";
echo "<td>Turno</td>";
echo "<td>Empresa</td>";
echo "<td>Editar</td>";
echo "</tr>";
?>
<?php
while($arreglo=mysqli_fetch_array($query)){
echo "<tr class='success'>";
echo "<td>$arreglo[0]</td>";
echo "<td>$arreglo[1]</td>";
echo "<td>$arreglo[2]</td>";
echo "<td>$arreglo[3]</td>";
echo "<td>$arreglo[4]</td>";
echo "<td>$arreglo[5]</td>";
echo "<td>$arreglo[6]</td>";
echo "<td>$arreglo[7]</td>";
echo "<td>$arreglo[8]</td>";
echo "<td>$arreglo[9]</td>";
echo "<td>$arreglo[10]</td>";
echo "<td><a href='actualizar_trabajador.php?id_control=$arreglo[0]'><img src='images/actualizar.gif' class='img-rounded'></td>";
echo "</tr>";
}
?>
<div class="span8">
</div>
</div>
<br/>
<!--EMPIEZA DESLIZABLE-->
<!--TERMINA DESLIZABLE-->
</div>
<!--///////////////////////////////////////////////////Termina cuerpo del documento interno////////////////////////////////////////////-->
</div>
</div>
</div>
<!-- Footer
================================================== -->
</div><!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="bootstrap/js/jquery-1.8.3.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</style>
<?php
include("includes/menus.php"); ?>
</div>
<!-- Placed at the end of the document so the pages load faster -->
<!--<script src="includes/jquery-1.9.1.min.js"></script>-->
<script src="js/bootstrap/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
<!-- Add in any FooTable dependencies we may need -->
<script src="js/moment.min.js"></script>
<!-- Add in FooTable itself -->
<script src="js/compiled/footable.js"></script>
<!-- Initialize FooTable -->
<script>
jQuery(function($){
$('.table').footable();
});
</script>
</body>
</html>