Ver Mensaje Individual
  #14 (permalink)  
Antiguo 23/10/2014, 10:34
Ds1988
 
Fecha de Ingreso: octubre-2014
Mensajes: 12
Antigüedad: 9 años, 6 meses
Puntos: 0
Respuesta: Crear formulario en PHP para emitir boletas y PDF y ese se guarde en el F

Cita:
Iniciado por martin_zalazar Ver Mensaje
Aver , mandame el archivo pdf.php. sin tenes tus password y user sacalos. quiero ver ese archivo.
Código PHP:
<?php


$ftp_server
="192.168.20.237";
$ftp_user="xxxxxx";
$ftp_pass="xxxxxx";
$file "ftp://192.168.20.237/ftp_shares/boletas/";//archivo a subir
$remote_file "ftp://192.168.20.237/ftp_shares/boletas/";

// Establecer una conexión básica 
$conn_id ftp_connect($ftp_server);

// Iniciar sesión con nombre de usuario y contraseña 
$login_result ftp_login($conn_id$ftp_user$ftp_pass);

// Cargar un archivo
if (ftp_put($conn_id$remote_file$fileFTP_ASCII)) {
echo 
"Archivo subido con exito $file\n";
exit;
} else {
echo 
"hubo un problema al subir $file\n";
exit;
}
//Cerrar conexion
ftp_close($conn_id);

require(
'fpdf/fpdf.php');

$nombrepdf $_POST['savePDF'];

class 
PDF extends FPDF {
//Cabecera de página
function Header() {
//Logo
$this->Image('image/logo.png',10,8,33);
//Arial bold 15
$this->SetFont('Arial','B',15);
//Movernos a la derecha
$this->Cell(80);
//Título
$this->Cell(60,10,'Test, HOLA REINALDO',1,0,'C');
//Salto de línea
$this->Ln(20); 
}

//Pie de página
function Footer() {
//Posición: a 1,5 cm del final
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Número de página
$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
}
}
//Creación del objeto de la clase heredada
$pdf=new PDF();
$pdf->AddPage();

$pdf->SetFont('Arial','B',0);
$pdf->Ln(22);
$pdf->SetX(45);

$pdf->Output('ftp://192.168.20.237/ftp_shares/boletas/' $nombrepdf.'.pdf''F');

exit; 

?>