Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Χάρης Παπαδόπουλος
e-epal
Commits
147f9c43
Commit
147f9c43
authored
Jun 05, 2017
by
Χάρης Παπαδόπουλος
Browse files
Merged updates. subited.aplication.preview UI enhancements
parents
ce9df05f
d5006978
Changes
10
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/epal.routing.yml
View file @
147f9c43
...
...
@@ -271,7 +271,7 @@ epal.findcapacityperschool:
requirements
:
_user_is_logged_in
:
'
TRUE'
epal.applicant.creationpdf
:
path
:
'
/epal/pdf-application'
path
:
'
/epal/pdf-application
/{studentId}
'
options
:
_auth
:
[
'
basic_auth'
]
defaults
:
...
...
drupal/modules/epal/src/Controller/PdfCreator.php
View file @
147f9c43
...
...
@@ -23,84 +23,58 @@ use Drupal\Core\TypedData\Plugin\DataType\TimeStamp;
use
Drupal\Core\Language\LanguageManagerInterface
;
//require_once('fpdf.php');
//require('C:\wamp64\bin\php\php5.6.25\fpdf16/fpdf.php');
use
FPDF
;
class
PDFCreator
extends
ControllerBase
{
protected
$entity_query
;
protected
$entityTypeManager
;
protected
$logger
;
protected
$connection
;
protected
$entityTypeManager
;
protected
$logger
;
protected
$connection
;
protected
$pdf
;
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
,
QueryFactory
$entity_query
,
Connection
$connection
,
LoggerChannelFactoryInterface
$loggerChannel
)
{
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
entity_query
=
$entity_query
;
$connection
=
Database
::
getConnection
();
$this
->
connection
=
$connection
;
$this
->
logger
=
$loggerChannel
->
get
(
'epal'
);
{
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
entity_query
=
$entity_query
;
$connection
=
Database
::
getConnection
();
$this
->
connection
=
$connection
;
$this
->
logger
=
$loggerChannel
->
get
(
'epal'
);
}
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'entity_type.manager'
),
$container
->
get
(
'entity.query'
),
$container
->
get
(
'database'
),
$container
->
get
(
'logger.factory'
)
$container
->
get
(
'entity_type.manager'
),
$container
->
get
(
'entity.query'
),
$container
->
get
(
'database'
),
$container
->
get
(
'logger.factory'
)
);
}
public
function
createApplicantPDF
(
Request
$request
)
{
public
function
createApplicantPDF
(
Request
$request
,
$studentId
)
{
try
{
if
(
!
$request
->
isMethod
(
'GET'
))
{
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"Method Not Allowed"
)
],
Response
::
HTTP_METHOD_NOT_ALLOWED
);
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"Method Not Allowed"
)
],
Response
::
HTTP_METHOD_NOT_ALLOWED
);
}
/*
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
//$userid = $epalUser -> id();
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if (!$user) {
return $this->respondWithStatus([
'message' => t("User not found"),
], Response::HTTP_FORBIDDEN);
}
}
*/
//user validation
/*
$authToken
=
$request
->
headers
->
get
(
'PHP_AUTH_USER'
);
$users
=
$this
->
entityTypeManager
->
getStorage
(
'user'
)
->
loadByProperties
(
array
(
'name'
=>
$authToken
));
$user
=
reset
(
$users
);
/*
return $this->respondWithStatus([
'message' => t("User:") . $authToken,
], Response::HTTP_FORBIDDEN);
*/
if
(
!
$user
)
{
return
$this
->
respondWithStatus
([
...
...
@@ -118,87 +92,379 @@ class PDFCreator extends ControllerBase {
break
;
}
/*
return $this->respondWithStatus([
'message' => t("User Role:") . $role,
], Response::HTTP_FORBIDDEN);
*/
if
(
!
$validRole
)
{
return
$this
->
respondWithStatus
([
'message'
=>
t
(
"User Invalid Role"
),
],
Response
::
HTTP_FORBIDDEN
);
}
*/
//$user->id()
$pdf
=
new
FPDF
();
$pdf
->
AddPage
();
$pdf
->
SetFont
(
'Arial'
,
'B'
,
16
);
$pdf
->
Cell
(
40
,
10
,
'Hello World! This is a funny day!!!!Hello World! This is a funny day!!!!Hello World! This is a funny day!!!!'
);
ob_end_clean
();
$epalStudents
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student'
)
->
loadByProperties
(
array
(
'id'
=>
$studentId
));
if
(
sizeof
(
$epalStudents
)
===
1
)
{
$epalStudent
=
reset
(
$epalStudents
);
}
else
{
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"No such a studentId Or double studentId"
)
],
Response
::
HTTP_INTERNAL_SERVER_ERROR
);
}
//$s = $pdf->Output("c:\BACKUP\myFile2.pdf", "D");
$s
=
$pdf
->
Output
(
"c:\BACKUP\myFile2.pdf"
,
"S"
);
$s
=
utf8_encode
(
$s
);
$pdf
->
Close
();
//ob_end_flush();
$this
->
initPdfHandler
();
$this
->
createHeader
(
$epalStudent
);
$this
->
createGuardianInfo
(
$epalStudent
);
$this
->
createStudentInfo
(
$epalStudent
);
$this
->
createStudentChoices
(
$epalStudent
);
//$s = file_get_contents("c:/BACKUP/test.pdf");
//$s = utf8_encode($s);
//file_put_contents("c:/BACKUP/test2.pdf",$s);
return
$this
->
respondWithStatus
([
'pdfString'
=>
$s
,
//$s,
],
Response
::
HTTP_OK
);
/*
// $pdf->SetFont('Arial','B',16);
$pdf->AddFont('Ubuntu', '', 'Ubuntu-Regular.php');
$pdf->SetFont('Ubuntu', '', 16);
$pdf->Cell(40, 10, $this->prepareString('Tούτη εδώ είναι η αίτηση σου'));
$pdf->Ln(10);
$pdf->Cell(40, 10, $this->prepareString('Χρονοσήμανση: ') . date('d/m/Y H:i:s'));
$pdf->Ln(10);
$pdf->SetFont('Ubuntu','',10);
for ($i=1; $i<=30; $i++) {
$pdf->Cell(0, 8 , $this->prepareString('Στοιχείο: ') . $i, 0, 1);
$pdf->Cell(0, 8 , 'Item: ' . $i, 0, 1);
}
*/
}
//end try
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"An unexpected problem occured during createApplicantPDF Method "
)
],
Response
::
HTTP_INTERNAL_SERVER_ERROR
);
}
//$this->pdf->Close(); // Δεν χρειάζεται, το κάνει η Output
$s
=
$this
->
pdf
->
Output
(
"S"
,
"export.pdf"
,
true
);
$response
=
new
Response
(
$s
,
Response
::
HTTP_OK
,
[
'Content-Type'
,
'application/pdf'
]);
return
$response
;
}
//end try
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
return
$this
->
respondWithStatus
([
"message"
=>
t
(
"An unexpected problem occured during createApplicantPDF Method "
)
],
Response
::
HTTP_INTERNAL_SERVER_ERROR
);
}
public
function
array_utf8_encode
(
$dat
)
{
if
(
is_string
(
$dat
))
return
utf8_encode
(
$dat
);
if
(
!
is_array
(
$dat
))
return
$dat
;
$ret
=
array
();
foreach
(
$dat
as
$i
=>
$d
)
$ret
[
$i
]
=
self
::
array_utf8_encode
(
$d
);
return
$ret
;
}
}
private
function
initPdfHandler
()
{
$this
->
pdf
=
new
FPDF
();
$this
->
pdf
->
AliasNbPages
();
$this
->
pdf
->
AddPage
();
$this
->
pdf
->
AddFont
(
'open-sans.light'
,
''
,
'open-sans.light.php'
);
$this
->
pdf
->
AddFont
(
'open-sans.bold'
,
''
,
'open-sans.bold.php'
);
}
private
function
createHeader
(
$student
)
{
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
16
);
$this
->
pdf
->
MultiCell
(
0
,
8
,
$this
->
prepareString
(
'Ηλεκτρονική Αίτηση Εγγραφής Μαθητή σε ΕΠΑΛ'
),
0
,
'C'
);
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
14
);
$this
->
pdf
->
MultiCell
(
0
,
8
,
$this
->
prepareString
(
'με αρ.πρωτ. '
.
$student
->
id
->
value
.
' / '
.
date
(
'd-m-y (ώρα: H:i:s)'
,
$student
->
created
->
value
)),
0
,
'C'
);
$this
->
pdf
->
Ln
();
}
private
function
createGuardianInfo
(
$student
)
{
$width
=
45
;
$height
=
8
;
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
14
);
$this
->
pdf
->
SetFillColor
(
255
,
178
,
102
);
$this
->
pdf
->
MultiCell
(
0
,
$height
,
$this
->
prepareString
(
'Στοιχεία αιτούμενου κηδεμόνα'
),
0
,
'C'
,
true
);
$this
->
pdf
->
Ln
(
4
);
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
guardian_name
->
value
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Επώνυμο:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
guardian_surname
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα πατέρα:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
guardian_fathername
->
value
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα μητέρας:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
guardian_mothername
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$fullAddressTxt
=
/*'Διεύθυνση κατοικίας: ' . */
$student
->
regionaddress
->
value
.
', ΤΚ: '
.
$student
->
regiontk
->
value
.
', '
.
$student
->
regionarea
->
value
;
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Διεύθυνση κατοικίας: '
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$fullAddressTxt
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
30
,
$height
,
$this
->
prepareString
(
'Αποδοχή όρων χρήσης συστήματος:'
),
0
,
'L'
);
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
12
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$this
->
retrieveAgreementLiteral
(
$student
->
agreement
->
value
)
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Ln
();
}
private
function
createStudentInfo
(
$student
)
{
$width
=
45
;
$height
=
8
;
$heightln
=
4
;
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
14
);
$this
->
pdf
->
SetFillColor
(
255
,
178
,
102
);
$this
->
pdf
->
MultiCell
(
0
,
$height
,
$this
->
prepareString
(
'Στοιχεία μαθητή'
),
0
,
'C'
,
true
);
$this
->
pdf
->
Ln
(
4
);
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα μαθητή:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
name
->
value
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Επώνυμο μαθητή:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
studentsurname
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα πατέρα:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
fatherfirstname
->
value
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Όνομα μητέρας:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
motherfirstname
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Ημ/νία γέννησης:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
birthdate
->
value
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Τηλ. επικ/νίας:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
telnum
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Τύπος απολυτηρίου:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
certificatetype
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Έτος κτήσης απολυτηρίου:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
graduation_year
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Σχολείο τελευταίας φοίτησης:'
),
0
,
'L'
);
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
$student
->
lastschool_schoolname
->
value
),
0
,
'L'
);
//$this->pdf->Ln();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Τάξη τελευταίας φοίτησης:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$this
->
retrieveClassName
(
$student
->
lastschool_class
->
value
)),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Σχ.έτος τελευταίας φοίτησης:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
lastschool_schoolyear
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Cell
(
$width
+
15
,
$height
,
$this
->
prepareString
(
'Αίτηση από:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$student
->
relationtostudent
->
value
),
0
,
'L'
);
$this
->
pdf
->
Ln
();
$this
->
pdf
->
Ln
();
}
private
function
createStudentChoices
(
$student
)
{
$width
=
45
;
$height
=
8
;
$this
->
pdf
->
SetFont
(
'open-sans.bold'
,
''
,
14
);
$this
->
pdf
->
SetFillColor
(
255
,
178
,
102
);
$this
->
pdf
->
MultiCell
(
0
,
$height
,
$this
->
prepareString
(
'Επιλεχθέντα σχολεία'
),
0
,
'C'
,
true
);
$this
->
pdf
->
Ln
(
4
);
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Τάξη εγγραφής:'
),
0
,
'L'
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$this
->
retrieveClassName
(
$student
->
currentclass
->
value
)),
0
,
'L'
);
$this
->
pdf
->
Ln
();
if
(
$student
->
currentclass
->
value
===
"2"
)
$this
->
createSectorChoice
(
$student
);
else
if
(
$student
->
currentclass
->
value
===
"3"
||
$student
->
currentclass
->
value
===
"4"
)
$this
->
createCourseChoice
(
$student
);
$this
->
createSchoolChoices
(
$student
);
//$this->pdf->Cell($width, $height, $this->prepareString('Επώνυμο μαθητή:'), 0, 'L');
//$this->pdf->Cell($width, $height, $this->prepareString($student->studentsurname->value), 0, 'L');
//$this->pdf->Ln();
}
private
function
createSectorChoice
(
$student
)
{
$width
=
45
;
$height
=
8
;
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$epalSectors
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_sector_field'
)
->
loadByProperties
(
array
(
'student_id'
=>
$student
->
id
->
value
));
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Τομέας Επιλογής:'
),
0
,
'L'
);
if
(
sizeof
(
$epalSectors
)
!==
1
)
{
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
""
),
0
,
'L'
);
}
else
{
$epalSector
=
reset
(
$epalSectors
);
$sectorId
=
$epalSector
->
sectorfield_id
->
getString
();
$sectorNames
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors'
)
->
loadByProperties
(
array
(
'id'
=>
$sectorId
));
if
(
sizeof
(
$sectorNames
)
!==
1
)
{
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
""
),
0
,
'L'
);
}
else
{
$sectorName
=
reset
(
$sectorNames
);
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
$sectorName
->
name
->
value
),
0
,
'L'
);
}
}
//$this->pdf->Ln();
}
private
function
createCourseChoice
(
$student
)
{
$width
=
45
;
$height
=
8
;
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$epalCourses
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_course_field'
)
->
loadByProperties
(
array
(
'student_id'
=>
$student
->
id
->
value
));
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'Ειδικότητα Επιλογής:'
),
0
,
'L'
);
if
(
sizeof
(
$epalCourses
)
!==
1
)
{
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
""
),
0
,
'L'
);
}
else
{
$epalCourse
=
reset
(
$epalCourses
);
$courseId
=
$epalCourse
->
coursefield_id
->
getString
();
$courseNames
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_specialty'
)
->
loadByProperties
(
array
(
'id'
=>
$courseId
));
if
(
sizeof
(
$courseNames
)
!==
1
)
{
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
""
),
0
,
'L'
);
}
else
{
$courseName
=
reset
(
$courseNames
);
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
$courseName
->
name
->
value
),
0
,
'L'
);
}
}
// $this->pdf->Ln();
$this
->
createCorresponingSector
(
$courseName
);
$this
->
pdf
->
Ln
();
}
private
function
createSchoolChoices
(
$student
)
{
//$width = 55;
$height
=
8
;
$this
->
pdf
->
SetFont
(
'open-sans.light'
,
''
,
12
);
$this
->
pdf
->
Ln
(
4
);
$epalSchools
=
$this
->
entityTypeManager
->
getStorage
(
'epal_student_epal_chosen'
)
->
loadByProperties
(
array
(
'student_id'
=>
$student
->
id
->
value
));
foreach
(
$epalSchools
as
$epalSchool
)
{
$msg
=
""
;
if
(
$epalSchool
->
choice_no
->
value
===
"1"
)
$msg
=
"Πρώτη"
;
else
if
(
$epalSchool
->
choice_no
->
value
===
"2"
)
$msg
=
"Δεύτερη"
;
else
if
(
$epalSchool
->
choice_no
->
value
===
"3"
)
$msg
=
"Τρίτη"
;
//$this->pdf->Cell($width, $height, $this->prepareString($txtOrder . ' επιλογή σχολείου προτίμησης :'), 0, 'L');
$msg
.
=
" επιλογή σχολείου προτίμησης: "
;
$epalSchoolNames
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_school'
)
->
loadByProperties
(
array
(
'id'
=>
$epalSchool
->
epal_id
->
getString
()));
$epalSchoolName
=
reset
(
$epalSchoolNames
);
//$this->pdf->Cell($width, $height, $this->prepareString($epalSchoolName->name->value), 0, 'L');
//$msg .= $epalSchoolName->name->value;
$schName
=
$epalSchoolName
->
name
->
value
;
//$this->pdf->multiCell(0, $height, $this->prepareString($msg), 0, 'J');
$this
->
pdf
->
Cell
(
80
,
$height
,
$this
->
prepareString
(
$msg
),
0
,
'L'
);
$this
->
pdf
->
multiCell
(
0
,
$height
,
$this
->
prepareString
(
$schName
),
0
,
'L'
);
//$this->pdf->ln();
}
}
private
function
createCorresponingSector
(
$course
)
{
$width
=
45
;
$height
=
8
;
//$this->pdf->Ln();
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
'(Τομέας ειδικότητας: '
),
0
,
'L'
);
$sectorId
=
$course
->
sector_id
->
getString
();
$sectorNames
=
$this
->
entityTypeManager
->
getStorage
(
'eepal_sectors'
)
->
loadByProperties
(
array
(
'id'
=>
$sectorId
));
if
(
sizeof
(
$sectorNames
)
!==
1
)
{
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
""
),
0
,
'L'
);
}
else
{
$sectorName
=
reset
(
$sectorNames
);
$this
->
pdf
->
Cell
(
$width
,
$height
,
$this
->
prepareString
(
$sectorName
->
name
->
value
)
.
')'
,
0
,
'L'
);
}
}
private
function
retrieveClassName
(
$classId
)
{
if
(
$classId
===
"1"
)
return
'Α\' τάξη'
;
else
if
(
$classId
===
"2"
)
return
'Β\' τάξη'
;
else
if
(
$classId
===
"3"
)
return
'Γ\' τάξη'
;
else
if
(
$classId
===
"4"
)
return
'Δ\' τάξη'
;
else
return
'Μη διαθέσιμη τάξη'
;
}
private
function
retrieveAgreementLiteral
(
$aggreeId
)
{
if
(
$aggreeId
===
"1"
)
return
'ΝΑΙ'
;
else
return
'ΟΧΙ'
;
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
$res
=
new
JsonResponse
(
$arr
);
$res
->
setStatusCode
(
$s
);
return
$res
;
}
private
function
prepareString
(
$string
,
$from_encoding
=
'UTF-8'
,
$to_encoding
=
'ISO-8859-7'
)
{
return
iconv
(
$from_encoding
,
$to_encoding
,
$string
);
}
private
function
respondWithStatus
(
$arr
,
$s
)
{
$res
=
new
JsonResponse
(
$arr
);
$res
->
setStatusCode
(
$s
);
return
$res
;
}
}
drupal/modules/epaldeploysystem/config/fonts/open-sans.bold.php
0 → 100644
View file @
147f9c43
<?php
$type
=
'TrueType'
;
$name
=
'OpenSans-Bold'
;
$desc
=
array
(
'Ascent'
=>
765
,
'Descent'
=>-
240
,
'CapHeight'
=>
714
,
'Flags'
=>
32
,
'FontBBox'
=>
'[-619 -293 1319 1069]'
,
'ItalicAngle'
=>
0
,
'StemV'
=>
120
,
'MissingWidth'
=>
600
);
$up
=
-
75
;
$ut
=
50
;
$cw
=
array
(
chr
(
0
)
=>
600
,
chr
(
1
)
=>
600
,
chr
(
2
)
=>
600
,
chr
(
3
)
=>
600
,
chr
(
4
)
=>
600
,
chr
(
5
)
=>
600
,
chr
(
6
)
=>
600
,
chr
(
7
)
=>
600
,
chr
(
8
)
=>
600
,
chr
(
9
)
=>
600
,
chr
(
10
)
=>
600
,
chr
(
11
)
=>
600
,
chr
(
12
)
=>
600
,
chr
(
13
)
=>
600
,
chr
(
14
)
=>
600
,
chr
(
15
)
=>
600
,
chr
(
16
)
=>
600
,
chr
(
17
)
=>
600
,
chr
(
18
)
=>
600
,
chr
(
19
)
=>
600
,
chr
(
20
)
=>
600
,
chr
(
21
)
=>
600
,
chr
(
22
)
=>
600
,
chr
(
23
)
=>
600
,
chr
(
24
)
=>
600
,
chr
(
25
)
=>
600
,
chr
(
26
)
=>
600
,
chr
(
27
)
=>
600
,
chr
(
28
)
=>
600
,
chr
(
29
)
=>
600
,
chr
(
30
)
=>
600
,
chr
(
31
)
=>
600
,
' '
=>
260
,
'!'
=>
286
,
'"'
=>
472
,
'#'
=>
646
,
'$'
=>
571
,
'%'
=>
901
,
'&'
=>
750
,
'\''
=>
266
,
'('
=>
339
,
')'
=>
339
,
'*'
=>
545
,
'+'
=>
571
,
','
=>
290
,
'-'
=>
322
,
'.'
=>
285
,
'/'
=>
413
,
'0'
=>
571
,
'1'
=>
571
,
'2'
=>
571
,
'3'
=>
571
,
'4'
=>
571
,
'5'
=>
571
,
'6'
=>
571
,
'7'
=>
571
,
'8'
=>
571
,
'9'
=>
571
,
':'
=>
285
,
';'
=>
290
,
'<'
=>
571
,
'='
=>
571
,
'>'
=>
571
,
'?'
=>
477
,
'@'
=>
897
,
'A'
=>
690
,
'B'
=>
672
,
'C'
=>
637
,
'D'
=>
740
,
'E'
=>
560
,
'F'
=>
549
,
'G'
=>
724
,
'H'
=>
765
,
'I'
=>
331
,
'J'
=>
331
,
'K'
=>
664
,
'L'
=>
565
,
'M'
=>
943
,
'N'
=>
813
,
'O'
=>
796
,
'P'
=>
628
,
'Q'
=>
796
,
'R'
=>
660
,
'S'
=>
551
,
'T'
=>
579
,
'U'
=>
756
,
'V'
=>
650
,
'W'
=>
967
,
'X'
=>
667
,
'Y'
=>
624
,
'Z'
=>
579
,
'['
=>
331
,
'\\'
=>
413
,
']'
=>
331
,
'^'
=>
532
,
'_'
=>
411
,
'`'
=>
607
,
'a'
=>
604
,
'b'
=>
633
,
'c'
=>
514
,
'd'
=>
633
,
'e'
=>
591
,
'f'
=>
387
,
'g'
=>
565
,
'h'
=>
657
,
'i'
=>
305
,
'j'
=>
305
,
'k'
=>
620
,
'l'
=>
305
,
'm'
=>
982
,
'n'
=>
657
,
'o'
=>
619
,
'p'
=>
633
,
'q'
=>
633
,
'r'
=>
454
,
's'
=>
497
,
't'
=>
434
,
'u'
=>
657
,
'v'
=>
569
,
'w'
=>
856
,
'x'
=>
578
,
'y'
=>
569
,
'z'
=>
488
,
'{'
=>
394
,
'|'
=>
551
,
'}'
=>
394
,
'~'
=>
571
,
chr
(
127
)
=>
600
,
chr
(
128
)
=>
600
,
chr
(
129
)
=>
600
,
chr
(
130
)
=>
600
,
chr
(
131
)
=>
600
,
chr
(
132
)
=>
600
,
chr
(
133
)
=>
600
,
chr
(
134
)
=>
600
,
chr
(
135
)
=>
600
,
chr
(
136
)
=>
600
,
chr
(
137
)
=>
600
,
chr
(
138
)
=>
600
,
chr
(
139
)
=>
600
,
chr
(
140
)
=>
600
,
chr
(
141
)
=>
600
,
chr
(
142
)
=>
600
,
chr
(
143
)
=>
600
,
chr
(
144
)
=>
600
,
chr
(
145
)
=>
600
,
chr
(
146
)
=>
600
,
chr
(
147
)
=>
600
,
chr
(
148
)
=>
600
,
chr
(
149
)
=>
600
,
chr
(
150
)
=>
600
,
chr
(
151
)
=>
600
,
chr
(
152
)
=>
600
,
chr
(
153
)
=>
600
,
chr
(
154
)
=>
600
,
chr
(
155
)
=>
600
,
chr
(
156
)
=>
600
,
chr
(
157
)
=>
600
,
chr
(
158
)
=>
600
,
chr
(
159
)
=>
600
,
chr
(
160
)
=>
260
,
chr
(
161
)
=>
217
,
chr
(
162
)
=>
217
,
chr
(
163
)
=>
571
,
chr
(
164
)
=>
600
,
chr
(
165
)
=>
600
,
chr
(
166
)
=>
551
,
chr
(
167
)
=>
486
,
chr
(
168
)
=>
607
,
chr
(
169
)
=>
832
,
chr
(
170
)
=>
600
,
chr
(
171
)
=>
615
,
chr
(
172
)
=>
571
,
chr
(
173
)
=>
322
,
chr
(
174
)
=>
600
,
chr
(
175
)
=>
1000
,
chr
(
176
)
=>
428
,
chr
(
177
)
=>
571
,
chr
(
178
)
=>
379
,
chr
(
179
)
=>
379
,
chr
(
180
)
=>
577
,
chr
(
181
)
=>
577
,
chr
(
182
)
=>
690
,
chr
(
183
)
=>
285
,
chr
(
184
)
=>
630
,
chr
(
185
)
=>
835
,
chr
(
186
)
=>
512
,
chr
(
187
)
=>
615
,
chr
(
188
)
=>
836
,
chr
(
189
)
=>
881
,
chr
(
190
)
=>
764
,
chr
(
191
)
=>
786
,
chr
(
192
)
=>
407
,
chr
(
193
)
=>
690
,
chr
(
194
)
=>
672
,
chr
(
195
)
=>
561
,
chr
(
196
)
=>
658
,
chr
(
197
)
=>
560
,
chr
(
198
)
=>
579
,
chr
(
199
)
=>
765
,
chr
(
200
)
=>
796
,
chr
(
201
)
=>
331
,
chr
(
202
)
=>
664
,
chr
(
203
)
=>
650
,
chr
(
204
)
=>
943
,
chr
(
205
)
=>
813
,
chr
(
206
)
=>
571
,
chr
(
207
)
=>
796
,
chr
(
208
)
=>
745
,
chr
(
209
)
=>
628
,
chr
(
210
)
=>
600
,
chr
(
211
)
=>
593
,
chr
(
212
)
=>
579
,
chr
(
213
)
=>
624
,
chr
(
214
)
=>
860
,
chr
(
215
)
=>
667
,
chr
(
216
)
=>
876
,
chr
(
217
)
=>
786
,
chr
(
218
)
=>
331
,
chr
(
219
)
=>
624
,
chr
(
220
)
=>
647
,
chr
(
221
)
=>
555
,
chr
(
222
)
=>
657
,
chr
(
223
)
=>
407
,
chr
(
224
)
=>
645
,
chr
(
225
)
=>
647
,
chr
(
226
)
=>
660
,
chr
(
227
)
=>
568
,
chr
(
228
)
=>
619
,
chr
(
229
)
=>
555
,
chr
(
230
)
=>
498
,
chr
(
231
)
=>
657
,
chr
(
232
)
=>
618
,
chr
(
233
)
=>
407
,
chr
(
234
)
=>
620
,
chr
(
235
)
=>
615
,
chr
(
236
)
=>
660
,
chr
(
237
)
=>
595
,
chr
(
238
)
=>
498
,
chr
(
239
)
=>
619
,
chr
(
240
)
=>
739
,
chr
(
241
)
=>
618
,
chr
(
242
)
=>
498
,
chr
(
243
)
=>
653
,
chr
(
244
)
=>
538
,
chr
(
245
)
=>
645
,
chr
(
246
)
=>
792
,
chr
(
247
)
=>
592
,
chr
(
248
)
=>
837
,
chr
(
249
)
=>
863
,
chr
(
250
)
=>
407
,
chr
(
251
)
=>
645
,
chr
(
252
)
=>
619
,