|
|
|
ช่วยชี้แนะเรื่อง Code Excel App ด้วยครับ .. ผมอยากให้แสดงผลด้านล่าง Loop while ครับ แต่ มันแสดงผลตามภาพนี้ครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
set_time_limit(0) ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::Report Schedule Order Messenger::</title>
</head>
<body>
<?php
//*** PHP Search ***//
$Job_Time = $_REQUEST["Rdb"];
$Job_Area = $_REQUEST["Radio1"];
//*** Ajax Search ***//
//$Job_Time = $_REQUEST["job_time"];
//$Job_Area = $_REQUEST["job_area"];
$dateInput = $_REQUEST["dateInput"];
$dateInput1 = $_REQUEST["dateInput1"];
//*** Change Format JobScheduleMessenger ***//
$ExdateInput = strtotime($dateInput, 1198494000);
$ExDateInput = date('y-m-d', $ExdateInput);
//*** Change Format JobScheduleMessenger ***//
$ExdateInput1 = strtotime($dateInput1, 1198494000);
$ExDateInput1 = date('y-m-d', $ExdateInput1);
//*** Connect Database ***//
include "../connect.php";
mysql_query("SET NAMES UTF8");
$strSQL = "SELECT * FROM order_messenger
LEFT JOIN employee ON (order_messenger.ID = employee.ID)
LEFT JOIN company ON (order_messenger.Id_Company = company.Id_Company)
WHERE order_messenger.Job_Date BETWEEN '$ExDateInput' AND '$ExDateInput1' AND
order_messenger.Job_Area = '$Job_Area' AND
order_messenger.Job_Time = '$Job_Time' ORDER BY Id_Dept,Name ASC";
$objQuery = mysql_query($strSQL) or die (mysql_error());
$Row = mysql_num_rows($objQuery) or die (mysql_error());
//*** END ***//
if($objQuery){
//*** Get Document Path ***//
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp
//*** Excel Document Root ***//
$strFileName = "../MyExcel1.xls";
//*** Connect to Excel.Application ***//
$xlApp = new COM("Excel.Application");
$xlBook = $xlApp->Workbooks->Add();
$xlSheet1 = $xlBook->Worksheets(1);
$xlApp->Application->Visible = False;
//*** Create Sheet 1 ***//
$xlBook->Worksheets(1)->Name = "Report";
$xlBook->Worksheets(1)->Select;
//*** END ***//
//*** MergeCells Header Content***//
$xlApp->ActiveSheet->Range("A1:E1")->MergeCells = True;
$xlApp->ActiveSheet->Range("F1:J1")->MergeCells = True;
$xlApp->ActiveSheet->Range("A2:J2")->MergeCells = True;
$xlApp->ActiveSheet->Range("A3:J3")->MergeCells = True;
$xlApp->ActiveSheet->Range("A4:J4")->MergeCells = True;
$xlApp->ActiveSheet->Range("A5:J5")->MergeCells = True;
$xlApp->ActiveSheet->Range("A6:J6")->MergeCells = True;
//*** END ***//
//*** Cell Border ***//
$xlApp->ActiveSheet->Range("A7:J7")->BORDERS->Weight = 2;
//*** END ***//
//*** Insert Picture ***//
$xlApp->Cells(1,1)->Select();
$xlApp->ActiveSheet->Pictures->Insert($strPath."/Image/h_ReportImport.gif")->Select();
$xlApp->ActiveSheet->Cells(1,1)->ColumnWidth = 60.0;
$xlApp->ActiveSheet->Cells(1,1)->RowHeight = 60.0;
//*** END ***//
//*** Show Header Order Messenger Schedule Date ***//
if($ExDateInput == $ExDateInput1){
$xlApp->ActiveSheet->Cells(1,6)->Value = "Order Messenger Schedule Date: $dateInput";
$xlApp->ActiveSheet->Cells(1,6)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(1,6)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(1,6)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(1,6)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(1,6)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(1,6)->HorizontalAlignment = 4; //*** Center Column ***//
}else{
$xlApp->ActiveSheet->Cells(1,6)->Value = "Order Messenger Schedule Date: $dateInput - $dateInput1";
$xlApp->ActiveSheet->Cells(1,6)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(1,6)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(1,6)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(1,6)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(1,6)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(1,6)->HorizontalAlignment = 4; //*** Center Column ***//
}
//*** END ***//
//*** Show Header Area ***//
if($Job_Area == 1){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Laem Chabang";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Area == 2){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Bangkok";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Area == 4){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Kabinburi";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Area == 3){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Rayong - Borwin";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Area == 5){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Rayong - Maptaphut";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Area == 6){
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : Amata Nakorn";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}else{
$xlApp->ActiveSheet->Cells(2,1)->Value = "Area : -";
$xlApp->ActiveSheet->Cells(2,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(2,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(2,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(2,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(2,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(2,1)->HorizontalAlignment = 4; //*** Center Column ***//
}
//*** END ***//
//*** Show Header Time ***//
if($Job_Time == 1){
$xlApp->ActiveSheet->Cells(3,1)->Value = "Job Time : Morning";
$xlApp->ActiveSheet->Cells(3,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(3,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(3,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(3,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(3,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(3,1)->HorizontalAlignment = 4; //*** Center Column ***//
}elseif($Job_Time == 2){
$xlApp->ActiveSheet->Cells(3,1)->Value = "Job Time : Afternoon";
$xlApp->ActiveSheet->Cells(3,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(3,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(3,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(3,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(3,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(3,1)->HorizontalAlignment = 4; //*** Center Column ***//
}else{
$xlApp->ActiveSheet->Cells(3,1)->Value = "Job Time : -";
$xlApp->ActiveSheet->Cells(3,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(3,1)->Font->Size = 30;
$xlApp->ActiveSheet->Cells(3,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(3,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(3,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(3,1)->HorizontalAlignment = 4; //*** Center Column ***//
}
//*** END ***//
//$xlApp->ActiveSheet->Cells(4,1)->Value = "Total: $Row Job ";
//$xlApp->ActiveSheet->Cells(4,1)->Font->Name = "Angsana New";
//$xlApp->ActiveSheet->Cells(4,1)->Font->Size = 30;
//$xlApp->ActiveSheet->Cells(4,1)->Font->Italic = True;
//$xlApp->ActiveSheet->Cells(4,1)->Font->Bold = True;
//$xlApp->ActiveSheet->Cells(4,1)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells(4,1)->HorizontalAlignment = 4; //*** Center Column ***//
//*** Fix Header Colums ***//
//*** Width & Height (A7:A7) = No. ***//
$xlApp->ActiveSheet->Range("A7:A7")->ColumnWidth = 5.0;
$xlApp->ActiveSheet->Range("A7:A7")->RowHeight = 20.0;
//*** Width & Height (B7:B7) = Name ***//
$xlApp->ActiveSheet->Range("B7:B7")->ColumnWidth = 15.0;
$xlApp->ActiveSheet->Range("B7:B7")->RowHeight = 20.0;
//*** Width & Height (C7:C7) = Department ***//
$xlApp->ActiveSheet->Range("C7:C7")->ColumnWidth = 15.0;
$xlApp->ActiveSheet->Range("C7:C7")->RowHeight = 20.0;
//*** Width & Height (D7:D7) = Client ***//
$xlApp->ActiveSheet->Range("D7:D7")->ColumnWidth = 60.0;
$xlApp->ActiveSheet->Range("D7:D7")->RowHeight = 20.0;
//*** Width & Height (E7:E7) = Place / Location ***//
$xlApp->ActiveSheet->Range("E7:E7")->ColumnWidth = 60.0;
$xlApp->ActiveSheet->Range("E7:E7")->RowHeight = 20.0;
//*** Width & Height (F7:F7) = Content Of Job ***//
$xlApp->ActiveSheet->Range("F7:F7")->ColumnWidth = 50.0;
$xlApp->ActiveSheet->Range("F7:F7")->RowHeight = 20.0;
//*** Width & Height (G7:G7) = Contract ***//
$xlApp->ActiveSheet->Range("G7:G7")->ColumnWidth = 30.0;
$xlApp->ActiveSheet->Range("G7:G7")->RowHeight = 20.0;
//*** Width & Height (H7:H7) = Messenger ***//
$xlApp->ActiveSheet->Range("H7:H7")->ColumnWidth = 30.0;
$xlApp->ActiveSheet->Range("H7:H7")->RowHeight = 20.0;
//*** Width & Height (I7:I7) = Job Status ***//
$xlApp->ActiveSheet->Range("I7:I7")->ColumnWidth = 15.0;
$xlApp->ActiveSheet->Range("I7:I7")->RowHeight = 20.0;
//*** Width & Height (J7:J7) = Remark ***//
$xlApp->ActiveSheet->Range("J7:J7")->ColumnWidth = 30.0;
$xlApp->ActiveSheet->Range("J7:J7")->RowHeight = 20.0;
//*** END ***//
//*** Write text to Row 7 Column 1 ***//
$xlApp->ActiveSheet->Cells(7,1)->Value = "No.";
$xlApp->ActiveSheet->Cells(7,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,1)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,1)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,1)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,1)->Font->Italic = True;
//*** Write text to Row 7 Column 2 ***//
$xlApp->ActiveSheet->Cells(7,2)->Value = "Name";
$xlApp->ActiveSheet->Cells(7,2)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,2)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,2)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,2)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,2)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,2)->Font->Italic = True;
//*** Write text to Row 7 Column 3 ***//
$xlApp->ActiveSheet->Cells(7,3)->Value = "Department";
$xlApp->ActiveSheet->Cells(7,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,3)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,3)->Font->Italic = True;
//*** Write text to Row 7 Column 4 ***//
$xlApp->ActiveSheet->Cells(7,4)->Value = "Client";
$xlApp->ActiveSheet->Cells(7,4)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,4)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,4)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,4)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,4)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,4)->Font->Italic = True;
//*** Write text to Row 7 Column 5 ***//
$xlApp->ActiveSheet->Cells(7,5)->Value = "Place / Location";
$xlApp->ActiveSheet->Cells(7,5)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,5)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,5)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,5)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,5)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,5)->Font->Italic = True;
//*** Write text to Row 7 Column 6 ***//
$xlApp->ActiveSheet->Cells(7,6)->Value = "Content Of Job";
$xlApp->ActiveSheet->Cells(7,6)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,6)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,6)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,6)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,6)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,6)->Font->Italic = True;
//*** Write text to Row 7 Column 7 ***//
$xlApp->ActiveSheet->Cells(7,7)->Value = "Contract";
$xlApp->ActiveSheet->Cells(7,7)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,7)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,7)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,7)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,7)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,7)->Font->Italic = True;
//*** Write text to Row 7 Column 8 ***//
$xlApp->ActiveSheet->Cells(7,8)->Value = "Messenger";
$xlApp->ActiveSheet->Cells(7,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,8)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,8)->Font->Italic = True;
//*** Write text to Row 7 Column 9 ***//
$xlApp->ActiveSheet->Cells(7,9)->Value = "Job Status";
$xlApp->ActiveSheet->Cells(7,9)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,9)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,9)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,9)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,9)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,9)->Font->Italic = True;
//*** Write text to Row 7 Column 10 ***//
$xlApp->ActiveSheet->Cells(7,10)->Value = "Remark";
$xlApp->ActiveSheet->Cells(7,10)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(7,10)->Font->Bold = True;
$xlApp->ActiveSheet->Cells(7,10)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(7,10)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(7,10)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(7,10)->Font->Italic = True;
//*** Start Row 8 ***//
$intRows = 8;
$num = 0;
while($objResult = mysql_fetch_array($objQuery)){
$Name_Staff = $objResult["Name"];//Name Staff INL
$Id_Dept = $objResult["Id_Dept"];//Id_Department
$Name_Company = $objResult["Name_Company"];//NameCompany
$Address = $objResult["Address_Zone"];
//*** Items Command ***//
$Items1 = $objResult["Job_Items1"];//Document Receive
$Items2 = $objResult["Job_Items2"];//Document Delivery
$Items3 = $objResult["Job_Items3"];//Amending
$Items4 = $objResult["Job_Items4"];//Sign & Seal
$Items5 = $objResult["Job_Items5"];//Other
//*** END ***//
//*** Sub Items Command ***//
$Job_Result = $objResult["Job_Result"];
$Job_SubItems = $objResult["Job_SubItems"];//Cost Or No Cost
//*** END ***//
$Job_Description = $objResult["Job_Description"];//Job Description
$Job_Contact = $objResult["Job_Contact"];//Job Contact
$Id_list = $objResult["Id_list"];//Id_list
$Id_Office = $objResult["Id_Office"];//Id_Office
$Other = $objResult["Other"];//Other
$Job_Remark = $objResult["Job_Remark"];//Job Remark
//*** Messenger ***//
$Type_Messenger = $objResult["Type_Messenger"];//Type Messenger
$Id_Messenger = $objResult["Id_Messenger"];//Id Messenger
$OtherMessenger = $objResult["OtherMessenger"];//Other Messenger
//*** END ***//
$Job_Date = $objResult["Job_Date"];
$num++;//Run Numbers 1 2 3 4 5 ...
//*** Show No. ***//
$xlApp->ActiveSheet->Cells($intRows,1)->Value = $num;
$xlApp->ActiveSheet->Cells($intRows,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,1)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,1)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,1)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,1)->RowHeight = 20.0;
//*** END ***//
//*** Show Name Staff ***//
if($Name_Staff == ""){
$xlApp->ActiveSheet->Cells($intRows,2)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,2)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,2)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,2)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,2)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,2)->RowHeight = 20.0;
}else{
$ExName_Staff = explode(" ",$Name_Staff);
$xlApp->ActiveSheet->Cells($intRows,2)->Value = $ExName_Staff[0];
$xlApp->ActiveSheet->Cells($intRows,2)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,2)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,2)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,2)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,2)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Department ***//
if($Id_Dept == ""){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 1){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Import";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 2){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Export";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 3){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Support";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 4){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Paperless";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 5){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Debit-Note";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 6){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Manager";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 7){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Sance-Import";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 8){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Sance-Export";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}
elseif($Id_Dept == 9){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Shipping";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}elseif($Id_Dept == 10){
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "Development";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}else{
$xlApp->ActiveSheet->Cells($intRows,3)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,3)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,3)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,3)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,4)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,3)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,3)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Name Company ***//
if($Name_Company == ""){
$xlApp->ActiveSheet->Cells($intRows,4)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,4)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells($intRows,4)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,4)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,4)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,4)->RowHeight = 20.0;
}else{
//$ExName_Company = explode(" ",$Name_Company);
$xlApp->ActiveSheet->Cells($intRows,4)->Value = $Name_Company;
$xlApp->ActiveSheet->Cells($intRows,4)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells($intRows,4)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,4)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,4)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,4)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Contact Office ***//
if($Id_list == 1 ){
include "../connect.php";
mysql_query("SET NAMES UTF8");
$SQL1 = "SELECT * FROM agent WHERE Id_agent = '$Id_Office'";
$Result1 = mysql_query($SQL1)or die ("Error Query [".$SQL1."]");
while($objResult1 = mysql_fetch_array($Result1)){
$NameAgent = $objResult1["Name_Agent"];
$xlApp->ActiveSheet->Cells($intRows,5)->Value = $NameAgent;
$xlApp->ActiveSheet->Cells($intRows,5)->VerticalAlignment = -4108; //*** Center Rows ***/
//$xlApp->ActiveSheet->Cells($intRows,5)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,5)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,5)->RowHeight = 20.0;
}
}elseif($Id_list == 2){
include "../connect.php";
mysql_query("SET NAMES UTF8");
$SQL2 = "SELECT * FROM company WHERE Id_Company = '$Id_Office'";
$Result2 = mysql_query($SQL2)or die ("Error Query [".$SQL2."]");
while($objResult2 = mysql_fetch_array($Result2)){
$NameCompany = $objResult2["Name_Company"];
$xlApp->ActiveSheet->Cells($intRows,5)->Value = $NameCompany;
$xlApp->ActiveSheet->Cells($intRows,5)->VerticalAlignment = -4108; //*** Center Rows ***/
//$xlApp->ActiveSheet->Cells($intRows,5)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,5)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,5)->RowHeight = 20.0;
}
}elseif($Id_list == 3){
$Other = iconv('UTF-8', 'TIS-620', $Other);
$xlApp->ActiveSheet->Cells($intRows,5)->Value = $Other;
$xlApp->ActiveSheet->Cells($intRows,5)->VerticalAlignment = -4108; //*** Center Rows ***/
//$xlApp->ActiveSheet->Cells($intRows,5)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,5)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,5)->RowHeight = 20.0;
}else{
$xlApp->ActiveSheet->Cells($intRows,5)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,5)->VerticalAlignment = -4108; //*** Center Rows ***/
//$xlApp->ActiveSheet->Cells($intRows,5)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,5)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,5)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,5)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,5)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Description ***//
if($Job_Description == ""){
$xlApp->ActiveSheet->Cells($intRows,6)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,6)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells($intRows,6)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,6)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,6)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,6)->RowHeight = 20.0;
}else{
$Job_Description = iconv('UTF-8', 'TIS-620', $Job_Description);
$xlApp->ActiveSheet->Cells($intRows,6)->Value = $Job_Description;
$xlApp->ActiveSheet->Cells($intRows,6)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells($intRows,6)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,6)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,6)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,6)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Contract ***//
if($Job_Contact == ""){
$xlApp->ActiveSheet->Cells($intRows,7)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,7)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,7)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,7)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,7)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,7)->RowHeight = 20.0;
}elseif($Job_Contact == "-"){
$xlApp->ActiveSheet->Cells($intRows,7)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,7)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,7)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,7)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,7)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,7)->RowHeight = 20.0;
}else{
$Job_Contact = iconv('UTF-8', 'TIS-620', $Job_Contact);
$xlApp->ActiveSheet->Cells($intRows,7)->Value = $Job_Contact;
$xlApp->ActiveSheet->Cells($intRows,7)->VerticalAlignment = -4108; //*** Center Rows ***//
//$xlApp->ActiveSheet->Cells($intRows,7)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,7)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,7)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,7)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Name Messenger ***//
if($Type_Messenger == "0"){
$xlApp->ActiveSheet->Cells($intRows,8)->Value = "";
$xlApp->ActiveSheet->Cells($intRows,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,8)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,8)->RowHeight = 20.0;
}elseif($Type_Messenger == "1"){
include "../connect.php";
mysql_query("SET NAMES UTF8");
$SQL2 = "SELECT * FROM employee WHERE ID = '$Id_Messenger'";
$Result2 = mysql_query($SQL2)or die ("Error Query [".$SQL2."]");
while($objResult2 = mysql_fetch_array($Result2)){
$NameMessenger = $objResult2["Name"];
$xlApp->ActiveSheet->Cells($intRows,8)->Value = $NameMessenger;
$xlApp->ActiveSheet->Cells($intRows,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,8)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,8)->RowHeight = 20.0;
}
}elseif($Type_Messenger == "2"){
if($OtherMessenger == "-"){
$xlApp->ActiveSheet->Cells($intRows,8)->Value = "Not Input Name Messenger";
$xlApp->ActiveSheet->Cells($intRows,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,8)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,8)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,8)->RowHeight = 20.0;
}else{
$OtherMessenger = iconv('UTF-8', 'TIS-620', $OtherMessenger);
$xlApp->ActiveSheet->Cells($intRows,8)->Value = $OtherMessenger;
$xlApp->ActiveSheet->Cells($intRows,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,8)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,8)->RowHeight = 20.0;
}
}else{
$xlApp->ActiveSheet->Cells($intRows,8)->Value = "";
$xlApp->ActiveSheet->Cells($intRows,8)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,8)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,8)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,8)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,8)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Job Status ***//
if($Job_Result == "0"){
$xlApp->ActiveSheet->Cells($intRows,9)->Value = "Waiting...";
$xlApp->ActiveSheet->Cells($intRows,9)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,9)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,9)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,9)->RowHeight = 20.0;
}elseif($Job_Result == "1"){
$xlApp->ActiveSheet->Cells($intRows,9)->Value = "Complete";
$xlApp->ActiveSheet->Cells($intRows,9)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,9)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,9)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,9)->RowHeight = 20.0;
}elseif($Job_Result == "2"){
$xlApp->ActiveSheet->Cells($intRows,9)->Value = "Not Complete";
$xlApp->ActiveSheet->Cells($intRows,9)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,9)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,9)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,9)->RowHeight = 20.0;
}else{
$xlApp->ActiveSheet->Cells($intRows,9)->Value = "Waiting...";
$xlApp->ActiveSheet->Cells($intRows,9)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,9)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,9)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,9)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,9)->RowHeight = 20.0;
}
//*** END ***//
//*** Show Job Remark ***//
if($Job_Remark == ""){
$xlApp->ActiveSheet->Cells($intRows,10)->Value = "-";
$xlApp->ActiveSheet->Cells($intRows,10)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,10)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,10)->Font->ColorIndex = 3;
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,10)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,10)->RowHeight = 20.0;
}else{
$xlApp->ActiveSheet->Cells($intRows,10)->Value = $Job_Remark;
$xlApp->ActiveSheet->Cells($intRows,10)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells($intRows,10)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Size = 16;
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Italic = True;
$xlApp->ActiveSheet->Cells($intRows,10)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells($intRows,10)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells($intRows,10)->RowHeight = 20.0;
}
//*** END ***//
$intRows++;
}
$xlApp->ActiveSheet->Cells(9,1)->Value = "xxx";
$xlApp->ActiveSheet->Cells(9,1)->VerticalAlignment = -4108; //*** Center Rows ***//
$xlApp->ActiveSheet->Cells(9,1)->HorizontalAlignment = -4108; //*** Center Column ***//
$xlApp->ActiveSheet->Cells(9,1)->Font->Size = 16;
$xlApp->ActiveSheet->Cells(9,1)->Font->Italic = True;
$xlApp->ActiveSheet->Cells(9,1)->Font->Name = "Angsana New";
$xlApp->ActiveSheet->Cells(9,1)->BORDERS->Weight = 2;
$xlApp->ActiveSheet->Cells(9,1)->RowHeight = 20.0;
@unlink($strFileName); //*** Delete old files ***//
$xlBook->SaveAs($strPath."/".$strFileName); //*** Save to Path ***//
//$xlBook->SaveAs(realpath($strFileName)); //*** Save to Path ***//
//*** Close & Quit ***//
$xlApp->Application->Quit();
$xlApp = null;
$xlBook = null;
$xlSheet1 = null;
}
?>
<a href="<?=$strFileName?>" style="font-family:sans-serif; font-size:24px; font-style:italic; color:#999;">Click For Open Document.</a>
</body>
</html>
Code นี้ทำงานได้ปกติครับ เพียงแต่การแสดงผลผิดก็ในส่วนของ
Code (PHP)
$xlApp->ActiveSheet->Cells(9,1)->Value = "xxx";
ผมอยากให้แสดงผลด้านล่าง Loop while ครับ แต่ มันแสดงผลตามภาพนี้ครับ
//****************************************************************//
แต่ผมอยากให้แสดงผล อยากให้แสดงผล แบบ ภาพ ที่ 2 ครับ
Tag : PHP, MySQL, JavaScript
|
ประวัติการแก้ไข 2011-08-08 14:35:15
|
|
|
|
|
Date :
2011-08-08 14:22:14 |
By :
popnakub |
View :
810 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คุณก็ทำเกือบได้แล้วน่ะครับ คุณเป็นเคนเขียน Loop เองก็น่าจะแก้เองได้ง่ายที่สุดครับ ปัญหาคือ Code มันเยอะเกินครับ ยากเกินจะช่วยไล่ดูให้ครับ
|
|
|
|
|
Date :
2011-08-08 17:59:41 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ครับผมยังไงก็ขอบคุณมากครับ พี่วิน ที่ยังตอบผม
เดี๋ยวจะลองๆ มองดูดีๆ อีกรอบก่อนครับ
|
|
|
|
|
Date :
2011-08-08 18:39:20 |
By :
popnakub |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|