Example #1
0
		ON
		exp.id_tecnico=emp.id_empleado
		WHERE exp.fecha >= '".$_GET['fecha_inicio']."' AND exp.fecha <= '".$_GET['fecha_final']."' 
		ORDER BY fecha";*/
$locacionConsulta = "AND exp.locacion LIKE '%" . $_GET['locacion'] . "%' ";
if ($_GET['eike'] == 1) {
    $locacionConsulta = "AND exp.locacion LIKE '%" . $_GET['locacion'] . "%' AND exp.locacion != 'DF' ";
}
$consulta = "SELECT exp.fecha,\n\t\texp.id_expediente,\n\t\texp.capturista,\n\t\texp.locacion,\n\t\temp.nombre,\n\t\temp.apaterno,\n\t\temp.amaterno,\n\t\tes.estatus ,\n\t\tesi.estatus as esi,\n\t\texp.pagado\n\t\tFROM expediente exp\n\t\tLEFT JOIN estatus es\n\t\tON exp.id_estatus=es.id_estatus\n\t\tLEFT JOIN estatus_ike esi\n\t\tON exp.id_estatus_ike=esi.id_estatus_ike\n\t\tLEFT JOIN empleado emp\n\t\tON\n\t\texp.id_tecnico=emp.id_empleado\n\t\tWHERE exp.fecha >= '" . $_GET['fecha_inicio'] . "' AND exp.fecha <= '" . $_GET['fecha_final'] . "'\n\t\tAND exp.id_tecnico LIKE '%" . $_GET['tecnico'] . "%' \n\t\tAND exp.capturista LIKE '%" . $_GET['capturo'] . "%' \n\t\tAND exp.id_estatus_ike LIKE '%" . $_GET['eike'] . "%' \n\t\tAND exp.id_estatus LIKE '%" . $_GET['etecnico'] . "%' \n\t\tAND exp.pagado LIKE '%" . $_GET['epago'] . "%' \n\t\tAND exp.tipo LIKE '%" . $_GET['tipo'] . "%' \n\t\t" . $locacionConsulta . "\n\t\tORDER BY fecha";
$datos = mysqli_query($conexion, $consulta);
$reporte = new reporte('L', 'mm', 'Letter');
$reporte->addPage();
$reporte->SetTextColor(0, 0, 0);
$reporte->SetFillColor(255, 255, 255);
while ($fila = mysqli_fetch_array($datos)) {
    $reporte->Cell(1);
    $reporte->Cell(10, 5, $fila['fecha'], 0, 0, "L", true);
    $reporte->Cell(10);
    $reporte->Cell(10, 5, $fila['id_expediente'], 0, 0, "L", true);
    $reporte->Cell(11);
    $reporte->Cell(30, 5, utf8_decode($fila['capturista']), 0, 0, "L", true);
    $reporte->Cell(2);
    $reporte->Cell(30, 5, utf8_decode($fila['nombre'] . " " . $fila['apaterno'] . " " . $fila['amaterno']), 0, 0, "L", true);
    $reporte->Cell(2);
    if ($_GET['eike'] != 1) {
        $reporte->Cell(30, 5, $fila['esi'], 0, 0, "C", true);
        $reporte->Cell(2);
    }
    $reporte->Cell(30, 5, $fila['estatus'], 0, 0, "C", true);
    $reporte->Cell(2);
    $reporte->Cell(30, 5, $fila['pagado'], 0, 0, "C", true);