<?php use_helper( 'UrlFunctions' ); ?>
<?php use_helper( 'IncludePartial' ); ?>
<?php use_helper( 'UtilFunctions' ); ?>

<!-- Required scripts -->
<script type="text/javascript" src="<?=Constantes::ROOT_DIR_APP?>web/js/qztray/dependencies/rsvp-3.1.0.min.js"></script>
<script type="text/javascript" src="<?=Constantes::ROOT_DIR_APP?>web/js/qztray/dependencies/sha-256.min.js"></script>
<script type="text/javascript" src="<?=Constantes::ROOT_DIR_APP?>web/js/qztray/qz-tray.js"></script>

<div class="titleBody descripProy">
    <ul>
        <li>
            <?=$s_Titulo?>
        </li>
    </ul>
</div>
<style>
html, body{
    height: 100%;
}
body{
    margin-right: 5px;
}
label
{
    margin-right: 0;
}
.grid
{
    background-color: none;

    border-top: 1px solid #77d5f7;
    border-left: 1px solid #77d5f7;
    
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    
    border-bottom-right-radius: 5px; 
    border-bottom-left-radius: 5px;
    <?php if( $s_Imprimir ){ ?>
    font-size:60% !important;
    <?php } ?>
}
.grid th 
{
    border-right: 1px solid #77d5f7;
    border-bottom: 1px solid #77d5f7;
    background-color: #0a7db1;
    font-weight: normal;
    font-family: Verdana,Arial,sans-serif;
    height: 24px;
    padding: 0 2px;
    
    font-size:100%;
}
.grid td 
{
    border-right: 1px solid #77d5f7;
    border-bottom: 1px solid #77d5f7;
    padding: 0 2px;
    /*white-space: pre;*/
    height: 22px;
}
select{ padding: 2px; }
.ui-draggable-helper 
{
    border: 1px dotted #000;
    padding: 6px;
    background: #fff;
    font-size: 1.2em;
}
.stateHighlight {
    /*border: 1px solid #fcefa1;*/
    background-color: #FFC45F;
    color: #363636;
}

.stateActive {
    /*border: 1px solid #aaaaaa;*/
    background-color: #005EA8;
    font-weight: normal;
    color: #212121;
}
</style>
<script type="text/javascript">
buscarDocumentosEmitidos = function()
{
    
	var s_param = $( '#form1' ).serialize();
    console.log( s_param );
	blockContent( 'content_grid_docs' );
    executeAjaxUpdater
    ( 
        "content_grid_docs", 
        "<?=buildUrl( 'transporte/gridDocs' )?>", 
        s_param, 
        function()
        {
        	unBlockContent( 'content_grid_docs' );
            
        }
    );
}
mostrarConsolidadoDocumento = function( DocRef, Tipo )
{
    $( '#myIframe' ).attr( 'src', '<?=buildUrl( 'transporte/resumeRouting', "DocRef=" )?>' + DocRef + "/Tipo/" + Tipo );
    $( '#dialog' ).dialog( 'open' );
}
</script>
<div style="height: 35%; overflow: hidden;">
    <div style="">
        <form action="" method="post" name="form1" id="form1">
            <table class="marco" style="background:#E3E9E2" width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center">
                        <table width="99%" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td nowrap="nowrap">
                                    <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                                         <tr>
                                             <td nowrap="nowrap"><label for="" class="label">Documento:</label></td>
                                            <td nowrap="nowrap">
                                                <?php /*crearCombo( array( "name"=>"DocumentoSerie", "style"=>"width:40%" ), $a_Serie )*/ ?>
                                                <select id="IdTipoDocumento" name="IdTipoDocumento"> 
                                                <option value="" >---</option>
                                                <?php foreach ($a_GSS_SucursalDocumentoFN as $Data) {
                                                    $NombreDocumento = new VTA_TipoDocumentoFN();
                                                    $o_NombredocumentoBN = $NombreDocumento->selectByPK($Data->getIdTipoDocumento());
                                                if( $o_NombredocumentoBN->getGenerarProvisionFlag() != "S" )
                                                    {
                                                        continue;
                                                    }
                                                    ?>
                                                	<option value="<?=$Data->getIdTipoDocumento(); ?>" ><?= $o_NombredocumentoBN->getDescripcionLocal();?></option> 
                                                	<?php }?>
                                                </select>
                                                <input type="text" class="text" name="NumeroComprobante" id="NumeroComprobante" style="text-align:center;width:50%">
                                            </td>
                                            
                                            <td nowrap="nowrap"><label for="ClienteNombre" class="label">Cliente:</label></td>
                                            <td nowrap="nowrap"><input type="text" class="text" name="ClienteNombre" id="ClienteNombre" style="text-align:center;"></td>
                                            
                                            <td nowrap="nowrap"><label for="IdAlmacen" class="label">Almacen:</label></td>
                                            <td nowrap="nowrap">
                                            <?php /*crearCombo( array( "name"=>"IdAlmacen", "ParamId"=>"getIdAlmacen", "ParamDesc"=>"getDescripcionLocal", "option"=>false ), $a_ALM_AlmacenMast )*/
                                                $o_ALM_AlmacenMastFN = new ALM_AlmacenMastFN();
                                                $o_ALM_AlmacenMastFN->setEstado("A");
                                                $a_ALM_AlmacenMastFN = $o_ALM_AlmacenMastFN->select(); 
                                            ?>
                                            <select id="AlmacenDespacho" name="AlmacenDespacho">
                                            <?php
                                            foreach ($a_ALM_AlmacenMastFN as $data )
                                                { 
                                                    if ($data->getIdSucursal() != myUser::getUser()->getIdSucursal()) { ?>
                                                    
                                                    <option value="<?= $data->getIdAlmacen(); ?>" ><?=$data->getDescripcionLocal(); ?></option>
                                                       
                                                    <?php } } ?> 
                                                
                                            </select>
                                            </td>
                                            
                                            <td nowrap="nowrap"><label for="FechaDocumento" class="label">Fecha Emisi&oacute;n:</label></td>
                                            <td nowrap="nowrap">
                                                <input type="text" class="text" name="FechaDocumento" id="FechaDocumento" style="text-align:center;" value="" placeholder="aaaa-mm-dd">
                                                <script type="text/javascript">
                                                $( "#FechaDocumento" ).datepicker( { dateFormat: "yy-mm-dd", changeYear:true, yearRange: "-0:+0", changeMonth: true, onClose: function (){ this.focus(); } } );
                                                </script>
                                            </td>
                                            
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        <input type="button" onclick="buscarDocumentosEmitidos();" value="Buscar" class="button">
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div id="content_grid_docs" style="overflow: auto; height: 90%;">        
    </div>
    <div style=" height: 20%;">&nbsp;</div>
