<?php
require_once('/var/www/html/htdocs/tcpdf/config/lang/eng.php'); //包含两个文件就加载tcpdf库
require_once('/var/www/html/htdocs/tcpdf/tcpdf.php');
require_once('/var/www/html/htdocs/database.php');
$thbgcolor ="bgcolor=\"#C9D6A6\""; //定义变量
$tdbgcolor0="bgcolor=\"#DFE3E6\"";
$tdbgcolor1="bgcolor=\"#EDF1F4\"";
$tdbgcolor2="bgcolor=\"#66CCFF\"";
$tdbgcolor3="bgcolor=\"#B0C4DE\"";
$tdbgcolor4="bgcolor=\"#FFE4C4\"";
define("MSSP_TABDEF", " border=\"1\" cellpadding=\"1\" cellspacing=\"1\""); //定义常量
define("MSSP_TABDEF2", " border=\"1\" cellpadding=\"1\" cellspacing=\"1\" width=\"%50\"");
define("MSSP_TDWIDTH", " width=\"76\" ");
define("MSSP_TDWIDTH2", " width=\"65\" ");
define("MSSP_TDWIDTH3", " width=\"68\" ");
define("MSSP_TDWIDTH4", " width=\"76\" ");
define("MSSP_TDWIDTH5", " width=\"78\" ");
$Product_info_total = 0;
$Contract_ID = $_REQUEST['Contract_ID']; //接收数据
$pdf_filename=$Contract_ID;
header("Content-Disposition: attachment; filename=$pdf_filename.pdf");
$sql = "select c.no Contract_No, c.Date Contract_Date, e.Name Employee_Name from tbl_contract c, tbl_employee e where c.id=65 and e.id=Employee_ID";
//从数据库查出合同为65的合同名称 合同日期和销售
display_content_pdf($Contract_ID,$msspdb,$pdf_filename); //header("/htdocs/download/" . $pdf_filename);
function display_content_pdf($Contract_ID,$msspdb,$pdf_filename)
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, '30', '','*****有限公司'); //头内容 想查找常量,需到/tcpdf/config/tcpdf_config.php中查找
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_F
require_once('/var/www/html/htdocs/tcpdf/config/lang/eng.php'); //包含两个文件就加载tcpdf库
require_once('/var/www/html/htdocs/tcpdf/tcpdf.php');
require_once('/var/www/html/htdocs/database.php');
$thbgcolor ="bgcolor=\"#C9D6A6\""; //定义变量
$tdbgcolor0="bgcolor=\"#DFE3E6\"";
$tdbgcolor1="bgcolor=\"#EDF1F4\"";
$tdbgcolor2="bgcolor=\"#66CCFF\"";
$tdbgcolor3="bgcolor=\"#B0C4DE\"";
$tdbgcolor4="bgcolor=\"#FFE4C4\"";
define("MSSP_TABDEF", " border=\"1\" cellpadding=\"1\" cellspacing=\"1\""); //定义常量
define("MSSP_TABDEF2", " border=\"1\" cellpadding=\"1\" cellspacing=\"1\" width=\"%50\"");
define("MSSP_TDWIDTH", " width=\"76\" ");
define("MSSP_TDWIDTH2", " width=\"65\" ");
define("MSSP_TDWIDTH3", " width=\"68\" ");
define("MSSP_TDWIDTH4", " width=\"76\" ");
define("MSSP_TDWIDTH5", " width=\"78\" ");
$Product_info_total = 0;
$Contract_ID = $_REQUEST['Contract_ID']; //接收数据
$pdf_filename=$Contract_ID;
header("Content-Disposition: attachment; filename=$pdf_filename.pdf");
$sql = "select c.no Contract_No, c.Date Contract_Date, e.Name Employee_Name from tbl_contract c, tbl_employee e where c.id=65 and e.id=Employee_ID";
//从数据库查出合同为65的合同名称 合同日期和销售
display_content_pdf($Contract_ID,$msspdb,$pdf_filename); //header("/htdocs/download/" . $pdf_filename);
function display_content_pdf($Contract_ID,$msspdb,$pdf_filename)
{
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, '30', '','*****有限公司'); //头内容 想查找常量,需到/tcpdf/config/tcpdf_config.php中查找
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_F