<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Listado de Predios por Dirección</title>
</head>
<body>
    <table style="width: 100%; border-collapse: collapse; font-family: 'Arial', sans-serif;">
        <thead>
            <tr>
                <th style="text-align: center" colspan="7"><?php echo e($compania->razonsocial); ?></th>
            </tr>
            <tr>
                <th style="text-align: center" colspan="7"><?php echo e($compania->tipodoc." : ".$compania->numeroi); ?></th>
            </tr>
            <tr style="font-size: 12px;">
                <th style="border: 1px solid #000">Dirección</th>
                <th style="border: 1px solid #000">Matricula</th>
                <th style="border: 1px solid #000">Codigo Catastral</th>
                <th style="border: 1px solid #000">Nombre Predio</th>
                <th style="border: 1px solid #000">Propietario</th>
                <th style="border: 1px solid #000">CC/NIT</th>
                <th style="border: 1px solid #000">Avaluo</th>
            </tr>
        </thead>
        <tbody>
            <?php
            $data = DB::table("gp_predio1 as pre")
                        ->select('pre.direccion as dir', 'pre.matricula_inmobiliaria as mat', 'pre.codigo_catastral as cod', 'pre.nombre as nom', 'pro.nombres as pnom', 'pro.numero as pnum', 'ava.valor as aval')
                        ->leftJoin("gp_tercero_predio as tpr", 'tpr.predio', '=', 'pre.id_unico')
                        ->leftJoin('gr_propietarios as pro', 'tpr.tercero', '=', 'pro.id_unico')
                        ->leftJoin('gr_avaluo as ava', 'ava.predio', '=', 'pre.id_unico')
                        ->where('ava.anno', '=', date("Y"))
                        ->where('pre.estado', '=', 2)
                        ->where('tpr.propietario', '=', 0)
                        ->orderBy('pre.direccion', 'ASC')
                        ->get();
            ?>
            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr style="font-size: 10px">
                    <td style="border: 1px solid #000"><?php echo e($row->dir); ?></td>
                    <td style="border: 1px solid #000"><?php echo e($row->mat); ?></td>
                    <td style="border: 1px solid #000"><?php echo e("'$row->cod'"); ?></td>
                    <td style="border: 1px solid #000"><?php echo e($row->nom); ?></td>
                    <td style="border: 1px solid #000"><?php echo e($row->pnom); ?></td>
                    <td style="text-align: right; border: 1px solid #000"><?php echo e("'$row->pnum'"); ?></td>
                    <td style="text-align: right; border: 1px solid #000"><?php echo e(number_format($row->aval, 2, ',', '.')); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
</body>
</html>