Salve a tutti,
stavo installando easyphp perchè ho necessità di fare alcune prove senza internet (devo spostarmi), Ho scaricato i miei file da remoto in locale, ho cambiato i file di connect, ma quando vado a fare la stampa del pdf mi da tutti errori e non stampa nulla... Lo stesso script su internet funziona PERFETTAMENTE... Dove sbaglio?
questi sono gli errori :
Codice:
Notice: A session had already been started - ignoring session_start() in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 2
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\connect.php on line 9
Notice: Undefined variable: image_dir in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt.php on line 38
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Undefined index: ragione2 in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt.php on line 63
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Use of undefined constant floor - assumed 'floor' in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt_pdf.php on line 161
Notice: Undefined variable: tab_tva in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\pdf\ddt.php on line 111
FPDF error: Some data has already been output, can't send PDF file
Mentre questa è la pagina che genera il ddt (ddt.php):
Codice PHP:
<?php
session_start();
define('FPDF_FONTPATH','font/');
require ('ddt_pdf.php');
include('connect.php');
// $_SESSION['causale']=$causale;
// $_SESSION['colli']=$colli;
// $_SESSION['porto']=$porto;
// $_SESSION['note']=$note;
if(isset($_POST['creapdf'])){
$barcode=$_POST['barcodeart_vecchi'];
$descrizione = $_POST['descrizione'];
$quantita=$_POST['quantita'];
$fornitore=$_POST['fornitore'];
$codice=$_POST['codice'];
$um=$_POST['UM'];
$reparto=$_POST['reparto'];
$prezzo = $_POST['prezzo'];
$scontoperc=$_POST['scontoperc'];
$scontoval=$_POST['scontoval'];
$prezzosconto=$_POST['prezzosconto'];
$causale=$_POST['causale'];
$colli=$_POST['colli'];
$porto=$_POST['porto'];
$note=$_POST['note'];
$vettore=$_POST['vettore'];
$_SESSION['vettore']=$vettore;
$_SESSION['causale']=$causale;
$_SESSION['colli']=$colli;
$_SESSION['porto']=$porto;
$_SESSION['note']=$note;
$message = "";
$border = "0";
//provo in pfd
$pdf = new INVOICE( 'P', 'mm', 'A4' );
$pdf->Open();
$pdf->AddPage();
if( file_exists ( "$image_dir/esteso.txt" ))
$pdf->SetLogo('images/logo.png',1);
else {
$pdf->SetLogo('images/logo.png');
}
$pdf->addSociete( "Dati"
);
$query = mysql_query("SELECT * FROM ddt ");
$rows = mysql_fetch_array($query);
$_SESSION['numero']=$rows['numero_doc'];
//$_SESSION['anno']=$rows['anno'];
$numero=$_SESSION['numero']+1;
$anno=2013;
$pdf->fact_dev( "DDT ",$numero,$anno); // // Label and number of invoice/estimate
$pdf->addDate(date("d/m/Y"));
$pdf->addPageNumber("1");
$querydestinatario = mysql_query("SELECT * FROM clienti WHERE id='4' ");
$righe = mysql_fetch_array($querydestinatario);
$ragione=$righe['ragione'];
$ragione2=$righe['ragione2'];
$indirizzo=$righe['indirizzo'];
$cap=$righe['cap'];
$citta=$righe['citta'];
$pr=$righe['provincia'];
$piva=$righe['piva'];
if ($ragione2 == ""){
$pdf->addClientAdresse(
$ragione."\n".
$indirizzo."\n" .
$cap."-".$citta." (".$pr.")\n".
"P.Iva ".$piva."\n"
);
}else{
$pdf->addClientAdresse(
$ragione."\n".
$ragione2."\n".
$indirizzo."\n" .
$cap."-".$citta." (".$pr.")\n".
"P.Iva ".$piva."\n"
);
}
$pdf->addReglement($causale);
$cols=array( REFERENCE => 30,
DESCRIPTION => 130,
TOT_ART => 15,
QUANTITY => 15);
$pdf->addCols( $cols);
$cols=array( REFERENCE => "L",
DESCRIPTION => "L",
TOT_ART => "C",
QUANTITY => "C");
$pdf->addLineFormat($cols);
$y = 100;
$size=0; // dummy value
$tot_prods = array();
$conta=count($barcode);
for($i=0;$i<$conta;$i++){
$line = array( REFERENCE => $codice[$i],
DESCRIPTION => $descrizione[$i],
TOT_ART => $um[$i],
QUANTITY => $quantita[$i]); //codice IVA
$size = $pdf->addLine( $y, $line );
$y += $size + 2;
$y += $size + 2;
}
$pdf->addCadreTVAs();
$params = array();
$pdf->addTVAs( $params, $tab_tva, $tot_prods);
$pdf->addCadreEurosFrancs(); //conversione euro-franchi
$footerMsg="NOTE: Qui ci vanno tutte le note che vogliamo";
$pdf->SetFooterMsg($note);
//$pdf->Output('doc.pdf','F');
//header("Location: doc.pdf");
$pdf->Output();
}
?>