Пример #1
0
function FiniquitoAutomovil($nroliq)
{
    $ab = new abs();
    $salida = '';
    $separador = '----------------------------------------------------------------------------------------------------------------------------------------------------------------------';
    $espacioIzq = '20';
    $query = "\n\t\tSELECT DISTINCT\n\t\t\tCONVERT(VARCHAR, GETDATE(), 103) AS FECHA\t\t\t\t--{$Fecha}\t\t\t0\n\t\t\t,CONVERT(VARCHAR, GETDATE(), 8)\tAS HORA\t\t\t\t\t--{$Hora}\t\t\t\t1\n\t\t\t,CONVERT(VARCHAR, GETDATE(), 106) AS FECHA2\t\t\t\t--{$Fecha2}\t\t\t2\n\t\t\t,CAST(YEAR(H.FECHAOCUR) AS VARCHAR) + '-'+ H.IDSECCION +'-' + CAST(H.SINIESTRO AS VARCHAR) AS SINIESTRO\t\t\t\t\t\t\t\t--{$Siniestro}\t\t3\n\t\t\t,H.IDSECCION + ' ' + SC.DESCRP AS RAMO\t\t\t\t\t--{$Ramo}\t\t\t\t4\n\t\t\t,PG.POLIZA AS POLIZA\t\t\t\t\t\t\t\t\t--{$Poliza}\t\t\t5\n\t\t\t,H.CERTIFICADO AS CERTIFICADO\t\t\t\t\t\t\t--{$Certificado}\t\t6\n\t\t\t,PG.NOMBREASEG AS ASEGURADO\t\t\t\t\t\t\t\t--{$Asegurado}\t\t7\n\t\t\t,'' AS DenomComerc\t\t\t\t\t\t\t\t\t\t--{$DenomComerc}\t\t8\n\t\t\t,'' AS AGENTE\t\t\t\t\t\t\t\t\t\t\t--{$Agente}\t\t\t9\n\t\t\t,CONVERT(VARCHAR, H.FECHAOCUR, 103)\tAS FechaOcur\t\t--{$FechaOcur}\t\t10\n\t\t\t,CONVERT(VARCHAR, H.FECHAAVIS, 103)\tAS FechaAviso\t\t--{$FechaAviso}\t\t11\n\t\t\t,H.CAUSASIN + ' ' + CS.DESCRP AS CausaSin\t\t\t\t--{$CausaSin}\t\t\t12\n\t\t\t,H.TIPO_PERDIDA + ' ' + TP.DESCRP AS TipoPerdida\t\t--{$TipoPerdida}\t\t13\n\t\t\t,H.SINDESC AS DescrpSiniestro\t\t\t\t\t\t\t--{$DescrpSiniestro}\t14\n\t\t\t,PA.TIPOVEH + ' ' + TV.DESCRP AS TipoVeh\t\t\t\t--{$TipoVeh}\t\t\t15\n\t\t\t,PA.ANIOVEH AS ANIO\t\t\t\t\t\t\t\t\t\t--{$Anio}\t\t\t\t16\n\t\t\t,PA.MODELO AS MODELO\t\t\t\t\t\t\t\t\t--{$Modelo}\t\t\t17\n\t\t\t,PA.PLACAPAT AS PLACA\t\t\t\t\t\t\t\t\t--{$Placa}\t\t\t18\n\t\t\t,PA.COLORDESC AS COLOR\t\t\t\t\t\t\t\t\t--{$Color}\t\t\t19\n\t\t\t,H.COBAFEC AS IDCOBER\t\t\t\t\t\t\t\t\t--{$IdCober}\t\t\t20\n\t\t\t,CO.DESCRP AS CoberDesc\t\t\t\t\t\t\t\t\t--{$CoberDesc}\t\t21\n\t\t\t,PC.SUMAASEG AS SumaAseg\t\t\t\t\t\t\t\t--{$SumaAseg}\t\t\t22\n\t\t\t,'' AS TOTAL\t\t\t\t\t\t\t\t\t\t\t--{$Total}\t\t\t23\n\t\tFROM SNTTRANP P (NOLOCK) \n\t\tINNER JOIN SNTTRANH H (NOLOCK) ON P.NROTRAMITE = H.NROTRAMITE AND P.SNT_NRO = H.SINIESTRO AND P.SNT_ITEM = H.ITEM AND P.SNT_SSN = H.SUBSINIESTRO\n\t\tINNER JOIN Zurich_PTCore..COREPRFSEC SC (NOLOCK) ON H.IDSECCION = SC.IDSECCION AND H.IDPROFIT = SC.IDPROFIT AND SC.DEBAJA = 'N'\n\t\tINNER JOIN POLDATGEN PG (NOLOCK) ON H.NROPOLIZA = PG.NROPOLIZA AND H.CERTIFICADO = PG.ENDOSO  AND PG.DEBAJA = 'N'\n\t\tINNER JOIN SNTCAUSASIN CS (NOLOCK) ON H.IDSECCION = CS.IDSECCION AND H.CAUSASIN = CS.IDCAUSASIN AND CS.DEBAJA = 'N'\n\t\tINNER JOIN SNTTIPPERD TP (NOLOCK) ON H.IDSECCION = TP.IDSECCION AND H.TIPO_PERDIDA = TP.IDTIPPERD AND TP.DEBAJA = 'N'\n\t\tINNER JOIN POLRGOAUT PA (NOLOCK) ON H.NROPOLIZA = PA.NROPOLIZA AND H.CERTIFICADO = PA.ENDOSO  AND PA.DEBAJA = 'N'\n\t\tLEFT JOIN SNTTIPVEH TV (NOLOCK) ON PA.TIPOVEH = TV.IDTIPVEH AND TV.DEBAJA = 'N'\n\t\tINNER JOIN SNTCOBERT CO (NOLOCK) ON H.IDSECCION = CO.IDSECCION AND H.BIEN = CO.BIEN AND H.COBAFEC = CO.IDCOBER AND H.RAMO = CO.RAMO AND H.SUBRAMO = CO.SUBRAMO AND CO.DEBAJA = 'N'\n\t\tINNER JOIN POLCOBAFE PC (NOLOCK) ON H.NROPOLIZA = PC.NROPOLIZA AND H.CERTIFICADO = PC.ENDOSO AND H.COBAFEC = PC.COBERTURA AND H.BIEN = PC.BIEN AND H.RAMO = PC.RAMO AND H.NUMASE = PC.NUMASEG AND PC.DEBAJA = 'N'\n\t\tWHERE NROINTLIQ = '" . $nroliq . "'";
    $ab->executeQueryXpdf($query, $_SESSION[IDSISTEMA], 1);
    $Fecha = $ab->vlistR[0][0][0];
    $Hora = $ab->vlistR[0][0][1];
    $Fecha2 = $ab->vlistR[0][0][2];
    $Siniestro = $ab->vlistR[0][0][3];
    $Ramo = $ab->vlistR[0][0][4];
    $Poliza = $ab->vlistR[0][0][5];
    $Certificado = $ab->vlistR[0][0][6];
    $Asegurado = $ab->vlistR[0][0][7];
    $DenomComerc = $ab->vlistR[0][0][8];
    $Agente = $ab->vlistR[0][0][9];
    $FechaOcur = $ab->vlistR[0][0][10];
    $FechaAviso = $ab->vlistR[0][0][11];
    $CausaSin = $ab->vlistR[0][0][12];
    $TipoPerdida = $ab->vlistR[0][0][13];
    $DescrpSiniestro = $ab->vlistR[0][0][14];
    $TipoVeh = $ab->vlistR[0][0][15];
    $Anio = $ab->vlistR[0][0][16];
    $Modelo = $ab->vlistR[0][0][17];
    $Placa = $ab->vlistR[0][0][18];
    $Color = $ab->vlistR[0][0][19];
    $IdCober = $ab->vlistR[0][0][20];
    $CoberDesc = $ab->vlistR[0][0][21];
    $SumaAseg = $ab->vlistR[0][0][22];
    $Total = $ab->vlistR[0][0][23];
    $salida .= '
		<table border = 0 width="550" class= "Grilla">
			<tr width="550">
				<td colspan = 4 width="550">&nbsp;<img src=' . getLogoLocation() . ' border="0"  width="600" /></td>
			</tr>
			<tr>
				<td colspan = 4>
					<table border = 0 width=550>
						<tr>
							<td width=450 align = right class = "FecHor"><b>
								Fecha: ' . $Fecha . '<br/>
								Hora: ' . $Hora . '<br/></b>
							</td>
							<td>&nbsp;</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				
				<td colspan = 4 class = "Subtitulos">** RECIBO DE INDEMNIZACION**</td>
			</tr>
			<tr>
				
				<td colspan = 2>Nro. SINIESTRO: ' . $Siniestro . '</td>
				<td colspan = 2>RAMO: ' . $Ramo . '</td>
			</tr>
			<tr>
				
				<td colspan = 2>Nro. POLIZA: ' . $Poliza . '</td>
				<td colspan = 2>Nro. CERTIFICADO: ' . $Certificado . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>ASEGURADO: ' . $Asegurado . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>DENOMINACIONES COMERCIALES: ' . $DenomComerc . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>AGENTE: ' . $Agente . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			
			<tr>
				
				<td colspan = 4 class = "Subtitulos">**CARACTERISTICAS DEL SINIESTRO**</td>
			</tr>
			<tr>
				
				<td colspan = 2>FECHA DE OCURRENCIA: ' . $FechaOcur . '</td>
				<td colspan = 2>FECHA DE AVISO: ' . $FechaAviso . '</td>
			</tr>
			<tr>
				
				<td colspan = 2>CAUSA: ' . $CausaSin . '</td>
				<td colspan = 2>EFECTO: ' . $TipoPerdida . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>OBSERVACIONES: ' . $DescrpSiniestro . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				<td colspan = 4 class = "Subtitulos">** CARACTERISTICAS DEL VEHICULO**</td>
			</tr>
			<tr>
				
				<td colspan = 2>TIPO: ' . $TipoVeh . '</td>
				<td>AÑO: ' . $Anio . '</td>
				<td>MODELO: ' . $Modelo . '</td>
			</tr>
			<tr>
				
				<td colspan = 2>PLACA: ' . $Placa . '</td>
				<td colspan = 2>COLOR: ' . $Color . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>La indemnización recibida en este acto ha sido establecida de acuerdo a lo siguiente:</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				<td>' . $IdCober . '</td>
				<td colspan = 2>' . $CoberDesc . '</td>
				<td>MONTO ' . $SumaAseg . ' </td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				
				<td colspan = 2>TOTAL Bs. F ' . $Total . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>
					He (mos) recibido de ZURICH SEGUROS, S.A. la cantidad de: Bs. F<br/>
					Monto en letras<br/>
					En concepto de indemnización total y definitiva de los daños y perjuicios sufridos.
				</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
			<tr>
				
				<td colspan = 4>
					Con el recibo de la expresada cantidad declaro (declaramos), liberada a ZURICH SEGUROS S.A., de toda responsabilidad por lo que respecta todas las consecuencias directa ó indirectamente relacionadas con el siniestro arriba mencionada, por virtud de lo cual otorgo (amos) en su favor el más amplio, total y definitivo finiquito.	Hago (hacemos) igualmente formal subrogación a favor de ZURICH SEGUROS S.A., de todos los derechos y acciones que me (nos) corresponden ó pudieran corresponderme (nos) contra terceras personas en razón de la pérdida y daños materia de la presente indemnización.
				</td>
			</tr>
			<tr>
				
				<td colspan = 2 align = right>
					<br/>
					Caracas, Fecha ' . $Fecha2 . '
				</td>
				<td colspan = 2>&nbsp;</td>
			</tr>
			<tr>
				
				<td colspan = 4>
					Recibi (mos) conforme, ' . $Asegurado . '
				</td>
			</tr>
			<tr>
				
				<td colspan = 4>------------------------------------------------------------</td>
			</tr>
			<tr>
				
				<td colspan = 4>FIRMA DEL ASEGURADO O BENEFICIARIO</td>
			</tr>
			<tr>
				
				<td colspan = 2>
					Nro. Cédula: ________________________
				</td>
				<td colspan = 2 align = right>
					Devolver Firmado
				</td>
			</tr>
			<tr>
				
				<td colspan = 4>' . $separador . '</td>
			</tr>
		</table>
	<script type="text/php">
		if ( isset($pdf) ) {
	    	$font = Font_Metrics::get_font("sans-serif", "bold");
	    	$pdf->page_text(525, 20, "Pagina: {PAGE_NUM}", $font, 10, array(0,0,0));
		}
	</script>
		';
    //$salida = '<span class= "header"><b>Usuario: '.$_SESSION[userid].', Fecha Impresion: '.$fecha.' </b></span>';
    return $salida;
}
Пример #2
0
/**
 *
 * @param object $smarty objeto smarty.
 * @param array $arrCamposBloque arreglo con los campos.
 */
