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; }
<?php include_once 'getTM.php'; //funcion getTM $tms = getTM(); echo '<ul class="nav nav-pills nav-stacked">'; foreach ($tms as $tm) { echo '<li class="fc-event fc" rut="' . $tm['Rut'] . '"><center>' . $tm['Nombre'] . ' ' . $tm['Apellido'] . '</center></li>'; } echo '</ul>';
<!-- aqui va perfil --> </div><!-- cierre perfil --> </div> </div> <?php // si es admin ve esto if ($admin == 1) { echo "<script>\n \t\t\t\$(document).ready(function() {\n\t\t\t\$('#search').focus();\n\t\t\t});\n\t\t </script>"; } elseif ($admin == 0) { //print_r($_SESSION); $sessionrut = $_SESSION['idusuario']; //echo $sessionrut; $row = getTM($sessionrut); // print_r($row); $Rut = $row[0]["Rut"]; $nombreTM = $row[0]['Nombre'] . ' ' . $row[0]['Apellido']; echo "<script>\n \$('.progress').slideDown('slow');\n \$('#perfil').slideDown('slow').load('perfil/perfilGeneral.php', {'Rut': '{$Rut}', 'nombreTM': '{$nombreTM}'}, function(){\n \$('.progress').slideUp('slow');\n });\n\t </script>"; } ?> <script src="Include/filtro.js"></script> <script> $(document).ready(function() { $('.fc-event').css( "line-height", "2" ); $('.fc-event').css( "background-color", "rgb(51, 122, 183);" ); }); </script>
<?php include_once dirname(dirname(__FILE__)) . "/Include/meses.php"; include_once dirname(dirname(__FILE__)) . "/querys/getLiquidaciones.php"; include_once dirname(dirname(__FILE__)) . "/querys/getTM.php"; $mes = $_POST['mes']; //div en caso de errores ( horasRealizadas sin valoresHora asociadas) echo "<div id='errores'></div>"; //aqui parte Resumen Fecha y TM $ruttm = getTM(); $liquidaciones = getLiquidaciones($mes); echo "<br><div class = 'col-xs-10 col-xs-offset-1 text-center well well-md'>"; echo "<h3 align='center'>Resumen Liquidaciones</h3>\n\t<div class='table-responsive'>\n\t <table id='t01' class='table table-hover table-bordered table-condensed'>\n\t <thead><tr class='info'>\n <th>Tecnólogo</th>\n <th>Honorario bruto</th> \n\t\t<th>Retención</th> \n\t\t<th>Honorario líquido</th> \n </tr></thead><tbody>"; foreach ($ruttm as $tm) { if (isset($liquidaciones[$tm['Rut']][0])) { echo "<tr ><th>"; echo $liquidaciones[$tm['Rut']][0]; echo "</th><th>"; echo "\$" . number_format($liquidaciones[$tm['Rut']][1]); echo "</th><th>"; echo "\$" . number_format($liquidaciones[$tm['Rut']][1] * 0.1); echo "</th><th>"; echo "\$" . number_format($liquidaciones[$tm['Rut']][1] * 0.9); echo "</th></tr>"; } } echo "</table></div></div>";