Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > PHP > PHP Forum > ออกรายงานเป็นFPDF เป็นแบบแกน X ,Y แถวมันยาว ตั้งให้ขึ้นบรรทัดใหม่ยังไงครับ


[PHP] ออกรายงานเป็นFPDF เป็นแบบแกน X ,Y แถวมันยาว ตั้งให้ขึ้นบรรทัดใหม่ยังไงครับ

 
Topic : 072954



โพสกระทู้ ( 36 )
บทความ ( 0 )



สถานะออฟไลน์



ผมออกรายงานเป็นFPDF ครับ ถ้าความยาวของแถวนั้นเลยขอบกระดาษแล้วมันจะตกลงมา ไอ้ที่มันตกลงมาอีกบรรทัดนึงนี่แหละครับ ผมจะไปตั้งระยะห่างมันตรงใหนครับ พอมีวิธีใหมครับ

ecem

Code (PHP)
001.///////////////////////////////////////// ตั้งค่าหน้ากระดาษ
002.$pdf=new FPDF('P','mm','A4');    // P แนวตั้ง       L  แนวนอน
003.$pdf->AddFont('angsana','B','angsanab.php');
004.$pdf->AddFont('angsana','','angsana.php');
005.$pdf->Open();
006.$pdf->AliasNbPages();
007.$pdf->SetMargins(20,5,10);
008.//////////////////////////////////////////////////////////////////////////////////////////
009. 
010. 
011.$pdf->AddPage(); ///////// เพิ่ม หน้ากระดาษ
012. 
013. 
014. 
015.//////////////////////  ใส่ข้อมูล
016. 
017./////$pages  = 1;
018.////$pdf->SetXY(10,15);
019.////$pdf->SetFont('angsana','',12);$pdf->Write(10,'หน้า '.$pages );
020. 
021.$pdf->Image('photo/logo.jpg',97,10,20,0);
022.$pdf->SetXY(60,28);
023.$pdf->SetFont('angsana','B',18);$pdf->Write(10,'บริษัท น้ำตาลไทยเอกลักษณ์ จำกัด และกลุ่มบริษัทในเครือ' );
024.$pdf->SetXY(55,35);
025.$pdf->SetFont('angsana','B',18);$pdf->Write(10,'THAI IDENTITY SUGAR FACTORY CO., LTD. GROUP' );
026.$pdf->SetXY(90,45);
027.$pdf->SetFont('angsana','B',18);$pdf->Write(10,'ใบสมัครงาน (ชั่วคราว)' );
028. 
029. 
030. 
031.$pdf->SetXY(40,73);
032.$pdf->SetFont('angsana','B',16);$pdf->Write(10,'วันที่สมัคร' );
033.$x = 160;
034.$y = 44;
035.$pdf->Rect($x, $y, 27, 31 , 'D');
036. 
037.$pdf->SetXY(10,80);
038.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ตำแหน่งที่สมัคร (1)' );
039.$pdf->SetXY(32,85);
040.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'(2)' );
041.$pdf->SetXY(110,80);
042.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เงินเดือนที่ต้องการ' );
043.$pdf->SetXY(145,80);
044.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บาท' );
045. 
046.$pdf->SetXY(10,90);
047.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ประวัติส่วนตัว' );
048.$pdf->Rect(11, 97,19, 0 , 'D');
049.$pdf->SetXY(10,98);
050.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ชื่อ' );
051.$pdf->SetXY(55,98);
052.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'นามสกุล' );
053.$pdf->SetXY(110,98);
054.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บัตรประชาชน' );
055.$pdf->SetXY(10,105);
056.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'วัน/เดือน/ปีเกิด' );
057.$pdf->SetXY(150,73);
058.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อายุ' );
059. 
060.$pdf->SetXY(182,73);
061.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'น้ำหนัก' );
062. 
063.$pdf->SetXY(164,73);
064.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ส่วนสูง' );
065. 
066.$pdf->SetXY(10,112);
067.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สถานภาพ' );
068. 
069.$pdf->SetXY(10,119);
070.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สถานภาพทางทหาร' );
071.$pdf->SetXY(55,105);
072.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สัญชาติ' );
073.$pdf->SetXY(110,105);
074.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ศาสนา' );
075. 
076.$pdf->SetXY(10,129);
077.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ที่อยู่ปัจจุบัน' );
078.$pdf->Rect(11, 137,17, 0 , 'D');
079.$pdf->SetXY(10,138);
080.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บ้านเลขที่ ' );
081.$pdf->SetXY(56,138);
082.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'หมู่ที่' );
083.$pdf->SetXY(110,138);
084.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ซอย' );
085.$pdf->SetXY(150,138);
086.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ถนน' );
087.$pdf->SetXY(10,145);
088.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ตำบล/แขวง' );
089.$pdf->SetXY(56,145);
090.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อำเภอ/เขต' );
091.$pdf->SetXY(110,145);
092.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'จังหวัด' );
093.$pdf->SetXY(150,145);
094.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'รหัสไปรษณีย์' );
095.$pdf->SetXY(10,152);
096.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'โทรศัพท์เคลื่อนที่' );
097.$pdf->SetXY(56,152);
098.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'โทรศัพท์' );
099.$pdf->SetXY(110,152);
100.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'E-mail :' );
101. 
102.$pdf->SetXY(10,162);
103.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ประวัติการศึกษา' );
104.$pdf->Rect(11, 169,22, 0 , 'D');
105.$pdf->SetXY(10,170);
106.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สถาบัน' );
107.$pdf->SetXY(77,170);
108.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'วุฒิการศึกษาสูงสุด' );
109.$pdf->SetXY(127,170);
110.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'คณะ' );
111.$pdf->SetXY(10,177);
112.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สาขา' );
113.$pdf->SetXY(127,177);
114.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เกรดเฉลี่ย' );
115. 
116.$pdf->SetXY(77,177);
117.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สำเร็จการศึกษาปี' );
118. 
119.$pdf->SetXY(10,187);
120.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ประวัติการทำงาน (กรอกประวัติการทำงานล่าสุดก่อน)' );
121.$pdf->Rect(11, 194,23, 0 , 'D');
122.$pdf->SetXY(10,195);
123.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'(1) บริษัท  ' );
124.$pdf->SetXY(65,195);
125.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'วัน เดือน ปี ที่เข้า' );
126.$pdf->SetXY(110,195);
127.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ลาออก' );
128.$pdf->SetXY(141,195);
129.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ตำแหน่ง' );
130.$pdf->SetXY(15,209);
131.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เงินเดือน ' );
132.$pdf->SetXY(36,209);
133.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บาท ' );
134.$pdf->SetXY(15,202);
135.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'หน้าที่ความรับผิดชอบ' );
136.$pdf->SetXY(43,209);
137.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สาเหตุที่ออก' );
138.$pdf->SetXY(10,216);
139.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'(2) บริษัท  ' );
140.$pdf->SetXY(65,216);
141.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'วัน เดือน ปี ที่เข้า' );
142.$pdf->SetXY(110,216);
143.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ลาออก' );
144.$pdf->SetXY(141,216);
145.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ตำแหน่ง' );
146.$pdf->SetXY(15,223);
147.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'หน้าที่ความรับผิดชอบ' );
148.$pdf->SetXY(15,230);
149.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เงินเดือน ' );
150.$pdf->SetXY(36,230);
151.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บาท ' );
152.$pdf->SetXY(43,230);
153.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สาเหตุที่ออก' );
154.$pdf->SetXY(10,237);
155.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'(3) บริษัท  ' );
156.$pdf->SetXY(65,237);
157.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'วัน เดือน ปี ที่เข้า' );
158.$pdf->SetXY(110,237);
159.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ลาออก' );
160.$pdf->SetXY(141,237);
161.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ตำแหน่ง' );
162.$pdf->SetXY(15,244);
163.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'หน้าที่ความรับผิดชอบ' );
164.$pdf->SetXY(15,251);
165.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เงินเดือน ' );
166.$pdf->SetXY(36,251);
167.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'บาท ' );
168.$pdf->SetXY(43,251);
169.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'สาเหตุที่ออก' );
170. 
171.//////////////////////สิ้นสุดหัวรายงาน/////////////////////////////
172. 
173.//$sql="select * from register_job  where id_reg='$id_rep'   ";
174.        //$result=mysql_db_query($dbname,$sql);
175.        //  $number=mysql_num_rows($result);
176.             
177.         
178.         
179. 
180. 
181.//////////////////////////////////////////////////////////////////////
182.$sql="select * from appjob where idjob='$id_rep'";
183.            $result=mysql_db_query($dbname,$sql);
184.            $number=mysql_num_rows($result);
185.             
186.            while($rs=mysql_fetch_array($result))   {
187.                $txtbirthday1=$rs[txtbirthday1];
188.                 
189.                $len=strlen($txtbirthday1); // ตรวจสอบความยาวตัวอักษร
190.                    if ($len  < 2)
191.                    {
192.                    $txtbirthday1 = "0".$txtbirthday1 ;
193.                    }
194. 
195.                $txtbirthday2=$rs[txtbirthday2];
196.                 
197.                $len=strlen($txtbirthday2);
198.                    if ($len  < 2)
199.                    {
200.                    $txtbirthday2 = "0".$txtbirthday2 ;
201.                    }
202.                     
203.                $txtbirthday3=$rs[txtbirthday3];
204.                 
205.             
206.                    $dmy=$txtbirthday3."-".$txtbirthday2."-".$txtbirthday1;
207.                    //echo"$dmy";
208.                    $date_repair ="$dmy";
209.                    $date_repair = show_date($date_repair);   //เรียกใช้ ฟังชั่นแปลงวันที่  
210.     
211.                $txtdatejob=$rs[txtdatejob];
212.                $txtdatejob=displaydate($txtdatejob);
213. 
214.            $pdf->SetXY(63,73);
215.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$txtdatejob);
216.             
217.        if ($rs[fileupload_reg]  <> "")    // ตรวจสอบว่ามีรูปหรือเปล่า ถ้าไม่มีไม่ต้องแสดง
218.            {
219.            $pdf->Image('photo/'.$rs[fileupload_reg],160,44,27,31);
220.            }
221.             
222.             
223.            $pdf->SetXY(37,80);
224.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtjob]);
225.                         $pdf->SetXY(37,85);
226.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtjob2]);
227.            $pdf->SetXY(136,80);
228.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtsalary]);
229.            $pdf->SetXY(17,98);
230.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectname]);
231.            $pdf->SetXY(28,98);
232.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtname]);
233.            $pdf->SetXY(70,98);
234.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtsername]);
235.            $pdf->SetXY(131,98);
236.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[idcard]);
237.            $pdf->SetXY(35,105);
238.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$date_repair);//วันเกิด
239.            $pdf->SetXY(80,105);
240.            $pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[day_bir]);
241.            $pdf->SetXY(60,105);
242.            $pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[month_bir]);
243.            $pdf->SetXY(60,105);
244.            $pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[year_bir]);
245.            $pdf->SetXY(157,73);
246.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtage]);
247.            $pdf->SetXY(193,73);
248.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtweight ]);
249.            $pdf->SetXY(176,73);
250.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txthige]);
251.            $pdf->SetXY(27,112);
252.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[sod]);//โสด
253.            $pdf->SetXY(27,112);
254.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[somlod]);//สมรส
255.            $pdf->SetXY(27,112);
256.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[oinn]);//อื่นๆ
257.            $pdf->SetXY(40,112);
258.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtstatus1]);//ระบุ
259.            $pdf->SetXY(40,119);
260.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[than]);//เกณฑ์ทหาร
261.            $pdf->SetXY(40,119);
262.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[nothan]);//ไม่ผ่านการเกณฑ์ทหาร
263.            $pdf->SetXY(40,119);
264.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[cancalthan]);//ได้รับการยกเว้น
265.            $pdf->SetXY(67,119);
266.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtstatus2]);//เพราะ
267.            $pdf->SetXY(70,105);
268.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtnationality]);
269.            $pdf->SetXY(125,105);
270.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtreligion]);
271.            $pdf->SetXY(25,138);
272.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txthome]);
273.            $pdf->SetXY(66,138);
274.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtmuu]);
275.            $pdf->SetXY(118,138);
276.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtsoi]);
277.            $pdf->SetXY(158,138);
278.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtroad]);
279.            $pdf->SetXY(28,145);
280.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtdistrict]);
281.            $pdf->SetXY(73,145);
282.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtthedistrict]);
283.            $pdf->SetXY(122,145);
284.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtprovince]);
285.            $pdf->SetXY(170,145);
286.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtpost]);
287.            $pdf->SetXY(35,152);
288.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtphone1]);
289.            $pdf->SetXY(74,152);
290.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtphone2]);
291.            $pdf->SetXY(125,152);
292.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtemail]);
293.            /*$pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[Expiration_day]);
294.            $pdf->SetXY(43,158);
295.            $pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[Expiration_month]);
296.            $pdf->SetXY(65,158);
297.            $pdf->SetFont('angsana','',14);$pdf->Write(10,$rs[Expiration_year]);*/
298.            $pdf->SetXY(21,170);
299.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtuniversity]);
300.            $pdf->SetXY(103,170);
301.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txteducation]);
302.            $pdf->SetXY(135,170);
303.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtkana]);
304.            $pdf->SetXY(20,177);
305.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtsaka]);
306.            $pdf->SetXY(143,177);
307.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtgpa]);
308.             
309.            $pdf->SetXY(103,177);
310.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtyearout ]);
311.            $pdf->SetXY(25,195);
312.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[company1]);//ประวัติการทำงาน บริษัท
313.            $pdf->SetXY(88,195);
314.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[datein1]);//ประวัติการทำงาน วันที่เข้า
315.                        $pdf->SetXY(121,195);
316.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[dateout1]);//ประวัติการทำงาน วันที่ออก
317.                        $pdf->SetXY(28,209);
318.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[salary1]);//ประวัติทำงานเงินเดือน
319.                        $pdf->SetXY(155,195);
320.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[position1]);//ตำแหน่ง
321.                        $pdf->SetXY(46,202);
322.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[duties1]);//หน้าที่
323.                        $pdf->SetXY(60,209);
324.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[causeout1]);//สาเหตุที่ออก             
325.                $pdf->SetXY(28,209);
326.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[salary1]);//เงินเดือน
327.            $pdf->SetXY(25,216);
328.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[company2]);//ประวัติการทำงาน บริษัท
329.            $pdf->SetXY(88,216);
330.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[datein2]);//ประวัติการทำงาน วันที่เข้า 
331.            $pdf->SetXY(121,216);
332.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[dateout2]);//ประวัติการทำงาน วันที่เข้า
333.            $pdf->SetXY(46,223);
334.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[duties2]);//ประวัติการทำงานหน้าที่
335.                        $pdf->SetXY(60,230);
336.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[causeout2]);//สาเหตุที่ออก
337.                $pdf->SetXY(28,230);
338.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[salary2]);//เงินเดือน  
339.                        $pdf->SetXY(155,216);
340.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[position2]);//ตำแหน่ง
341.            $pdf->SetXY(25,237);
342.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[company3]);//ประวัติการทำงาน บริษัท
343.                $pdf->SetXY(28,251);
344.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[salary3]);//เงินเดือน
345.                        $pdf->SetXY(60,251);
346.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[causeout3]);//สาเหตุที่ออก
347.                        $pdf->SetXY(155,237);
348.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[position3]);//ตำแหน่ง
349.            $pdf->SetXY(88,237);
350.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[datein3]);//ประวัติการทำงาน วันที่เข้า
351.                        $pdf->SetXY(46,244);
352.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[duties3]);//หน้าที่
353.            $pdf->SetXY(121,237);
354.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[dateout3]);//ประวัติการทำงาน วันที่ออก
355. 
356.         
357.            }
358. 
359.//////////////////////////////////////////////////////////////////////
360.//สิ้นสุดการประมวลผลและส่งออกไฟล์เป็น PDF ไฟล์
361.$pdf->AddPage(); ///////// เพิ่ม หน้ากระดาษ หน้าที่2
362.//////////////////////////////////
363.$pdf->SetXY(10,20);
364.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ความสามารถพิเศษ' );
365.$pdf->Rect(11, 27,26, 0 , 'D');
366.$pdf->SetXY(10,27);
367.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ภาษา ' );
368.$pdf->SetXY(65,27);
369.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'พูด' );
370.$pdf->SetXY(110,27);
371.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อ่าน' );
372.$pdf->SetXY(150,27);
373.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เขียน' );
374.$pdf->SetXY(10,34);
375.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ภาษา ' );
376.$pdf->SetXY(65,34);
377.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'พูด' );
378.$pdf->SetXY(110,34);
379.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อ่าน' );
380.$pdf->SetXY(150,34);
381.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'เขียน' );
382.$pdf->SetXY(10,48);
383.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'คอมพิวเตอร์ ' );
384.$pdf->SetXY(10,41);
385.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'พิมพ์ดีด ไทย' );
386.$pdf->SetXY(38,41);
387.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'คำ/นาที' );
388.$pdf->SetXY(60,41);
389.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อังกฤษ' );
390.$pdf->SetXY(80,41);
391.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'คำ/นาที' );
392.$pdf->SetXY(10,55);
393.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'ใบขับขี่ ' );
394.$pdf->SetXY(10,62);
395.$pdf->SetFont('angsana','B',14);$pdf->Write(10,'อื่นๆ ' );
396. 
397. 
398.//////////////////////////////////
399.$sql="select * from appjob where idjob='$id_rep'";
400.            $result=mysql_db_query($dbname,$sql);
401.            $number=mysql_num_rows($result);
402.             
403.            while($rs=mysql_fetch_array($result))   {
404.                $txtbirthday1=$rs[txtbirthday1];
405.                 
406.                $len=strlen($txtbirthday1); // ตรวจสอบความยาวตัวอักษร
407.                    if ($len  < 2)
408.                    {
409.                    $txtbirthday1 = "0".$txtbirthday1 ;
410.                    }
411. 
412.                $txtbirthday2=$rs[txtbirthday2];
413.                 
414.                $len=strlen($txtbirthday2);
415.                    if ($len  < 2)
416.                    {
417.                    $txtbirthday2 = "0".$txtbirthday2 ;
418.                    }
419.                     
420.                $txtbirthday3=$rs[txtbirthday3];
421.                 
422.             
423.                    $dmy=$txtbirthday3."-".$txtbirthday2."-".$txtbirthday1;
424.                    //echo"$dmy";
425.                    $date_repair ="$dmy";
426.                    $date_repair = show_date($date_repair);   //เรียกใช้ ฟังชั่นแปลงวันที่  
427.     
428.                $txtdatejob=$rs[txtdatejob];
429.                $txtdatejob=displaydate($txtdatejob);
430. 
431.             
432.             
433.             
434.            $pdf->SetXY(25,27);
435.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtlanguage1]);
436.            $pdf->SetXY(80,27);
437.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectsay1]);
438.            $pdf->SetXY(125,27);
439.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectread1]);
440.            $pdf->SetXY(170,27);
441.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectwrite1]);
442.            $pdf->SetXY(25,34);
443.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtlanguage2]);
444.            $pdf->SetXY(80,34);
445.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectsay2]);
446.            $pdf->SetXY(125,34);
447.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectread2]);
448.            $pdf->SetXY(170,34);
449.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[selectwrite2]);
450.            $pdf->SetXY(32,41);
451.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[keyth]); //พิมพ์ดีดไทย
452.            $pdf->SetXY(73,41);
453.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[keyeng]); //พิมพ์ดีดอังกฤษ
454.             
455.                 
456.            if ($rs[radiobuttoncar]  <> "" and $rs[radiobuttonmortci]  <> ""){ // ตรวจสอบ
457.            $pdf->SetXY(30,55);
458.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[radiobuttoncar]);//รถยนต์
459.            $pdf->SetXY(44,55);
460.            $pdf->SetFont('angsana','B',14);$pdf->Write(10,'และ ' );
461.            $pdf->SetXY(55,55);
462.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[radiobuttonmortci]);
463.            }else if ($rs[radiobuttoncar]  <> "")  {
464.            $pdf->SetXY(30,55);
465.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[radiobuttoncar]);
466.            }else if  ($rs[radiobuttonmortci]  <> "")  {
467.            $pdf->SetXY(30,55);
468.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[radiobuttonmortci]);
469.            }
470. 
471.            $pdf->SetXY(30,48);
472.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[computer ]);
473.            $pdf->SetXY(30,62);
474.            $pdf->SetFont('angsana','',12);$pdf->Write(10,$rs[txtorter1 ]);
475.            }
476. 
477.///////////////////////////////////
478. 
479.                    function show_date($DataDate){
480.                    list($Date,$Time)=explode(" ",$DataDate);  
481.                    $Year = substr($Date,0,4); 
482.                    $Month = substr($Date,5,2);   
483.                    $Date = substr($Date,8,2);         
484.                    switch($Month){
485.                    case "1":   $Month_TH = "ม.ค."break; // แก้ไขตามที่ต้องการ อาจจะเป็น 01 หรือ มกราคม    ก็ได้
486.                    case "2":   $Month_TH = "ก.พ."break;
487.                    case "3": $Month_TH = "มี.ค.";   break;
488.                    case "4":   $Month_TH = "เม.ย."; break;
489.                    case "5":   $Month_TH = "พ.ค."break;
490.                    case "6":   $Month_TH = "มิ.ย."; break;
491.                    case "7":   $Month_TH = "ก.ค."break;
492.                    case "8":   $Month_TH = "ส.ค."break;
493.                    case "9":   $Month_TH = "ก.ย."break;
494.                    case "10":$Month_TH = "ต.ค.";    break;
495.                    case "11":$Month_TH = "พ.ย.";    break;
496.                    case "12":$Month_TH = "ธ.ค.";    break;
497.                    }
498.                    if(substr($Date,0,1)==0){$Date=substr($Date,1,1); }          
499.                    return $Date." ".$Month_TH." ".($Year+543);// กรณี จะเอาเป็น คศ ต้องบวก เพิ่ม 543
500.                    }
501.                     
502.                    /*  function show_date1($DataDate){
503.                    list($Date,$Time)=explode(" ",$DataDate);  
504.                    $Year = substr($Date,0,4); 
505.                    $Month = substr($Date,5,2);   
506.                    $Date = substr($Date,8,2);         
507.                    switch($Month){
508.                    case "1":   $Month_TH = "ม.ค.";  break; // แก้ไขตามที่ต้องการ อาจจะเป็น 01 หรือ มกราคม    ก็ได้
509.                    case "2":   $Month_TH = "ก.พ.";  break;
510.                    case "3": $Month_TH = "มี.ค.";   break;
511.                    case "4":   $Month_TH = "เม.ย."; break;
512.                    case "5":   $Month_TH = "พ.ค.";  break;
513.                    case "6":   $Month_TH = "มิ.ย."; break;
514.                    case "7":   $Month_TH = "ก.ค.";  break;
515.                    case "8":   $Month_TH = "ส.ค.";  break;
516.                    case "9":   $Month_TH = "ก.ย.";  break;
517.                    case "10":$Month_TH = "ต.ค.";    break;
518.                    case "11":$Month_TH = "พ.ย.";    break;
519.                    case "12":$Month_TH = "ธ.ค.";    break;
520.                    }
521.                    if(substr($Date,0,1)==0){$Date=substr($Date,1,1); }          
522.                    return $Date." ".$Month_TH." ".($Year+543);// กรณี จะเอาเป็น คศ ต้องบวก เพิ่ม 543
523.                    }*/
524.                     
525.                     
526.$pdf->Output();
527. 
528. 
529. 
530. 
531. 
532.?>




Tag : PHP, MySQL, HTML/CSS, JavaScript, jQuery

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-01-31 10:22:56 By : montree104 View : 3879 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

การเขียน Report ที่ดีควรนั่งค่อย ๆ รันเพื่อทดสอบทีล่ะบรรทัดน่ะครับ เวลามีปัญหามันจะได้แก้ไขไม่ยาก code เยอะแบบนี้ แค่เห็นก็ไม่อยากหาครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-01-31 19:33:26 By : webmaster
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ออกรายงานเป็นFPDF เป็นแบบแกน X ,Y แถวมันยาว ตั้งให้ขึ้นบรรทัดใหม่ยังไงครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่