</div>
<script>
eventoChangeTurno = function()
{
    recuperarComboxTipo( 'lstVehiculo', 0 );
    recuperarComboxTipo( 'lstChofer', 0 );
}
recuperarComboxTipo = function( TipoProc, TipoGet )
{
    $( "#content_grid_rutas" ).html( $( "#content_grid_rutas_clean" ).html() );
    
	mostrarCargaImg();
	var FechaProgramada = $( "#RutaFechaProgramada" ).val();
    var Turno           = $( "#IdTurno" ).val();
    var s_param_ajax    = "FechaProgramada=" + FechaProgramada + "&Turno=" + Turno;
    if( TipoGet == 1 )
    {
        var Vehiculo = $( "#IdVehiculo" ).val();
        s_param_ajax += "&Vehiculo=" + Vehiculo;
    }
    executeAjaxUpdater
    ( 
        TipoProc, 
        "<?php echo buildUrl( 'transporte/request' ) ?>", 
        s_param_ajax + "&TipoProc=" + TipoProc, 
        function( response )
        {
        	ocultarCargaImg();
        } 
    );
}
</script>
<div style="">
    <div>
        <form action="" method="post" name="form2" id="form2">
            <table class="marco" style="background:#E3E9E2" width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" width="80%">
                        <table width="99%" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td>RUTA DE DESPACHO :</td>
                                <td nowrap="nowrap">
                                    <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                                         <tr>
                                            <td nowrap="nowrap" width="30%" align="right"><label for="RutaFechaProgramada" class="label">Turno:</label></td>
                                            <td nowrap="nowrap">
                                                <input type="text" class="text" name="RutaFechaProgramada" id="RutaFechaProgramada" size="12" style="text-align:center;" value="<?=date( "Y-m-d" )?>">
                                                <script type="text/javascript">
                                                $( "#RutaFechaProgramada" ).datepicker
                                                (
                                                    { 
                                                        dateFormat: "yy-mm-dd", changeYear:true, yearRange: "-0:+1", changeMonth: true, 
                                                        onClose: function ()
                                                        { 
                                                            this.focus();  
                                                        },
                                                        onSelect: function()
                                                        {
                                                            $( "#IdTurno" ).val( "" );
                                                        }
                                                    }
                                                );
                                                </script>
                                                <?=crearCombo( array( "name"=>"IdTurno", "ParamId"=>"getIdTurno", "ParamDesc"=>"getTurnoDescripcion", "style"=>"", "onchange"=>"", "seleccione"=>"-----" ), TR_TurnoFN::selectActivos() )?>
                                                <!-- eventoChangeTurno();-->
                                            </td>
                                            <td nowrap="nowrap"><label for="" class="label">Placa:</label></td>
                                            <td nowrap="nowrap">
                                                <div id="lstVehiculo">
                                                    <?=crearCombo( array( "name"=>"IdVehiculo", "ParamId"=>"getIdVehiculo", "ParamDesc"=>"getVehiculoPlaca", "style"=>"width:80%;" ), TR_VehiculoFN::selectActivos() )?></div>
                                                </td>
                                            <td nowrap="nowrap"><label for="" class="label">Chofer:</label></td>
                                            <td nowrap="nowrap">
                                                <div id="lstChofer">
                                                    <?=crearCombo( array( "name"=>"IdChofer", "ParamId"=>"getIdChofer", "ParamDesc"=>"getChoferNombre", "style"=>"width:70%;" ), TR_ChoferFN::selectActivos() )?>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td width="10%" align="center">
                    	<input type="button" value="Listar Rutas" class="button" onclick="listarRutas();">
                    	<input type="button" value="Nuevo Ruta" class="button" onclick="nuevoRuta();">
                  	</td>
                    <td width="2%" align="center"><div id="s_ImagenLoad" style="display: none;"><img src="<?php echo Constantes::ROOT_DIR_IMG ?>common/progress.gif" border="0"/></div></td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
