function getLiquidaciones($fecha) { include_once "getHoras.php"; include_once "getValorHora.php"; include_once "getExtras.php"; include_once "getTM.php"; include_once dirname(__FILE__) . '/../conexionLocal.php'; $result = array(); //inicializa array result $getTM = getTM(); foreach ($getTM as $info) { $rut = $info['Rut']; $sumaLiquidacion = 0; $contador = 0; $horasRealizadas = getHoras($rut, $fecha); if ($horasRealizadas) { foreach ($horasRealizadas as $horas) { if ($horas['Semana'] == 7) { $semana = 0; } else { $semana = 1; } $valoresHora = getValorHora($rut); if ($valoresHora) { foreach ($valoresHora as $valor) { // aqui hay que hacer la confirmacion y multiplicacion if ($valor['Empresa'] == $horas['NombreEmpresa'] && $semana == $valor['Semana']) { $sumaLiquidacion += $valor['Valor'] * $horas['Horas']; } } } if ($contador == 0) { $contador++; $extrasTM = getExtras($rut, $fecha); if ($extrasTM) { foreach ($extrasTM as $extra) { // aqui se suman los extras del tm $sumaLiquidacion += $extra['Monto']; } } } } //echo $horas ['TMNombre']; //echo $sumaLiquidacion; //echo "<br>"; if ($sumaLiquidacion != 0) { $nombre = $horas['TMNombre'] . " " . $horas['TMApellido']; $rut = $info['Rut']; $result[$rut][] = $nombre; $result[$rut][] = $sumaLiquidacion; } } } return $result; }
<strong>Error!</strong> Tm no tiene Horas realizadas asociadas. </div>'; } echo "</tbody>"; // aqui termina HorasRealizadas //aqui empieza Extras echo "<thead ><tr colspan='2' class='info'>"; echo "<th>Extras"; if ($admin == 1) { echo "<input type='submit' value='Agregar Extra' class='btn btn-primary btnextra pull-right hidden-print' />"; } echo "</th>"; echo "<th>Monto Total Extras</th>"; echo "</thead >"; echo "<tbody id='appendExtra'>"; $extras = getExtras($rut, $mes); if ($extras) { foreach ($extras as $extra) { ?> <tr> <td> <?php echo "<span class='tituloExtra'>"; echo $extra['Titulo']; echo "</span>"; ?> </td> <td> <?php echo "<span class='label label-warning' >"; echo "\$ ";