0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.118.166.45


Current Path : /var/www/html/collportal/custom_src/
Upload File :
Current File : //var/www/html/collportal/custom_src/wordFile.php

<?php
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);

require $main_src.'phpword/vendor/autoload.php';

use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\IOFactory;

function wordFile($aobj_context){

    // $univcode = $aobj_context->mobj_data["univcode"];  
    // $qpcode = $aobj_context->mobj_data["qpcode"];     
    // $year = $aobj_context->mobj_data["year"];  
    // $mode = $aobj_context->mobj_data["mode"];
    // $teachcode = $aobj_context->mobj_data["teachcode"];
    // $set = $aobj_context->mobj_data["noqp"];
    // $verion = $aobj_context->mobj_data["verion"];
    // $type = $aobj_context->mobj_data["type"];

    var_dump($aobj_context,"bsdc");die();
    
    $phpWord = new PhpWord();
    $section = $phpWord->addSection();
    
    $section->addText();
    $section->addText("HIII.", array('bold' => true, 'size' => 16, 'color' => 'FF0000', 'bgColor' => '0000FF'));
    $section->addText("This text is bold and italic.", array('bold' => true, 'italic' => true));

    $writer = IOFactory::createWriter($phpWord, 'Word2007');
    header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
    header('Content-Disposition: attachment;filename="sample.docx"');
    $writer->save('php://output');
 
   
}


?>