Exemplo n.º 1
0
function cargar_plantilla()
{
    $plantila = "";
    if ($_REQUEST["parte"] == 0) {
        //cabecera
        $asunto = $_REQUEST["asu"];
        $referencia = $_REQUEST["ref"];
        $numero = ObtenerNumeroDocumento($_REQUEST["tipo"]);
        $destinatario = strtoupper($_REQUEST["remit"]);
        $cargo = strtoupper($_REQUEST["cargo"]);
        $fecha = ObtenerFecha();
        $abreviatura = ObtenerAbreviaturaArea();
        $sql = "Select contenido \r\n\t\t\t\tFROM plantilla \r\n\t\t\t\tWHERE tipo_documento=" . $_REQUEST['tipo'] . " \r\n\t\t\t\tand cabecera_pie = 0";
        $query_sql = new Consulta($sql);
        $row = $query_sql->verRegistro();
        $plantilla = $row["contenido"];
        $plantilla = str_replace("txtasunto", $asunto, $plantilla);
        $plantilla = str_replace("txtreferencia", $referencia, $plantilla);
        $plantilla = str_replace("txtnumero", $numero, $plantilla);
        $plantilla = str_replace("txtdestinatario", $destinatario, $plantilla);
        $plantilla = str_replace("txtfecha", $fecha, $plantilla);
        $plantilla = str_replace("txtabreviatura", $abreviatura, $plantilla);
        $plantilla = str_replace("txtcargo", $cargo, $plantilla);
        echo $plantilla;
    } else {
        $jefe = new Usuario(ObtenerJefe());
        $nombre = $jefe->getNombreCompleto();
        $iniciales = $jefe->getIniciales();
        $cargo = $jefe->getCargo();
        $usuario = new Usuario($_SESSION['session'][0]);
        $sql = "Select contenido\r\n\t\t\t\tFROM plantilla\r\n\t\t\t\tWHERE tipo_documento=" . $_REQUEST['tipo'] . "\r\n\t\t\t\tand cabecera_pie=1";
        $query_sql = new Consulta($sql);
        $row = $query_sql->verRegistro();
        $plantilla = $row["contenido"];
        $plantilla = str_replace("txtjefe", $nombre, $plantilla);
        $plantilla = str_replace("txtcargo", $cargo, $plantilla);
        $plantilla = str_replace("txtiniciales", $iniciales, $plantilla);
        $plantilla = str_replace("txtusuario", $usuario->getIniciales(), $plantilla);
        echo $plantilla;
    }
}
Exemplo n.º 2
0
 MÚLTIPLE <?php 
    }
    ?>
 SGD  N&ordm;
							<?php 
    if (empty($codigo)) {
        ?>
<span id = "codigo" style="color:#FFFFFF;"> 00000-2009</span><?php 
    } else {
        echo $codigo;
    }
    ?>
-SERNANP-
       		                </strong>
       		                <?php 
    echo ObtenerAbreviaturaArea();
    ?>
	                	</h1>
                  		<p>Se&ntilde;or<p/>
						 <?php 
    if (sizeof($_REQUEST["destinatario"]) > 0) {
        for ($j = 0; $j < sizeof($_REQUEST['destinatario']); $j++) {
            ?>
						<p>
                      		<strong><?php 
            echo strtoupper($_REQUEST["destinatario"][$j]);
            ?>
</strong><br />
							<strong><?php 
            echo strtoupper($_REQUEST["cargo"][$j]);
            ?>