nuevoRuta = function()
{
	//validar parametros:

	if( $( "#RutaFechaProgramada" ).val() == ""  )
	{
		alert( "Debe de seleccionar una fecha de programacion." );
	}
	if( $( "#RutaFechaProgramada" ).val() == ""  )
	{
		alert( "Debe de seleccionar una fecha de programacion." );
	}
	if( $( "#RutaFechaProgramada" ).val() == ""  )
	{
		alert( "Debe de seleccionar una fecha de programacion." );
	}
	
	
	x = confirm( "Esta seguro de crear una nueva ruta? " );
	if( x )
	{
		var s_param = $( '#form2' ).serialize();

		blockContent( 'content_grid_rutas' );
		mostrarCargaImg();
		
    	executeAjaxJson
        ( 
            "<?php echo buildUrl( 'transporte/newRouting' ) ?>", 
            s_param,
            function( o_json )
            {
                console.log( o_json );
                //unBlockContent( "jqGrid" );
                ocultarCargaImg();
                if( o_json.error )
                {
                	unBlockContent( 'content_grid_rutas' );
                	ocultarCargaImg();
                    return false;
                }
                buscarRutaAsignada( o_json.IdRuta );
            } 
    	);
	}
}

buscarRutaAsignada = function( IdRuta )
{
	var s_param = $( '#form2' ).serialize();

    s_param += "&IdRuta=" + IdRuta;

    console.log( s_param ); 
    
	blockContent( 'content_grid_rutas' );
	mostrarCargaImg();
    
    executeAjaxUpdater
    ( 
        "content_grid_rutas", 
        "<?=buildUrl( 'transporte/gridRouting' )?>", 
        s_param, 
        function()
        {
        	unBlockContent( 'content_grid_rutas' );
        	ocultarCargaImg();
        }
    );
}
</script>
<div style="height: 60%" id="content_grid_rutas">
    <div style="text-align: end;">
        <table cellspacing="0" cellpadding="0" border="0" width="" style="float: right;">
            <tr>
                <td><span class="labelData" style="margin-right: 10px;"><b>RUTA Nro: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b></span></td>
                <td><span class="labelData" style="margin-right: 10px;"><b>CHOFER: ------ </b></span></td>
                <td><span class="labelData" style="margin-right: 10px;"><b>ESTADO: <label style="color:red;">------</label></b></span></td>
                <td style="width: 18px;"><span style='cursor:pointer; margin: 0 auto;' class='ui-icon ui-icon-document' title='Consolidado' onclick=''></span></td>
                <td style="width: 18px;"><span style='cursor:pointer; margin: 0 auto;' class='ui-icon ui-icon-locked' title='' onclick=''></span></td>
                <td style="width: 18px;"> &nbsp; </td>
            </tr>
        </table>
    </div>
    <div id="droppable" class="" style="display: inline-block; width: 100%; height: 90%;">
        <table class="grid" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="border-bottom: medium none;">
            <tr>
                <th width="1%" align="center" style="border-top-left-radius: 5px;" >&nbsp;</th>
                <th width="8%" align="center" nowrap>Nro Doc</th>
                <th width="20%" align="center" nowrap>Cliente</th>
                <th width="10%" align="center" nowrap>Distrito</th>
                <th width="20%" align="center" nowrap>Direcci&oacute;n</th>
                <th width="5%" align="center" style="border-top-right-radius: 5px;"> &nbsp; </th>
            </tr>
        </table>
    </div>
