<?php //session_start();
/*$login = $_SESSION["login"];
if($login!="login"){
header('Location: registro.php');
session_unset();
session_destroy();
}*/
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
// Load Composer's autoloader
require 'vendor/autoload.php';
include ('consultacedula.php');
include ('consultacuenta.php');
header("Cache-control: private");
if($_POST['anio'] == null)
header('Location: index.php');
$anio = $_POST['anio'];
$mes = $_POST['mes'];
//$cedula =$_POST['cedula'];
//$cuentab=$_POST['cuentab'];
$alimentacion = 0 ;
include('conexionBD.php');
$query ="SELECT f.NOMBRES,f.CEDULA,
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=30 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'rmu/sueldo',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=31 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'iees quirografario',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=32 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'iess hipotecario',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=33 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'iess ext.covert.conyugue',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=34 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'osumtransa',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=35 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'aso. administrativos',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=36 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'sindicato de trabajadores',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=37 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'aso. secretarias',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=38 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'aso. estadisticos',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=39 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'aso. medicos',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=40 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'aso. profesionales',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=41 AND ANIO=".$anio." AND MES=".$mes."),0)AS ' sindicato 16 de enero',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=42 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'coopertaiva hee',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=43 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'colegio enfermero/as',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=44 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'impuesto a la renta',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=45 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'recuperacion de valores',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=46 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'plan telefonia celular',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=47 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'sansiones administativas',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=48 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'otros descuentos',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=49 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'iees aporte patronal',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=50 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'sindicato aux. enfermeria',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=22 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'retencion judicial',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=52 AND ANIO=".$anio." AND MES=".$mes."),0)AS 'optica',
IFNULL((SELECT MONTODESCONTADO FROM pagos WHERE CEDULA=f.CEDULA AND RUBRO=51 AND ANIO=".$anio." AND MES=".$mes."),0)AS ' asociacion enfermeras'
FROM funcionario f
WHERE f.CEDULA='".$cedula."' and f.cuenta='".$cuentab."'
";
$respuesta = mysql_query($query, $con);
if( mysql_num_rows($respuesta) === 0){
echo "<script>alert('Funcionario no registra rol de pagos o los datos son Incorrectos');</script>";
echo "<script>location.href='index.php'</script>";
//echo "alimentación: ".mysql_num_rows($respuesta);
//header('Location: index.php');
}else{
$nombres =0;
$sueldo=0;
$iessquirografario= 0;
$iesshipotecario= 0;
$iessextcobertconyugue=0;
$osumtransa= 0;
$asoadministrativos= 0;
$sindicatotrabajadores = 0;
$asosecretarias = 0;
$asoestadisticos=0;
$asomedicos=0;
$asoprofesionales=0;
$sindicato16enero=0;
$coperativahee=0;
$colegioenfermeros=0;
$impuestorenta=0;
$recuepracionvalores=0;
$plancelular=0;
$sancionesadministrativas=0;
$otrosdesscuentos=0;
$iessaportepatronal=0;
$sindicatoauxenfermeria=0;
$retencionjudicial=0;
$optica=0;
$asoenfermeras=0;
while($fila=mysql_fetch_array($respuesta)){
$nombres =$fila[0];
$sueldo = $fila[2] ;
$transporte = 0;
$iessquirografario = $fila[3];
$iesshipotecario = $fila[4];
$iessextcobertconyugue = $fila[5];
$osumtransa = $fila[6];
$asoadministrativos = $fila[7];
$sindicatotrabajadores = $fila[8];
$asosecretarias = $fila[9];
$asoestadisticos = $fila[10];
$asomedicos = $fila[11];
$asoprofesionales=$fila[12];
$sindicato16enero=$fila[13];
$coperativahee=$fila[14];
$colegioenfermeros=$fila[15];
$impuestorenta=$fila[16];
$recuepracionvalores=$fila[17];
$plancelular=$fila[18];
$sancionesadministrativas=$fila[19];
$otrosdesscuentos=$fila[20];
$iessaportepatronal=$fila[21];
$sindicatoauxenfermeria=$fila[22];
$retencionjudicial=$fila[23];
$optica=$fila[24];
$asoenfermeras=$fila[25];
}
$banco = '';
$nroCuenta = '';
$totalIngresos = $sueldo;
$totalDescuentos1 = $asoadministrativos + $asoestadisticos + $asomedicos + $asoprofesionales + $asosecretarias + $coperativahee + $sindicato16enero + $sindicatoauxenfermeria + $sindicatotrabajadores + $colegioenfermeros + $sancionesadministrativas+$optica+$plancelular+$asoenfermeras;
if($impuestorenta<='0.01'){
$totalDescuentos2 = $iessextcobertconyugue + $iessaportepatronal + $iesshipotecario + $iessquirografario + $otrosdesscuentos + $osumtransa + $recuepracionvalores + $retencionjudicial ;
}else{
$totalDescuentos2 = $iessextcobertconyugue + $iessaportepatronal + $iesshipotecario + $iessquirografario + $impuestorenta + $otrosdesscuentos + $osumtransa + $recuepracionvalores + $retencionjudicial ;
}
$totalDescuentos = $totalDescuentos1 + $totalDescuentos2;
$liquidaARecibir = $totalIngresos - $totalDescuentos;
require('fpdf/fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',9);
$pdf->Image('cabecera.png' , 16 ,5, 180 , 43,'PNG');
$pdf->Ln();
$pdf->SetX(15);
$pdf->Cell(185, 260, utf8_decode(''), 1, 0, 'C',0);
$pdf->SetY(47);
$pdf->Cell(0,5,'MINISTERIO DE SALUD PUBLICA',0,6,'C');
$pdf->Cell(0,5,'HOSPITAL DE ESPECIALIDADES EUGENIO ESPEJO',0,6,'C');
$pdf->Cell(0,5,'ROL DE PAGOS INDIVIDUAL',0,6,'C');
//Cabezera de la fecha
switch ($mes) {
case 1:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('ENERO-'.$anio.''), 0, 0, 'L');
break;
case 2:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('FEBRERO-'.$anio.''), 0, 0, 'L');
break;
case 3:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('MARZO-'.$anio.''), 0, 0, 'L');
break;
case 4:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('ABRIL-'.$anio.''), 0, 0, 'L');
break;
case 5:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('MAYO-'.$anio.''), 0, 0, 'L');
break;
case 6:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('JUNIO-'.$anio.''), 0, 0, 'L');
break;
case 7:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('JULIO-'.$anio.''), 0, 0, 'L');
break;
case 8:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('AGOSTO-'.$anio.''), 0, 0, 'L');
break;
case 9:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('SEPTIEMBRE-'.$anio.''), 0, 0, 'L');
break;
case 10:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('OCTUBRE-'.$anio.''), 0, 0, 'L');
break;
case 11:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('NOVIEMBRE-'.$anio.''), 0, 0, 'L');
break;
case 12:
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 65);
$pdf->Cell(30, 6, utf8_decode('ROL CORRESPONDIENTE A:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 65);
$pdf->Cell(30, 6, utf8_decode('DICIEMBRE-'.$anio.''), 0, 0, 'L');
break;
}
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 71);
$pdf->Cell(30, 6, utf8_decode('CÉDULA:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 71);
$pdf->Cell(30, 6, utf8_decode($cedula), 0, 0, 'L');
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(15, 77);
$pdf->Cell(30, 6, utf8_decode('NOMBRES:'), 0, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY(65, 77);
$pdf->Cell(40, 6, utf8_decode($nombres), 0, 0, 'L');
$pdf->SetXY(15, 84);
// CABECERA DE INGRESOS / DATOS BANCARIOS
$pdf->SetFont('Arial','B',9);
$pdf->SetFillColor(160,160,160);
$pdf->Cell(0, 6, utf8_decode('INGRESOS'), 0, 0, 'C',1);
$pdf->SetXY(26, 90);
$pdf->Cell(55, 6, utf8_decode('RUBRO'), 0, 0, 'L');
$pdf->SetXY(77, 90);
$pdf->Cell(25, 6, utf8_decode('USD $'), 0, 0, 'L');
// INICIO PRIMERA FILA
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 96);
$pdf->Cell(55, 6, utf8_decode('RMU / SUELDO'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($sueldo, 2, ',', ' '), 0, 0, 'C');
$pdf->Cell(55, 6, utf8_decode($banco), 0, 0, 'C');
$pdf->Cell(25, 6, $nroCuenta, 0, 0, 'C');
//FIN PRIMERA FILA
// INICIO octava FILA
$pdf->SetXY(15, 102);
$pdf->SetFont('Arial','BU',9);
$pdf->Cell(55, 6, utf8_decode('TOTAL INGRESOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($totalIngresos, 2, ',', ' '), 0, 0, 'C');
//FIN octava FILA
// horas reabajadas
$pdf->SetFont('Arial','b',9);
$pdf->SetXY(15, 109);
$pdf->Cell(0, 6, utf8_decode('DESCUENTOS PERSONALES'), 0, 0, 'C',1);
//inicio
$pdf->SetXY(26, 115);
$pdf->Cell(55, 6, utf8_decode('RUBRO'), 0, 0, 'L');
$pdf->SetXY(77, 115);
$pdf->Cell(25, 6, utf8_decode('USD $'), 0, 0, 'L');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 121);
$pdf->Cell(55, 6, utf8_decode('ASO. ADMINISTRATIVOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asoadministrativos, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 127);
$pdf->Cell(55, 6, utf8_decode('ASO. ESTADISTICOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asoestadisticos, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 133);
$pdf->Cell(55, 6, utf8_decode('ASO. MÉDICOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asomedicos, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 139);
$pdf->Cell(55, 6, utf8_decode('ASO. PROFESIONALES'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asoprofesionales, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 145);
$pdf->Cell(55, 6, utf8_decode('ASO. SECRETARIAS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asosecretarias, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 151);
$pdf->Cell(55, 6, utf8_decode('COOPERATIVA HEE'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($coperativahee, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','b',9);
$pdf->SetXY(110, 115);
$pdf->Cell(55, 6, utf8_decode('RUBRO'), 0, 0, 'L');
$pdf->SetXY(172, 115);
$pdf->Cell(25, 6, utf8_decode('USD $'), 0, 0, 'L');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 121);
$pdf->Cell(55, 6, utf8_decode('SINDICATO 16 ENERO'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($sindicato16enero, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 127);
$pdf->Cell(55, 6, utf8_decode('SINDICATO AUX. ENFERMERIA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($sindicatoauxenfermeria, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 133);
$pdf->Cell(55, 6, utf8_decode('SINDICATO DE TRABAJADORES'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($sindicatotrabajadores, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 139);
$pdf->Cell(55, 6, utf8_decode('COLEGIO DE ENFERMEROS / AS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($colegioenfermeros, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 145);
$pdf->Cell(55, 6, utf8_decode('SANCIONES ADMINISTRATIVAS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($sancionesadministrativas, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 151);
$pdf->Cell(55, 6, utf8_decode('PLAN TELEFONÍA CELULAR'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($plancelular, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 157);
$pdf->Cell(55, 6, utf8_decode('ÓPTICA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($optica, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 157);
$pdf->Cell(55, 6, utf8_decode('ASO. ENFERMERAS HEE'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($asoenfermeras, 2, ',', ' '), 0, 0, 'C');
//fin
// INICIO octava FILA
$pdf->SetXY(15, 163);
$pdf->SetFont('Arial','BU',9);
$pdf->Cell(55, 6, utf8_decode('TOTAL DESCUENTOS PERSONALES'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($totalDescuentos1, 2, ',', ' '), 0, 0, 'C');
//FIN octava FILA
// EGRESOS
// horas reabajadas
$pdf->SetFont('Arial','b',9);
$pdf->SetXY(15, 171);
$pdf->Cell(0, 6, utf8_decode('DESCUENTOS DE LEY'), 0, 0, 'C',1);
//inicio
$pdf->SetXY(26, 177);
$pdf->Cell(55, 6, utf8_decode('RUBRO'), 0, 0, 'L');
$pdf->SetXY(77, 177);
$pdf->Cell(25, 6, utf8_decode('USD $'), 0, 0, 'L');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 183);
$pdf->Cell(55, 6, utf8_decode('IESS EXT. COBERT. CONYUGE'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($iessextcobertconyugue, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 189);
$pdf->Cell(55, 6, utf8_decode('IESS APORTE PERSONAL'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($iessaportepatronal, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 195);
$pdf->Cell(55, 6, utf8_decode('IESS HIPOTECARIO'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($iesshipotecario, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 201);
$pdf->Cell(55, 6, utf8_decode('IESS QUIROGRAFARIO'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($iessquirografario, 2, ',', ' '), 0, 0, 'C');
//fin
switch ($impuestorenta) {
case '0.01':
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 207);
$pdf->Cell(55, 6, utf8_decode('IMPUESTO A LA RENTA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format('0.00', 2, ',', ' '), 0, 0, 'C');
//fin
break;
case $impuestorenta>'0.01':
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 207);
$pdf->Cell(55, 6, utf8_decode('IMPUESTO A LA RENTA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($impuestorenta, 2, ',', ' '), 0, 0, 'C');
//fin
break;
case '0.00':
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 207);
$pdf->Cell(55, 6, utf8_decode('IMPUESTO A LA RENTA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($impuestorenta, 2, ',', ' '), 0, 0, 'C');
//fin
break;
}
//inicio
$pdf->SetFont('Arial','b',9);
$pdf->SetXY(110, 177);
$pdf->Cell(55, 6, utf8_decode('RUBRO'), 0, 0, 'L');
$pdf->SetXY(172, 177);
$pdf->Cell(25, 6, utf8_decode('USD $'), 0, 0, 'L');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 183);
$pdf->Cell(55, 6, utf8_decode('OTROS DESCUENTOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($otrosdesscuentos, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 189);
$pdf->Cell(55, 6, utf8_decode('OSUMTRANSA'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($osumtransa, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 195);
$pdf->Cell(55, 6, utf8_decode('RECUPERACIÓN DE VALORES'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($recuepracionvalores, 2, ',', ' '), 0, 0, 'C');
//fin
//inicio
$pdf->SetFont('Arial','',9);
$pdf->SetXY(110, 201);
$pdf->Cell(55, 6, utf8_decode('RETENCIÓN JUDICIAL'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($retencionjudicial, 2, ',', ' '), 0, 0, 'C');
//fin
// INICIO octava FILA
$pdf->SetXY(15, 212);
$pdf->SetFont('Arial','BU',9);
$pdf->Cell(55, 6, utf8_decode('TOTAL DESCUENTOS DE LEY'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($totalDescuentos2, 2, ',', ' '), 0, 0, 'C');
//FIN octava FILA
// inicio
$pdf->SetFont('Arial','b',9);
$pdf->SetXY(15, 219);
$pdf->Cell(0, 6, utf8_decode('TOTALES'), 0, 0, 'C',1);
//fin
//INICIO SEGUNDA FILA
$pdf->SetFont('Arial','BU',9);
$pdf->SetXY(15, 226);
$pdf->Cell(55, 6, utf8_decode('TOTAL DESCUENTOS'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($totalDescuentos, 2, ',', ' '), 0, 0, 'C');
// FIN SEGUNDA FILA
//INICIO TERCERA FILA
$pdf->SetFont('Arial','BU',9);
$pdf->SetXY(15, 232);
$pdf->Cell(55, 6, utf8_decode('LIQUIDO A RECIBIR'), 0, 0, 'L');
$pdf->Cell(25, 6, number_format($liquidaARecibir, 2, ',', ' '), 0, 0, 'C');
$pdf->SetFont('Arial','B',7);
$pdf->SetXY(15, 242);
$pdf->Cell(55, 6, utf8_decode('NOTA: ESTE DOCUMENTO NO TIENE VALIDEZ SIN EL SELLO Y FIRMA DEL DEPARTAMENTO FINANCIERO Y/O TALENTO HUMANO '), 0, 0, 'L');
// FIN TERCERA FILA
$pdf->SetFont('Arial','',9);
$pdf->SetXY(15, 250);
date_default_timezone_set('America/Guayaquil');
$pdf->MultiCell(0,6,"Fecha: ".date("d/m/Y"));
$pdf->SetXY(15, 256);
$pdf->MultiCell(0,6,"Hora: ".date('H:i:s'));
$pdf->Cell(0,6,utf8_decode(" © TIC´s 2020, www.hee.gob.ec"),0,6,'C');
$pdf->Ln();
$pdfdoc = $pdf;
$pdfdoc = $pdfdoc->Output('rol.pdf', 'F');
//$pdf->Output('rol.pdf', 'D');
//include ('consultamail.php');
require('consultamail.php');
// Instantiation and passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->isSMTP(); // Send using SMTP
$mail->Host = 'mail.hee.gob.ec'; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'roles.pago@hee.gob.ec'; // SMTP username
$mail->Password = 'Hospital.2020'; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients
$mail->setFrom('roles.pago@hee.gob.ec', 'Roles de Pago - HEE');
//$mail->addAddress('israteneda@gmail.com', 'Acreedor'); // Add a recipient
//$mail->addAddress('cesarandres53@hotmail.es');
$mail->addAddress($mail2);
// Add a recipient
// Attachments
// $mail->addStrng($pdf, 'rol.pdf');
$mail->addAttachment('rol.pdf', 'rol.pdf');
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Rol de Pagos';
$mail->Body = 'Rol de pagos, por favor no responda a este correo. <b></b>';
$mail->AltBody = 'Rol de pagos';
$mail->send();
// echo 'Message has been sent';
// echo "<script>Message has been sent</script>";
}
catch (Exception $e) {
// echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
// echo "<script>Message hasn't been sent</script>";
}
}
}
?>