function getCamposTPL($arrCamposBloque, $arrItemsBloque, $arrTotales)
{
    /*
    echo "<pre>"; print_r($arrCamposBloque); echo "</pre>";
    echo "<pre>"; print_r($arrItemsBloque); echo "</pre>";
    echo "<pre>"; print_r($arrTotales); echo "</pre>";
    die;
    */
    $sContent = '<html>
                 <body>
				<script type="text/php">
				if ( isset($pdf) ) { 
			        $font = Font_Metrics::get_font("helvetica", "normal");    
			        $pdf->page_text(560, 26, "{PAGE_NUM}/{PAGE_COUNT}", $font, 12, array(0,0,0));
			        $font = Font_Metrics::get_font("sans-serif", "normal");
					$pdf->page_text(245, 25,"{CABECERA}", $font, 10, array(0,0,0),0,0,"' . $arrCamposBloque[1] . " " . $arrCamposBloque[2] . '");
				} 
				</script>
                 ';
    //----------------------------
    //divido observaciones en bloques de 2500 caracteres  las observaciones
    if (strlen($arrCamposBloque[21]) > 125) {
        $arrCamposBloque21 = wordwrap($arrCamposBloque[21], 125, "@@@@@");
        $arrCamposBloque21 = explode('@@@@@', $arrCamposBloque21);
    } else {
        $arrCamposBloque21 = 0;
    }
    //----------------------------
    /*echo "<pre>";
      print_r($arrCamposBloque21);
      echo "</pre>";die;*/
    if ($arrCamposBloque[30] != '') {
        $reemplaza_a = "(REEMPLAZA A {$arrCamposBloque['1']} {$arrCamposBloque['30']})";
    } else {
        $reemplaza_a = "";
    }
    $sContent .= "\n                <style type='text/css'>\n\t                body{\n\t                \tfont-size: 9pt;\n\t                \tfont-family: sans-serif;\n\t    \t\t\t}\n\t    \t\t\t.nume{\n\t    \t\t\t\t/*width: 10px;*/\n\t    \t\t\t\ttext-align: left;\n\t    \t\t\t}\n\t    \t\t\t.nume2{\n\t    \t\t\t\t/*width: 10px;*/\n\t    \t\t\t\ttext-align: right;\n\t    \t\t\t}\n                    .nume3{\n\t    \t\t\t\t/*width: 10px;*/\n                        text-align: left;\n\t    \t\t\t\tvertical-align:text-top;\n\t    \t\t\t}\n\t    \t\t\t.tabla{\n\t    \t\t\t\tpadding:0px 0px 0px 0px;\n\t    \t\t\t\tmargin:0px 0px 0px 0px;\n\t    \t\t\t}\n\t    \t\t\tTD{\n\t    \t\t\t\tpadding:0px 0px 0px 0px;\n\t    \t\t\t\tmargin:0px 0px 0px 0px;\n\t    \t\t\t}\n    \t\t\t</style>        \n                <div style='width:800px;margin:0 auto;' id='container'>\n                <table width='550'>\n                        <tr>\n                            <td colspan='1' align='right'><img src=" . getLogoLocation() . " width=\"610\" /><br /><br />{$arrCamposBloque['0']}</td>\n                        </tr>\n                        <tr>\n                            <td align='center' colspan='2'>{$arrCamposBloque['1']} {$arrCamposBloque['2']} {$reemplaza_a}</td>\n                        </tr>\n                </table>\n                \n                <!--datos generales-->                \n                \n                <table width='550' CELLPADDING='0'>\n                    <thead>\n                        <tr>\n                            <th colspan='4' align='left' height='10'>{$arrCamposBloque['3']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                    <tr>\n                        <td width='80'>Tomador:</td>\n                        <td>{$arrCamposBloque['4']}</td>\n                        <td width='80'>Asegurado:</td>\n                        <td>{$arrCamposBloque['5']}</td>\n                    </tr>\n                    <tr>\n                        <td width='80'>P&oacute;liza Nro:</td>\n                        <td>{$arrCamposBloque['6']}</td>\n                        <td width='80'>Certificado Nro:</td>\n                        <td>{$arrCamposBloque['7']}</td>\n                    </tr>\n                    <tr>\n                        <td width='80'>Nro. Siniestro:</td>\n                        <td>{$arrCamposBloque['8']}</td>\n                        <td width='80'>Fecha Ocurrencia:</td>\n                        <td>{$arrCamposBloque['9']}</td>\n                    </tr>\n                    <tr>\n                        <td>Analista:</td>\n                        <td>{$arrCamposBloque['10']}</td>\n                        <td></td>\n                        <td></td>\n                    </tr>\n                    </tbody>\n                    \n                </table>\n                \n                 <!--datos del vehiculo-->  \n                \n                <table width='600' CELLPADDING='0'>\n                    <thead>\n                        <tr>\n                            <th colspan='3' align='left' height='10'>{$arrCamposBloque['11']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>\n                            <td width='50'><label>A&ntilde;o:</label></td>\n                            <td>{$arrCamposBloque['12']}</td>\n                            <td width='50'><label>Marca:</label></td>\n                            <td>{$arrCamposBloque['13']}</td>\n                        </tr>\n                        <tr>\n                            <td width='50'><label>Modelo:</label></td>\n                            <td>{$arrCamposBloque['14']}</td>\n                            <td width='50'><label>L&iacute;nea:</label></td>\n                            <td>{$arrCamposBloque['15']}</td>\n                        </tr>\n                        <tr>\n                            <td width='50'><label>Transmisi&oacute;n:</label></td>\n                            <td></td>\n                            <td width='50'><label>Placa:</label></td>\n                            <td>{$arrCamposBloque['17']}</td>\n                        </tr>\n                        <tr>\n                            <td width='50'><label>Serial:</label></td>\n                            <td>{$arrCamposBloque['19']}</td>\n                            <td width='50'><label></label></td>\n                            <td></td>\n                        </tr>\n                    </tbody>\n                </table>\n                \n                <!--datos de ajuste-->  \n        \n                <table width='550'>\n                    <thead>\n                        <tr>\n                            <th  align='left' height='10'>{$arrCamposBloque['20']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>";
    if ($arrCamposBloque21 == 0) {
        $sContent .= "<td><strong>Observaciones:</strong><br />" . replaceBreakLine($arrCamposBloque[21]) . "</td></tr>";
    } else {
        $sContent .= "<td><strong>Observaciones:</strong><br /></td></tr>";
        for ($rds = 0; $rds < count($arrCamposBloque21); $rds++) {
            $sContent .= "<tr><td>" . replaceBreakLine($arrCamposBloque21[$rds]) . "</td></tr>";
        }
    }
    $sContent .= "\n                    </tbody>\n                </table>\n                \n                <!--datos proveedor-->\n                \n                <table width='550'>\n                    <thead>\n                        <tr>\n                            <th align='left' height='10' colspan='2'>{$arrCamposBloque['22']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>\n                            <td  width='80'><label>Nombre:</label></td>\n                            <td><strong>{$arrCamposBloque['23']}</strong></td>\n                        </tr>\n                    </tbody>\n                </table>\n                \n                <!--sirvase...-->\n                \n                <table width='540'>\n                    <thead>\n                        <tr>\n                            <th align='left' colspan='2'>{$arrCamposBloque['24']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>\n                            <td  width='80'><label>Nombre:</label></td>\n                            <td>{$arrCamposBloque['25']}</td>\n                        </tr>\n                        <tr>    \n                            <td  width='80'><label>Direcci&oacute;n:</label></td>\n                            <td>{$arrCamposBloque['26']}</td>\n                        </tr>\n                        <tr>\n                            <td  width='80'><label>Persona Contacto:</label></td>\n                            <td>{$arrCamposBloque['27']}</td>\n                        </tr>\n                        <tr>      \n                            <td  width='80'><label>Tel&eacute;fono:</label></td>\n                            <td>{$arrCamposBloque['28']}</td>\n                        </tr>\n                    </tbody>\n                </table>\n               \n                <!--  -->\n    \n                <table width='550'>\n                    <!--<thead><tr>-->\n                        <!--<tr><td><strong>{$arrCamposBloque['29']} PRUEBA5</strong></td></tr>-->\n                        <!--<td><strong>{$arrCamposBloque['30']}</strong></td>-->\n                       <!-- <td><strong>{$arrCamposBloque['31']}</strong></td>-->\n                    <!--</tr></thead>-->";
    /////////////
    for ($nroMO = 0; $nroMO < count($arrItemsBloque); $nroMO++) {
        $items = $arrItemsBloque[$nroMO];
        /*echo "<pre>";
          print_r($items);
          echo "</pre>";die;*/
        //------------
        //divido observaciones en bloques de 2500 caracteres  las observaciones
        $items[0] = "<strong>{$arrCamposBloque['29']} " . ($nroMO + 1) . ":</strong>" . $items[0];
        if (strlen($items[0]) > 125) {
            $itemSeg = wordwrap($items[0], 125, "@@@@@");
            $itemSeg = explode('@@@@@', $itemSeg);
        } else {
            $itemSeg = 0;
        }
        //------------
        if ($itemSeg == 0) {
            $sContent .= "<tr><td width='450'>" . replaceBreakLine($items[0]) . "</td></tr>";
        } else {
            // $sContent .= "<tr>
            //                   <td><table border=1 >";
            for ($rdx = 0; $rdx < count($itemSeg); $rdx++) {
                if ($rdx == 0) {
                    $sContent .= "<tr><td width='500'>" . replaceBreakLine($itemSeg[$rdx]) . "</td></tr>";
                } else {
                    $sContent .= "<tr><td width='500'>" . replaceBreakLine($itemSeg[$rdx]) . "</td></tr>";
                }
            }
        }
        $sContent .= "<tr><td class='nume' width='50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n                                              Total {$arrCamposBloque['29']} " . ($nroMO + 1) . "......................................................................................\n                                              BsF " . replaceBreakLine($items[1]) . "</td></tr>\n                                              <tr><td>&nbsp;&nbsp;&nbsp;</td></tr>";
        //------------
    }
    ////////////////
    /*foreach($arrItemsBloque as $items){
          $sContent .= "<tr>";
          if ($i++ % 2 == 0) { foreach($items as $item){ if ($i2++ == 1) {  $sContent .= "";$i3=0;//"<td class='nume2' style='background-color:#DDDDDD;' ><!--".replaceBreakLine($item)."--></td>";   }
                  else{  $sContent .= "<td class='nume' width='550'>".replaceBreakLine($item)."</td>";$i3=0;  }  }  
              } else{ foreach($items as $item){ if ($i3++ != 1) {  $sContent .= "<td class='nume' width='550'>".replaceBreakLine($item)."</td>";$i2=0;  }
                  else{ $sContent .= "";$i2=0;//"<td class='nume2'><!--".replaceBreakLine($item)."--></td>";$i2=0;  } } }
          
          $sContent .= "<td class='nume' width='550'>".replaceBreakLine($item)."</td>";
          $sContent .= "</tr>";                        
      }*/
    $sContent .= "</table>";
    $sContent .= "<BR>\n                \t\t<table><tr><td>\n                \t\t\t<table width='200' height='500'>\n                                <tr>\n                                    <td colspan='2' height='20'></td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['0']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[6]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['1']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[7]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['2']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[8]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['3']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[9]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['4']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[10]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['5']}</td>\n                                    <td class='nume2'>" . replaceBreakLine($arrTotales[11]) . "</td>\n                                </tr>\n                            </table>\n\t\t\t\t\t\t</td></tr></table>\n\t\t\t\t\t\t<table width='550' align='center'><tr><td align='center'>\n                            <table width='420'>    \n                            <tr>\n                            \t<td align='center'><img src=" . getSingLocation() . " width=\"60\" /><br />" . replaceBreakLine($arrTotales[13]) . "</td>\n                            </tr>\n                            </table>\n\t\t\t\t\t\t</td></tr></table>\n                            ";
    $sContent .= "</div></body></html>";
    return $sContent;
}
Пример #3
0
/**
 *
 * @param object $smarty objeto smarty.
 * @param array $arrCamposBloque arreglo con los campos.
 */