</div>

<div style="display:none;" id="content_grid_rutas_clean" >
    <div style="text-align: end;">
        <table cellspacing="0" cellpadding="0" border="0" width="" style="float: right;">
            <tr>
                <td><span class="labelData" style="margin-right: 10px;"><b>RUTA Nro: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b></span></td>
                <td><span class="labelData" style="margin-right: 10px;"><b>CHOFER: ------ </b></span></td>
                <td><span class="labelData" style="margin-right: 10px;"><b>ESTADO: <label style="color:red;">------</label></b></span></td>
                <td style="width: 18px;"><span style='cursor:pointer; margin: 0 auto;' class='ui-icon ui-icon-document' title='Consolidado' onclick=''></span></td>
                <td style="width: 18px;"><span style='cursor:pointer; margin: 0 auto;' class='ui-icon ui-icon-locked' title='' onclick=''></span></td>
                <td style="width: 18px;"> &nbsp; </td>
            </tr>
        </table>
    </div>
    <div id="droppable" class="" style="display: inline-block; width: 100%; height: 90%;">
        <table class="grid" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="border-bottom: medium none;">
            <tr>
                <th width="1%" align="center" style="border-top-left-radius: 5px;" >&nbsp;</th>
                <th width="8%" align="center" nowrap>Nro Doc</th>
                <th width="20%" align="center" nowrap>Cliente</th>
                <th width="10%" align="center" nowrap>Distrito</th>
                <th width="20%" align="center" nowrap>Direcci&oacute;n</th>
                <th width="5%" align="center" style="border-top-right-radius: 5px;"> &nbsp; </th>
            </tr>
        </table>
    </div>
</div>
<script type="text/javascript">
listarRutas = function()
{
	$( '#myIframe2' ).attr( 'src', '<?=buildUrl( 'transporte/listRouting' )?>' );
    $( '#dialog2' ).dialog( 'open' );
}

$( "#droppable" ).droppable
(
    {
    	accept      : "#content_grid_docs div",
		activeClass : "stateHighlight",
		hoverClass  : "stateActive",
        drop        : function( event, ui ) 
        {
            console.log( "droppable" );
            console.log( arguments );

            var s_id_concat = $( ui.draggable[0] ).attr( "code" );
            var s_fechaProg = $( "#RutaFechaProgramada" ).val();
            var s_id_turno  = $( "#IdTurno" ).val();
            var s_id_vehicu = $( "#IdVehiculo" ).val();
            var s_id_chofer = $( "#IdChofer" ).val();
            
            if( s_fechaProg == "" )
            {
                alert( "Debe de seleccionar la Fecha para el Turno." );
                return false;
            }
            if( s_id_turno == "" )
            {
                alert( "Debe de seleccionar el Turno." );
                return false;
            }
            if( s_id_vehicu == "" )
            {
                alert( "Debe de seleccionar el Vehiculo." );
                return false;
            }
            if( s_id_chofer == "" )
            {
                alert( "Debe de seleccionar el Chofer." );
                return false;
            }

            var s_param_ajax = "IdDoc="+s_id_concat+"&FechaProg="+s_fechaProg+"&IdTurno="+s_id_turno+"&IdVehiculo="+s_id_vehicu+"&IdChofer="+s_id_chofer;
            console.log( s_param_ajax );

            return false;
            
            //blockContent( "jqGrid" );
            mostrarCargaImg();
            executeAjaxJson
            ( 
                "<?php echo buildUrl( 'transporte/saveRouting' ) ?>", 
                s_param_ajax,
                function( o_json )
                {
                    console.log( o_json );
                    //unBlockContent( "jqGrid" );
                    ocultarCargaImg();
                    if( o_json.error )
                    {
                        alert( o_json.mensaje_error );
                        return false;
                    }
                    
                } 
			);
            $( ui.helper ).remove(); //destroy clone
            //$( ui.draggable ).remove(); //remove from list
        }
    }
);
</script>

