CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Código Personalizado

Print topic Send  topic

Author Message
Akarola

Posts: 1
Posted: 02/28/2017, 11:14 AM

Antes que todo mis disculpas, pero tenia una duda con respecto al codecharge y el uso de codigo personalizado, estoy trabajando con la inserción de un archivo pdf (con información previa) en la base de datos (Url), al consultar el mismo archivo, a este le agrego en el encabezado los datos de la persona que inicio sesión (mediante variables previamente guardadas mediante $_SESSION.

Mas como nueva usuaria de este sistema no se exactamente donde de manera automatizada el codecharge genera el enlace de la consulta.

Esto con el fin de obtener la ruta y anexarla aqui:


<?php
require_once('FPDI/fpdf.php');
require_once('FPDI/fpdi.php');
define('FPDF_FONTPATH','../FPDI/font/');
session_start();



// Crear la imagen
$im = imagecreatetruecolor(1200, 50);

// Crear algunos colores
$blanco = imagecolorallocate($im, 255, 255, 255);
$gris = imagecolorallocate($im, 128, 128, 128);
$gris2 = imagecolorallocate($im, 17, 17, 17);
$negro = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 1200, 50, $blanco);

// El texto a pintar
$texto = 'usuario:'.$_SESSION["s_username"].' - cedula:'.$_SESSION["s_cedula"].' - escuela:'.$_SESSION["s_escuela"];
// Reemplaze la ruta con su propio ruta a la fuente
$fuente = 'times.ttf';

// Agregar el texto
imagettftext($im, 20, 0, 20, 20, $gris2, $fuente, $texto);

// Usar imagepng() resulta en texto más claro, en comparación con imagejpeg()
imagepng($im,"yo.png");
imagedestroy($im);




class PDF extends FPDI
{
function Footer()
{
// Positionnement à 1,5 cm du bas
$this->SetY(-15);
// Police Arial italique 8
// $this->SetFont('Arial','I',8);
// Numéro de page
//$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
$this->Image('yo.png',40,10,140);
}
}


$pdf = new PDF();
$pagecount = $pdf->setSourceFile('../RUTA-QUE-NECESITO-OBTENER');
//$pdf->SetFont('../FPDI/font/calligra.ttf','',12);
$pdf->addPage();
for ($n = 1; $n <= $pagecount; $n++)
{
$tplIdx = $pdf->importPage($n, '/MediaBox');
//$tplIdx = $pdf->importPage($n);
$pdf->useTemplate($tplIdx, 10, 10, 180);
if ($n != $pagecount) {
$pdf->AddPage();
}
}
$cedula= $_SESSION["s_cedula"];
$archivopdf=$cedula.'.pdf';
$pdf->Output($archivopdf,'I');

?>
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 03/03/2017, 12:53 PM

Translated online (Espanola)
" Before all my apologies, but I had a doubt regarding the codecharge and the use of custom code, I am working with the insertion of a pdf file (with previous information) in the database (Url), when consulting the same file, To this I add in the header the data of the person who logs in (using variables previously saved using $ _SESSION.

But as a new user of this system is not exactly where in an automated way the codecharge generates the link of the query.

This in order to get the route and append it here:"


I think the question is why isn't the session variable being appended to the username or if it is why isn't the .pdf with that filename outputting ?
_________________
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.