" ; include('db_config.php'); $sql="select * from $_data a,$_sch b,$_act c where a.kd_id='$id' and a.kd_sch=b.scode and a.kd_code=c.kp_code "; $result=mysql_query($sql); $db=mysql_fetch_array($result); $std_name=$db[kd_std]; $sch="โรงเรียน$db[sname]"; $newStr = ereg_replace('[[:space:]]+', ' ', trim($str)); $std_name = ereg_replace('[[:space:]]+', ' ', trim($std_name)); if ($db[g]==1) { $award='ได้รับรางวัลเหรียญทอง'; } elseif ($db[s]==1) { $award='ได้รับรางวัลเหรียญเงิน'; } elseif ($db[b]==1) { $award='ได้รับรางวัลเหรียญทองแดง'; } if ($db[kd_rank]==1) { $award="$award ชนะเลิศ"; } elseif ($db[kd_rank]==2) { $award="$award รองชนะเลิศอันดับ ๑"; } elseif ($db[kd_rank]==3) { $award="$award รองชนะเลิศอันดับ ๒"; } if (empty($db[g]) and empty($db[s]) and empty($db[b])) { $award='เข้าร่วม'; } $act=$db[kp_act]; if ($db[kp_grp]=='การงานอาชีพ' or $db[kp_grp]=='คอมพิวเตอร์') { $grp='การงานอาชีพและเทคโนโลยี'; } elseif ($db[kp_grp]=='สังคมศึกษา') { $grp='สังคมศึกษา ศาสนา และวัฒนธรรม'; } else { $grp=$db[kp_grp]; } if (empty($db[kp_level])) { $level=''; } else { $level="ชั้น$db[kp_level]"; } $no="$db[kp_code]-$db[kd_id]"; // echo "$std_name $sch $award $act $grp"; require('thaipdfclass.php'); $pdf=new ThaiPDF(); $pdf->SetThaiFont(); $pdf->AddFont('wan','','PSL102pro.php'); //$pdf->AddFont('wansika','','wansika.php'); $pdf->AddPage(); $pdf->Ln(0); //$pdf->Image('cert/bg10.jpg',1,1,296,209); /* col,row,width,height */ $search = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0','ป.','ม.'); $replace = array('๑', '๒', '๓', '๔', '๕','๖', '๗', '๘', '๙', '๐','ประถมศึกษาปีที่ ','มัธยมศึกษาปีที่ '); $act=str_replace($search,$replace,$db[kp_act]); $level=str_replace($search,$replace,$level); $no=str_replace($search,$replace,$no); $pdf->SetTextColor(128,0,128); $pdf->SetFont('wan','',16); $pdf->Ln(8); $pdf->Cell(265,0,"เลขที่ $no-$ptime",0,0,'R'); $pdf->SetTextColor(0,0,128); $pdf->SetFont('wan','',42); $pdf->Ln(34); $pdf->Cell(0,0,'องค์การบริหารส่วนจังหวัดศรีสะเกษ',0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,'มอบเกียรติบัตรฉบับนี้ ให้ไว้เพื่อแสดงว่า',0,0,'C'); $pdf->Ln(13); $pdf->SetTextColor(0,0,240); $pdf->SetFont('wan','',28); $pdf->Cell(0,0,"$std_name",0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,"$sch",0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',22); $pdf->Cell(0,0,"$award การแข่งขัน$act",0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,"กลุ่มสาระการเรียนรู้$grp $level",0,0,'C'); $pdf->Ln(15); $pdf->SetTextColor(0,0,128); $pdf->SetFont('wan','',34); $pdf->Cell(0,0,'การแข่งขันทักษะวิชาการนักเรียน องค์การบริหารส่วนจังหวัดศรีสะเกษ',0,0,'C'); $pdf->Ln(12); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,"ครั้งที่ $pyr $pplace",0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,'ขอให้มีความเจริญสุขสวัสดิ์ เป็นพลังสำคัญในการพัฒนาประเทศสืบไป',0,0,'C'); $pdf->Ln(10); $pdf->SetFont('wan','',24); $pdf->Cell(0,0,"ให้ไว้ ณ วันที่ $pdate",0,0,'C'); $pdf->Image('wichit.jpg',128,158,40,10); //$pdf->Image('wichit-yellow.jpg',129,166,40,10); $pdf->Ln(18); $pdf->SetFont('wan','',20); $pdf->Cell(0,0,'(นายวิชิต ไตรสรณกุล)',0,0,'C'); $pdf->Ln(8); $pdf->SetFont('wan','',22); $pdf->Cell(0,0,'นายกองค์การบริหารส่วนจังหวัดศรีสะเกษ',0,0,'C'); $pdf->Output(); ?>