<?=crearFuentePopupIframe( array( "div_id"=>"dialog", "iframe_id"=>"myIframe", "popup_title"=>"Detalle del Documento", "popup_width"=>"700", "popup_height"=>"400", "modal"=>true ) )?>
<?=crearFuentePopupIframe( array( "div_id"=>"dialog2", "iframe_id"=>"myIframe2", "popup_title"=>"Listado de Rutas", "popup_width"=>"700", "popup_height"=>"400", "modal"=>true ) )?>
<?=crearFuentePopupIframe( array( "div_id"=>"dialog3", "iframe_id"=>"myIframe3", "popup_title"=>"Registrar Atencion", "modal"=>true ) )?>
<?=crearFuentePopupIframe( array( "div_id"=>"dialog4", "iframe_id"=>"myIframe4", "popup_title"=>"Imprimir Guia", "modal"=>true ) )?>
<script type="text/javascript">
closeWindow = function()
{
    $( '#dialog' ).dialog( 'close' );
    $( '#dialog2' ).dialog( 'close' );
    $( '#dialog3' ).dialog( 'close' );
    $( '#dialog4' ).dialog( 'close' );
}
</script>

<?php //pr($a_ALM_AlmacenMastFN);
/*
$postdata = http_build_query
(
    array
    (
        'var1' => 'some content',
        'var2' => 'doh'
    )
);
$opts = array
(
    'http' => array
    (
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);
$context  = stream_context_create( $opts );
$result = file_get_contents('http://petcenter.biz/pc/web/tmp/demo_print.txt', false, $context);
pr( $result );

$s_Contenido = file_get_contents( 'http://petcenter.biz/pc/web/tmp/demo_print.txt' );
pr( $s_Contenido );
*/
/*
function formato_linea_text( $a_Param=null )
{
    $i_LineaAncho = 95;
    $s_Tx = " ";
    
    $s_Text = "";
    
    for ( $i=1; $i<=95; $i++ )
    {
        $s_Text .= $s_Tx;
        if( $a_Param )
        {
            foreach ( $a_Param as $i_Key => $s_Value )
            {
                if( $i == $i_Key )
                {
                    $s_Text .= $s_Value;
                    $i_TamTexto = strlen( $s_Value );
                    $i = $i + $i_TamTexto;
                    $b_Control = false;
                }
            }
        }
    }
    return $s_Text;
}

$s_NombreArchivo = "0001-00000001";

$o_UtilImprimir = new UtilImprimir();
//$o_UtilImprimir->inicializar();
//$o_UtilImprimir->setAliniacion( 1 ); //centro
//$o_UtilImprimir->setNegrita( true ); //negrita
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 11=>"2016-10-06", 36=>"2016-10-06" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 5=>"Mz H7 Lote 2 Sector Villa San Luis Pamplo", 49=>"Mz H7 Lote 2 Sector Villa San Luis Pamplo" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 5=>"na Alta", 49=>"na Alta" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 21=>"William Lorenzo", 61=>"PRZ-15696", 82=>"Boleta" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 5=>"Taype Perez", 82=>"0001-00000012" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 12=>"10412883531" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"1", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"4", 12=>"UNI", 18=>"Fideos Tallarin 20/500 gr", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 6=>"25", 12=>"UNI", 18=>"Fideos Canuto Rayado 20/250 gr.", 74=>"100" ) )."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text()."\n" );
$o_UtilImprimir->addTexts( formato_linea_text( array( 46=>"Maria Laura Taype Serrano" ) )."\n" );

$o_UtilImprimir->saltoPagina();
$s_DirArchivo = $o_UtilImprimir->crearArchivoWeb( $s_NombreArchivo );

$s_DirArchivo = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR."tmp".DIRECTORY_SEPARATOR.$s_DirArchivo;
//pr( $s_text_print );
pr( $s_DirArchivo );

$s_Contenido = file_get_contents( $s_DirArchivo, FILE_USE_INCLUDE_PATH );
pr( $s_Contenido );
*/
/*
$printer = "EPSON FX-890 Ver 2.0";
$enlace  = printer_open( $printer );
printer_write( $enlace, $s_Contenido );
printer_close( $enlace );
*/
?>
