MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /var/www/html/eoffice/application/document/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/eoffice/application/document/xls_simple.php
<?php
	//set_time_limit(0); # ไม่ให้ time out
	
	define('DB', true, true); # ทำงานกับฐานข้อมูลเท่านั้นไม่เอา header
	# define('NO_SESSION', true); # ค่าคงที่ของกา่รไม่ประกาศ session เพราะถ้ามีการใช้ session จะไม่สามารถ export เป็น excel ได้ใน IE
	define('APPLICATION', 'CAR', true);
	
	include('../../config/root_path.php');
	
	require_once inc_xls."class.writeexcel_workbook.inc.php";
	require_once inc_xls."class.writeexcel_worksheet.inc.php";
	
	# FUNCTION =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	// Function Change Christian Date To Buddha Date
	function CB_DATE( $strDate ) {
		if ( $strDate ) {
			$arrMonth = array("ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
			list($y, $m, $d) = split("-", $strDate);
			$strDate = sprintf("%s %s%s", $d * 1, $arrMonth[(($m * 1) - 1)], substr($y+543, 2, 2));
			return $strDate;
		}
	}
	
	// Function Change Buddha Date To Christian Date
	function BC_DATE( $strDate ) {
		if ( $strDate ) {
			list($d, $m, $y) = split("-", $strDate);
			$strDate = sprintf("%s-%s-%s", $y, $m, $d);
			return $strDate;
		}
	}
	
	// Function Show Full Thai Month & Year
	function FullThaiDate( $strMonth, $strYear ) {
		if ( $strMonth && $strYear ) {
			$arrMonth = array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
			return "เดือน " . $arrMonth[$strMonth] . " พ.ศ." . ($strYear+543);
		}
	}
	# END FUNCTION =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	
	# Variables - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
		$report_date = $_POST['report_date'];
		if ( $_POST['pass_state'] == "IN" ) {
			$strTitleName2 = "แบบรายงานประจำรถ ขาเข้า ด่าน ตม.พิบูลมังสาหาร";
		} elseif ( $_POST['pass_state'] == "OUT" ) {
			$strTitleName2 = "แบบรายงานประจำรถ ขาออก ด่าน ตม.พิบูลมังสาหาร";
		} else {
			$strTitleName2 = "แบบรายงานประจำรถ เข้า-ออก ด่าน ตม.พิบูลมังสาหาร";
		}
		$strTitleName1 = "ผนวก จ. (แบบรายงานประจำวันรถ เข้า-ออก ด่าน ตม.) ประกอบแผน ปจร.48 สำนักงานตำรวจแห่งชาติ";
		$strTitleName3 = "วันที่ " . substr($report_date, 0, 2) . " " . FullThaiDate(intval(substr($report_date, 3, 2)) - 1, substr($report_date, 6, 4));
		$checkpoint_place = $_POST['hChkPlace'];
	}
	
	$xlsname = ereg_replace('-', '', date("Y-m-d")) . $checkpoint_id . '.xls';
	$fname = tempnam("/tmp", "daily.xls");
	$workbook =& new writeexcel_workbook($fname);
	$worksheet =& $workbook->addworksheet($report_date); # เพิ่ม work sheet
	# End Variables - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	# Header Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	$title =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$title =& $workbook->addformat();
	$title->set_size(9);
	$title->set_top(0);
	$title->set_left(0);
	$title->set_bottom(0);
	$title->set_align('center');
	$title->set_align('vcenter');
	$title->set_merge(); # This is the key feature
	
	$title_child_cell =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$title_child_cell =& $workbook->addformat();
	$title_child_cell->set_size(9);
	$title_child_cell->set_top(0);
	$title_child_cell->set_right(0);
	$title_child_cell->set_left(0);
	$title_child_cell->set_align('center');
	$title_child_cell->set_align('vcenter');
	$title_child_cell->set_merge(); # This is the key feature
	
	
	$heading1 =& $workbook->addformat(array(
	//'bg_color' => 'silver',
	'align' => 'center', 
	'top' => 1, 
	'left' => 1,
	'bottom' => 1,
	'bottom_color' => 'black',
	'left_color' => 'black',
	'top_color' => 'black',
	'font' => 'Angsana UPC', 
	'size' => '9', 
	));
	
	$heading_merge =& $workbook->addformat(array(
	//'bg_color' => 'silver',
	'align' => 'center', 
	'top' => 1, 
	'left' => 1,
	'bottom' => 1,
	'bottom_color' => 'black',
	'left_color' => 'black',
	'top_color' => 'black',
	'font' => 'Angsana UPC', 
	'size' => '9', 
	'merge' => 1, 
	));
	
	$normal =& $workbook->addformat(array(
	'top' => 1, 
	'align' => 'center', 
	'left' => 1,
	'right' => 1,
	'bottom' => 1,
	'bottom_color' => 'black',
	'left_color' => 'black',
	'right_color' => 'black',
	'top_color' => 'black',
	'size' => '9', 
	));
	
	$normal_bold =& $workbook->addformat(array(
	'bold' => 1, 
	'top' => 1, 
	'align' => 'center', 
	'left' => 1,
	'right' => 1,
	'bottom' => 1,
	'bottom_color' => 'black',
	'left_color' => 'black',
	'right_color' => 'black',
	'top_color' => 'black',
	'size' => '9', 
	));
	
	$header_top =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$header_top =& $workbook->addformat();
	$header_top->set_size(9);
	$header_top->set_top(2);
	$header_top->set_left(2);
	$header_top->set_right(2);
	//$header_top->set_bottom(0);
	$header_top->set_align('center');
	$header_top->set_align('vcenter');
	$header_top->set_merge(); # This is the key feature
	
	$header_middle =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$header_middle =& $workbook->addformat();
	$header_middle->set_size(9);
	//$header_middle->set_top(0);
	$header_middle->set_left(2);
	$header_middle->set_right(2);
	//$header_middle->set_bottom(0);
	$header_middle->set_align('center');
	$header_middle->set_align('vcenter');
	$header_middle->set_merge(); # This is the key feature
	
	$header_bottom =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$header_bottom =& $workbook->addformat();
	$header_bottom->set_size(9);
	//$header_bottom->set_top(0);
	$header_bottom->set_left(2);
	$header_bottom->set_right(2);
	$header_bottom->set_bottom(2);
	$header_bottom->set_align('center');
	$header_bottom->set_align('vcenter');
	#$header_bottom->set_merge(); # This is the key feature
	
	$header_child =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$header_child =& $workbook->addformat();
	$header_child->set_size(9);
	$header_child->set_top(2);
	$header_child->set_left(2);
	$header_child->set_right(2);
	$header_child->set_bottom(2);
	$header_child->set_align('center');
	$header_child->set_align('vcenter');
	#$header_child->set_merge(); # This is the key feature
	
	$body_top =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$body_top =& $workbook->addformat();
	$body_top->set_size(9);
	$body_top->set_top(2);
	$body_top->set_left(2);
	$body_top->set_right(2);
	$body_top->set_bottom(1);
	$body_top->set_align('center');
	$body_top->set_align('vcenter');
	#$body_top->set_merge(); # This is the key feature
	
	$body_middle =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$body_middle =& $workbook->addformat();
	$body_middle->set_size(9);
	$body_middle->set_top(0.5);
	$body_middle->set_left(2);
	$body_middle->set_right(2);
	$body_middle->set_bottom(1);
	$body_middle->set_align('center');
	$body_middle->set_align('vcenter');
	#$body_middle->set_text_wrap(1);
	#$body_middle->set_merge(); # This is the key feature
	
	$body_bottom =& $workbook->addformat(array('font'=>'CordiaUPC','color'=>'black','size'=>14,'text_wrap'=>1));
	$body_bottom =& $workbook->addformat();
	$body_bottom->set_size(9);
	$body_bottom->set_top(1);
	$body_bottom->set_left(2);
	$body_bottom->set_right(2);
	$body_bottom->set_bottom(2);
	$body_bottom->set_align('center');
	$body_bottom->set_align('vcenter');
	#$body_bottom->set_merge(); # This is the key feature
	
	# End Header Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	
	# Write heading =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	# Set Column
	$xlsRow = 0; # เริ่มต้นแถวที่ 0
	$worksheet->set_column('A:B', 4);
	$worksheet->set_column('B:C', 22);
	$worksheet->set_column('C:D', 18.57);
	$worksheet->set_column('D:E', 10.71);
	$worksheet->set_column('E:F', 2.00);
	$worksheet->set_column('F:G', 6.29);
	$worksheet->set_column('G:H', 20.00);
	$worksheet->set_column('H:I', 14.86);
	$worksheet->set_column('I:J', 23.71);
	$worksheet->set_column('J:K', 23.71);
	$worksheet->set_column('K:L', 10.71);
	$worksheet->set_column('L:M', 10.71);
	
	# Set Header I
	$xlsRow++;
	$worksheet->write('A'.$xlsRow , $strTitleName1, $title);
	$worksheet->write_blank('B'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('C'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('D'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('E'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('F'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('G'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('H'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('I'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('J'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('K'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('L'.$xlsRow, $title_child_cell);
	
	# Set Header II
	$xlsRow++;
	$worksheet->write('A'.$xlsRow , $strTitleName2, $title);
	$worksheet->write_blank('B'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('C'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('D'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('E'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('F'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('G'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('H'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('I'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('J'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('K'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('L'.$xlsRow, $title_child_cell);
	
	# Set Header III
	$xlsRow++;
	$worksheet->write('A'.$xlsRow , $strTitleName3, $title);
	$worksheet->write_blank('B'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('C'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('D'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('E'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('F'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('G'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('H'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('I'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('J'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('K'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('L'.$xlsRow, $title_child_cell);
	$xlsRow++;
	$worksheet->write_blank('A'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('B'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('C'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('D'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('E'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('F'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('G'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('H'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('I'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('J'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('K'.$xlsRow, $title_child_cell);
	$worksheet->write_blank('L'.$xlsRow, $title_child_cell);
	
	# Set Header VI
	$xlsRow++;
	$worksheet->write('A'.$xlsRow, "", $header_top);
	$worksheet->write('B'.$xlsRow, "", $header_top);
	$worksheet->write('C'.$xlsRow, "", $header_top);
	$worksheet->write('D'.$xlsRow, "", $header_top);
	$worksheet->write('E'.$xlsRow, "", $header_top);
	$worksheet->write('F'.$xlsRow, "", $header_top);
	$worksheet->write('G'.$xlsRow, "", $header_top);
	$worksheet->write('H'.$xlsRow, "", $header_top);
	$worksheet->write('I'.$xlsRow, "", $header_top);
	$worksheet->write('J'.$xlsRow, "", $header_top);
	$worksheet->write('K'.$xlsRow, "วัน/เดือน/ปี", $header_top);
	$worksheet->write('L'.$xlsRow, "", $header_top);
	
	$xlsRow++;
	$worksheet->write('A'.$xlsRow, 'ลำดับ', $header_middle);
	$worksheet->write('B'.$xlsRow, 'ประเภท', $header_middle);
	$worksheet->write('C'.$xlsRow, 'ทะเบียนรถ', $header_middle);
	$worksheet->write('D'.$xlsRow, 'ยี่ห้อ', $header_middle);
	$worksheet->write('E'.$xlsRow, 'รุ่น', $header_middle);
	$worksheet->write('F'.$xlsRow, 'สี', $header_middle);
	$worksheet->write('G'.$xlsRow, 'เลขเครื่องยนต์', $header_middle);
	$worksheet->write('H'.$xlsRow, 'เลขตัวรถ', $header_middle);
	$worksheet->write('I'.$xlsRow, 'ชื่อเจ้าของรถ', $header_middle);
	$worksheet->write('J'.$xlsRow, 'ชื่อ/ที่อยู่ผู้ครอบครองที่นำรถออก', $header_middle);
	$worksheet->write('K'.$xlsRow, 'ที่นำรถออก', $header_middle);
	$worksheet->write('L'.$xlsRow, '', $header_middle);
	
	$xlsRow++;
	$worksheet->write('A'.$xlsRow, "", $header_bottom);
	$worksheet->write('B'.$xlsRow, "", $header_bottom);
	$worksheet->write('C'.$xlsRow, "", $header_bottom);
	$worksheet->write('D'.$xlsRow, "", $header_bottom);
	$worksheet->write('E'.$xlsRow, "", $header_bottom);
	$worksheet->write('F'.$xlsRow, "", $header_bottom);
	$worksheet->write('G'.$xlsRow, "", $header_bottom);
	$worksheet->write('H'.$xlsRow, "", $header_bottom);
	$worksheet->write('I'.$xlsRow, "", $header_bottom);
	$worksheet->write('J'.$xlsRow, "หมายเลขประจำตัวประชาชน", $header_bottom);
	$worksheet->write('K'.$xlsRow, "วัน/เวลา", $header_child);
	$worksheet->write('L'.$xlsRow, "ลายมือชื่อ", $header_child);
	# End Write heading =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	
	# Body Information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	if ( $_POST['pass_state'] == "IN" ) {
		$strSQL = "SELECT *, DATE(tbl_conv_trans.arriving_date) AS action_date, tbl_conv_trans.goods_id AS Goods FROM tbl_conv_trans LEFT JOIN immigrant_master.tbl_conv_goods ON tbl_conv_trans.goods_id=immigrant_master.tbl_conv_goods.id WHERE tbl_conv_trans.pass_state = 'IN' AND DATE(tbl_conv_trans.arriving_date) = '".BC_DATE($report_date)."' AND tbl_conv_trans.stamp_no NOT IN ('NA', '', 'CM')";
	} else {
		$strSQL = "SELECT *, DATE(tbl_conv_trans.departing_date) AS action_date, tbl_conv_trans.goods_id AS Goods FROM tbl_conv_trans LEFT JOIN immigrant_master.tbl_conv_goods ON tbl_conv_trans.goods_id=immigrant_master.tbl_conv_goods.id WHERE tbl_conv_trans.pass_state = 'OUT' AND DATE(tbl_conv_trans.departing_date) = '".BC_DATE($report_date)."' AND tbl_conv_trans.stamp_no NOT IN ('NA', '', 'CM')";
	}
	/*AND tbl_conv_trans.stamp_no NOT IN ('NA', '', 'CM')*/
	
	$db = new conn_db(host_name,db_user_name,db_password,db_name);
	$db->query($strSQL);
	
	$intRow = 1;
	while( $Result = mysql_fetch_object($db->result) ) {
//		$strSQL = "SELECT id, barcode, name_th, lastname_th, name_en, lastname_en, identified_id, passport_no, tm6_no, bp_book, visa, nationality, pass_status FROM tbl_transaction WHERE trans_id='".$Result->trans_id."' AND passenger_type='DRIVER'
//					UNION
//					SELECT id, barcode, name_th, lastname_th, name_en, lastname_en, identified_id, passport_no, tm6_no, bp_book, visa, nationality, pass_status FROM tbl_transaction_passport WHERE trans_id='".$Result->trans_id."' AND passenger_type='DRIVER' ORDER BY id DESC LIMIT 1";
					
		$strSQL = "SELECT id, barcode, name_th, lastname_th, name_en, lastname_en, passport_no, tm6_no, bp_book, visa, nationality FROM tbl_transaction WHERE trans_id='".$Result->trans_id."' AND passenger_type='DRIVER'
					UNION
					SELECT immigrant_master.tbl_conv_driver.driver_id as id, immigrant_master.tbl_conv_driver.driver_id as barcode, immigrant_master.tbl_conv_driver.driver_name as name_th, immigrant_master.tbl_conv_driver.driver_surname as  lastname_th, immigrant_master.tbl_conv_driver.driver_name as name_en, immigrant_master.tbl_conv_driver.driver_surname as  lastname_en, immigrant_master.tbl_conv_driver.identified_id as passport_no, immigrant_master.tbl_conv_driver.identified_id as tm6_no, immigrant_master.tbl_conv_driver.identified_id as bp_book, tbl_conv_trans_list.passenger_type as visa, immigrant_master.tbl_conv_driver.nationality FROM tbl_conv_trans_list INNER JOIN immigrant_master.tbl_conv_driver ON tbl_conv_trans_list.driver_id=immigrant_master.tbl_conv_driver.driver_id WHERE tbl_conv_trans_list.trans_id='".$Result->trans_id."'
					UNION
					SELECT id, barcode, name_th, lastname_th, name_en, lastname_en, passport_no, tm6_no, bp_book, visa, nationality FROM tbl_transaction_passport WHERE trans_id='".$Result->trans_id."' AND passenger_type='DRIVER'";
					
		$objDriver = getObject($strSQL);
		
		$arrType = array("หนังสือเดินทางไทย", "หนังสือเดินทางต่างประเทศ");
		if ( in_array($objDriver->visa, $arrType) ) {
			$xName = $objDriver->name_en;
			$xSurname = $objDriver->lastname_en;
			$xDocNo = $objDriver->passport_no . " (" . $Result->tm6_no . ")";
		} elseif ( $objDriver->visa == "หนังสือผ่านแดนต่างประเทศ" ) {
			$xName = $objDriver->name_en;
			$xSurname = $objDriver->lastname_en;
			$xDocNo = $objDriver->bp_book;
		} else {
			$xName = $objDriver->name_th;
			$xSurname = $objDriver->lastname_th;
			$xDocNo = $objDriver->bp_book;
		}
		
		if ( $Result->Goods ) $strGoods = "(".$Result->goods_name.")";
		
		$SQL = "SELECT * FROM tbl_conv WHERE conv_id='".$Result->conv_tail_id."'";
		$objTail = getObject($SQL, "MASTER");
		
		$xlsRow++;
		$worksheet->write_blank('A'.$xlsRow, $body_top);
		$worksheet->write_blank('B'.$xlsRow, $body_top);
		$worksheet->write_blank('C'.$xlsRow, $body_top);
		$worksheet->write_blank('D'.$xlsRow, $body_top);
		$worksheet->write_blank('E'.$xlsRow, $body_top);
		$worksheet->write_blank('F'.$xlsRow, $body_top);
		$worksheet->write_blank('G'.$xlsRow, $body_top);
		$worksheet->write_blank('H'.$xlsRow, $body_top);
		$worksheet->write_blank('I'.$xlsRow, $body_top);
		$worksheet->write('J'.$xlsRow, " ".$objDriver->identified_id, $body_top);
		$worksheet->write_blank('K'.$xlsRow, $body_top);
		$worksheet->write_blank('L'.$xlsRow, $body_top);
		
		$xlsRow++;
		$worksheet->write('A'.$xlsRow, $intRow, $body_middle);
		$worksheet->write('B'.$xlsRow, $Result->conv_type, $body_middle);
		$worksheet->write('C'.$xlsRow, $Result->regis_no." ".$Result->regis_province, $body_middle);
		$worksheet->write('D'.$xlsRow, $Result->conv_brand, $body_middle);
		$worksheet->write('E'.$xlsRow, "", $body_middle);
		$worksheet->write('F'.$xlsRow, $Result->conv_colour, $body_middle);
		$worksheet->write('G'.$xlsRow, " ".$Result->machine_no, $body_middle);
		$worksheet->write('H'.$xlsRow, " ".$Result->conv_no, $body_middle);
		$worksheet->write('I'.$xlsRow, $Result->owner_name . " " . $Result->owner_surname, $body_middle);
		$worksheet->write('J'.$xlsRow, $xName . " " . $xSurname, $body_middle);
		$worksheet->write('K'.$xlsRow, CB_DATE($Result->action_date), $body_middle);
		$worksheet->write('L'.$xlsRow, $xName, $body_middle);

		$xlsRow++;
		$worksheet->write_blank('A'.$xlsRow, $body_bottom);
		$worksheet->write('B'.$xlsRow,$strGoods, $body_bottom);
		$worksheet->write('C'.$xlsRow, $objTail->regis_no." ".$objTail->regis_province, $body_bottom);
		$worksheet->write_blank('D'.$xlsRow, $body_bottom);
		$worksheet->write_blank('E'.$xlsRow, $body_bottom);
		$worksheet->write_blank('F'.$xlsRow, $body_bottom);
		$worksheet->write_blank('G'.$xlsRow, $body_bottom);
		$worksheet->write_blank('H'.$xlsRow, $body_bottom);
		$worksheet->write_blank('I'.$xlsRow, $body_bottom);
		$worksheet->write('J'.$xlsRow, " ".$Result->telephone, $body_bottom);
		$worksheet->write_blank('K'.$xlsRow, $body_bottom);
		$worksheet->write_blank('L'.$xlsRow, $body_bottom);
		
		$intRow++;
	}
	# End Body Information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	
	# Send "Excel File" to "Browser" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
	$worksheet->set_landscape(1); #Lanscape Page
	$worksheet->set_margin_left(0.25);
	$worksheet->set_margin_right(0.25);
	$worksheet->set_paper(5); #Paper Type : Legal
	
	$workbook->close();
	header("Pragma: public");
	header("Expires: 0");
	header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
	header("Content-Type: application/force-download");
	header("Content-Type: application/octet-stream");
	header("Content-Type: application/download");
	header("Content-Disposition: attachment; filename=".basename($xlsname).";");
	header("Content-Transfer-Encoding: binary ");
	header("Content-Length: ".filesize($fname));
	
	readfile($fname); 
	unlink($fname);
	exit();
	# End Send "Excel File" to "Browser" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
?>

Anon7 - 2021