function getCamposTPL($arrCamposBloque, $arrItemsBloque, $arrTotales)
{
    $sContent = '<html>
                 <body>
                 <script type="text/php">
					if ( isset($pdf) ) { 
						$font = Font_Metrics::get_font("helvetica", "normal");    
						$pdf->page_text(560, 26, "{PAGE_NUM}/{PAGE_COUNT}", $font, 12, array(0,0,0));
						//Agrego los datos de la cabecera, en la primer pagina no se muestran
						$font = Font_Metrics::get_font("sans-serif", "normal");
						$pdf->page_text(245, 25,"{CABECERA}", $font, 10, array(0,0,0),0,0,"' . $arrCamposBloque[1] . " " . $arrCamposBloque[2] . '");
					} 
				</script>
                 ';
    //----------------------------
    //divido observaciones en bloques de 2500 caracteres  las observaciones
    if (strlen($arrCamposBloque[21]) > 125) {
        $arrCamposBloque21 = wordwrap($arrCamposBloque[21], 125, "@@@@@");
        $arrCamposBloque21 = explode('@@@@@', $arrCamposBloque21);
    } else {
        $arrCamposBloque21 = 0;
    }
    //----------------------------
    /*echo "<pre>";
      print_r($arrCamposBloque21);
      echo "</pre>";die;*/
    if ($arrCamposBloque[32] != '') {
        $reemplaza_a = "(REEMPLAZA A {$arrCamposBloque['1']} {$arrCamposBloque['32']})";
    } else {
        $reemplaza_a = "";
    }
    $sContent .= "\n                <style type='text/css'>\n                \tbody{\n                \t\tfont-size: 9pt;\n                \t\tfont-family: sans-serif;\n    \t\t\t\t}\n    \t\t\t\t.nume{\n    \t\t\t\t\ttext-align: right;\n    \t\t\t\t}\n    \t\t\t</style>        \n                <div style='width:800px;margin:0 auto;' id='container'>\n                <table width='550'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='1' align='right'><img src=" . getLogoLocation() . " width=\"610\" /><br /><br />{$arrCamposBloque['0']}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='center' colspan='2'>{$arrCamposBloque['1']} {$arrCamposBloque['2']} {$reemplaza_a}</td>\n\t\t\t\t\t</tr>\n                </table>\n                \n                <table width='550' CELLPADDING='0'>\n                    <thead>\n                        <tr>\n                            <th colspan='4' align='left' height='10'>{$arrCamposBloque['3']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                    <tr>\n                        <td  width='80'><label>Tomador:</label></td>\n                        <td>{$arrCamposBloque['4']}</td>\n                        <td  width='80'><label>Asegurado:</label></td>\n                        <td>{$arrCamposBloque['5']}</td>\n                    </tr>\n                    <tr>\n                        <td  width='80'><label>P&oacute;liza:</label></td>\n                        <td>{$arrCamposBloque['6']}</td>\n                        <td  width='80'><label>Certificado Nro:</label></td>\n                        <td>{$arrCamposBloque['7']}</td>\n                    </tr>\n                    <tr>\n                        <td  width='80'><label>Nro. Siniestro:</label></td>\n                        <td>{$arrCamposBloque['8']}</td>\n                        <td  width='80'><label>Fecha Ocurrencia:</label></td>\n                        <td>{$arrCamposBloque['9']}</td>\n                    </tr>\n                    <tr>\n                        <td><label>Analista:</label></td>\n                        <td>{$arrCamposBloque['10']}</td>\n                    </tr>\n                    </tbody>\n                </table>\n                <table width='600' CELLPADDING='0'>\n                    <thead>\n                        <tr>\n                            <th colspan='3' align='left' height='10'>{$arrCamposBloque['11']}</th>\n                        </tr>\n                    </thead>\n                        <tbody>\n                            <tr>\n                                <td width='50'><label>A&ntilde;o:</label></td>\n                                <td>{$arrCamposBloque['12']}</td>\n                                <td width='50'><label>Marca:</label></td>\n                                <td>{$arrCamposBloque['13']}</td>\n                            </tr>\n                            <tr>\n                                <td width='50'><label>Modelo:</label></td>\n                                <td>{$arrCamposBloque['14']}</td>\n                                <td width='50'><label>L&iacute;nea:</label></td>\n                                <td>{$arrCamposBloque['15']}</td>\n                            </tr>\n                            <tr>\n                                <td width='50'><label>Transmisi&oacute;n:</label></td>\n                                <td></td>\n                                <td width='50'><label>Placa:</label></td>\n                                <td>{$arrCamposBloque['17']}</td>\n                            </tr>\n                            <tr>\n                                <td width='50'><label>Serial:</label></td>\n                                <td>{$arrCamposBloque['19']}</td>\n                                <td width='50'><label></label></td>\n                                <td></td>\n                            </tr>\n                        </tbody>\n                    </table>\n                \n        \n\t\t\t\t<table width='550'>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th  align='left' height='10'>{$arrCamposBloque['20']}</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>";
    if ($arrCamposBloque21 == 0) {
        $sContent .= "<td><strong>Observaciones:</strong><br />" . replaceBreakLine($arrCamposBloque[21]) . "</td></tr>";
    } else {
        $sContent .= "<td><strong>Observaciones:</strong><br /></td></tr>";
        for ($rds = 0; $rds < count($arrCamposBloque21); $rds++) {
            $sContent .= "<tr><td>" . replaceBreakLine($arrCamposBloque21[$rds]) . "</td></tr>";
        }
    }
    $sContent .= "\n                    </tbody>\n \t\t\t\t</table>\n        \n                <table width='600'>\n                    <thead>\n                        <tr>\n                            <th align='left' height='10' colspan='2'>{$arrCamposBloque['22']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>\n                            <td  width='80'><label>Nombre:</label></td>\n                            <td><strong>{$arrCamposBloque['23']}</strong></td>\n                        </tr>\n                    </tbody>\n                </table>\n        \n                <table width='540'>\n                    <thead>\n                        <tr>\n                            <th align='left' colspan='2'>{$arrCamposBloque['24']}</th>\n                        </tr>\n                    </thead>\n                    <tbody>\n                        <tr>\n                            <td  width='80'><label>Nombre:</label></td>\n                            <td>{$arrCamposBloque['25']}</td>\n                        </tr>\n                        <tr>    \n                            <td  width='80'><label>Direcci&oacute;n:</label></td>\n                            <td>{$arrCamposBloque['26']}</td>\n                        </tr>\n                        <tr>\n                            <td  width='80'><label>Persona Contacto:</label></td>\n                            <td>{$arrCamposBloque['27']}</td>\n                        </tr>\n                        <tr>      \n                            <td  width='80'><label>Tel&eacute;fono:</label></td>\n                            <td>{$arrCamposBloque['28']}</td>\n                        </tr>\n                    </tbody>\n                </table>\n\n                <table width='400'>\n                    <thead><tr>\n                        <td width='50'><strong>{$arrCamposBloque['29']}</strong></td>\n                        <td><strong>{$arrCamposBloque['30']}</strong></td>\n                         <td class='nume' width='60'><strong>{$arrCamposBloque['31']}</strong></td>\n                    </tr></thead>";
    foreach ($arrItemsBloque as $items) {
        $sContent .= "<tbody><tr>";
        if ($i++ % 2 == 0) {
            foreach ($items as $item) {
                $i2++;
                if ($i2 == 1 || $i2 == 2) {
                    $sContent .= "<td>{$item}</td>";
                    $i3 = 0;
                } else {
                    $sContent .= "<td class='nume'>{$item}</td>";
                    $i3 = 0;
                }
            }
        } else {
            foreach ($items as $item) {
                $i3++;
                if ($i3 == 1 || $i3 == 2) {
                    $sContent .= "<td>{$item}</td>";
                    $i2 = 0;
                } else {
                    $sContent .= "<td class='nume'>{$item}</td>";
                    $i2 = 0;
                }
            }
        }
        $sContent .= "</tr></tbody>";
    }
    $sContent .= "</table>";
    $sContent .= "<BR>\n                \t\t<table><tr><td>\n                \t\t\t<table width='200' height='500'>\n                                <tr>\n                                    <td colspan='2' height='20'></td>\n                                    \n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['0']}</td>\n                                    <td class='nume'>" . replaceBreakLine($arrTotales[5]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['1']}</td>\n                                    <td class='nume'>" . replaceBreakLine($arrTotales[6]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['2']}</td>\n                                    <td class='nume'>" . replaceBreakLine($arrTotales[7]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['3']}</td>\n                                    <td class='nume'>" . replaceBreakLine($arrTotales[8]) . "</td>\n                                </tr>\n                                <tr>\n                                    <td>{$arrTotales['4']}</td>\n                                    <td class='nume'>" . replaceBreakLine($arrTotales[9]) . "</td>\n                                </tr>\n                            </table>\n\t\t\t\t\t\t</td></tr></table>\n\t\t\t\t\t\t<table width='550' align='center'><tr><td align='center'>\n                            <table width='400'> \n                            \t<tr>\n                                    <td align='center'><img src=" . getSingLocation() . " width=\"60\" /><br />" . replaceBreakLine($arrTotales[10]) . "</td>\n                                </tr>\n                            </table>\n\t\t\t\t\t\t</td></tr></table>";
    $sContent .= '</div></body></html>';
    return $sContent;
}