01.
<?php ob_start();?>
02.
03.
<?php
if
(
$complete
==
"true"
){ ?>
04.
05.
<script type=
"text/javascript"
>
06.
window.location=
"gbook.php"
;
07.
</script>
08.
<?php } ?>
09.
10.
<?php
11.
require_once
'../PHPWord.php'
;
12.
13.
include_once
(
"../Class/generated_classes/class.course.php"
);
14.
include_once
(
"../Class/generated_classes/sql.php"
);
15.
16.
$objCou
=
new
course();
17.
$objCou
->select(
'1'
);
18.
19.
$objFac
=
new
faculty();
20.
$objFac
->getFacultyTName(
'1'
,
$objCou
->getCOURSE_Code() );
21.
$objFac
->getDepartmentTName(
'1'
,
$objCou
->getCOURSE_Code());
22.
$objFac
->getCoursePreq(
'1'
,
$objCou
->getCOURSE_Code());
23.
$objFac
->getCourseTnameEname(
$objFac
->CoursePreq);
24.
$objFac
->getCourseTDesc(
$objFac
->CoursePreq);
25.
26.
$PHPWord
=
new
PHPWord();
27.
28.
$document
=
$PHPWord
->createSection();
29.
30.
$PHPWord
->addFontStyle(
'rStyle'
,
array
(
'bold'
=>true,
'italic'
=>true,
'size'
=>16));
31.
$PHPWord
->addParagraphStyle(
'pStyle'
,
array
(
'align'
=>
'center'
,
'spaceAfter'
=>100));
32.
$document
->addText(
'Customer Report'
,
'rStyle'
,
'pStyle'
);
33.
34.
$document
=
$PHPWord
->loadTemplate(
'F-QAO-090.docx'
);
35.
36.
$document
->setValue(
'FAC_TName'
,
$objFac
->FACTname);
37.
$document
->setValue(
'DEP_TName'
,
$objFac
->DEPTName);
38.
$document
->setValue(
'ID_Courses'
,
$objCou
->getCOURSE_Code());
39.
$document
->setValue(
'TNAME'
,
$objCou
->getCOURSE_TName());
40.
$document
->setValue(
'EName'
,
$objCou
->getCOURSE_EName());
41.
$document
->setValue(
'Credit'
,
$objCou
->getCOURSE_Credit());
42.
$document
->setValue(
'Lec'
,
$objCou
->getCOURSE_Lec());
43.
$document
->setValue(
'Lab'
,
$objCou
->getCOURSE_Lab());
44.
$document
->setValue(
'Self'
,
$objCou
->getCOURSE_Self());
45.
46.
$document
->setValue(
'COURSEPreq'
,
$objFac
->CoursePreq);
47.
$document
->setValue(
'PreqTName'
,
$objFac
->CourseTName);
48.
$document
->setValue(
'PreqEName'
,
$objFac
->CourseEName);
49.
50.
$document
->setValue(
'CourseTDesc'
,
$objFac
->CourseTDesc);
51.
52.
$objWriter
= PHPWord_IOFactory::createWriter(
$PHPWord
,
'Word2007'
);
53.
$document
->save(
'FQAO090Edit.docx'
);
54.
header(
'Location: FQAO090Edit.docx'
);
55.
?>