Commit 86f2d533 authored by Νίκος Κατσαούνος's avatar Νίκος Κατσαούνος
Browse files

several updates in Drupal Controllers

parent 4fb6c85a
...@@ -182,6 +182,14 @@ epal.ministry.massive_mail_unallocated: ...@@ -182,6 +182,14 @@ epal.ministry.massive_mail_unallocated:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents' _controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudents'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_unallocated_smallclass:
path: '/ministry/send-unallocated-sc-massive-mail'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\InformUnlocatedStudents::sendMailToUnallocatedStudentsSC'
requirements:
_user_is_logged_in: 'TRUE'
epal.ministry.massive_mail_located: epal.ministry.massive_mail_located:
path: '/ministry/send-located-massive-mail' path: '/ministry/send-located-massive-mail'
options: options:
......
...@@ -559,9 +559,10 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup, ...@@ -559,9 +559,10 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
//Αν δεν απέμειναν θέσεις (δηλαδή αν η χωρητικότητα είναι μικρότερη ή ίση από το πλήθος μαθητών που ήδη φοιτούν στο σχολείο) //Αν δεν απέμειναν θέσεις (δηλαδή αν η χωρητικότητα είναι μικρότερη ή ίση από το πλήθος μαθητών που ήδη φοιτούν στο σχολείο)
//τότε διέγραψέ τους από τον προσωρινό πίνακα αποτελεσμάτων και βάλε τους στον στον πίνακα εκκρεμοτήτων //τότε διέγραψέ τους από τον προσωρινό πίνακα αποτελεσμάτων και βάλε τους στον στον πίνακα εκκρεμοτήτων
if ($newlimit <= 0) {
foreach($students as $student) { foreach($students as $student) {
if ($student->currentepal !== $student->epal_id) { if ($student->currentepal !== $student->epal_id) {
if ($newlimit <= 0) {
//print_r("<br>ΣΕ ΕΚΚΡΕΜΟΤΗΤΑ - ΔΙΑΓΡΑΦΗ: " . $student->student_id); //print_r("<br>ΣΕ ΕΚΚΡΕΜΟΤΗΤΑ - ΔΙΑΓΡΑΦΗ: " . $student->student_id);
array_push($this->pendingStudents, $student->student_id); array_push($this->pendingStudents, $student->student_id);
try { try {
...@@ -574,9 +575,27 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup, ...@@ -574,9 +575,27 @@ public function checkCapacityAndArrange($epalId, $classId, $secCourId, $limitup,
$transaction->rollback(); $transaction->rollback();
return ERROR_DB; return ERROR_DB;
} }
} //end if currentepal } //endif new limit
} //end foreach else { //$newlimit > 0
} //endif newlimit //NEW CODE LINES
if ($this->choice_id !== 1)
$this->removeFromPendingStudents($student->student_id);
}
//END NEW CODE LINES
} //endif currentepal
} //end foreach
//NEW CODE LINES
/*
else {
foreach($students as $student)
if ($student->currentepal !== $student->epal_id)
if ($this->choice_id !== 1)
$this->removeFromPendingStudents($student->student_id);
}
*/
//END NEW CODE LINES
return SUCCESS; return SUCCESS;
......
...@@ -92,14 +92,15 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -92,14 +92,15 @@ class InformUnlocatedStudents extends ControllerBase {
$cnt_success = 0; $cnt_success = 0;
$cnt_fail = 0; $cnt_fail = 0;
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε // εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε,
//(δεν κατανεμήθηκαν πουθενά)
$sCon = $this->connection->select('epal_student_class', 'eStudent') $sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id')) ->fields('eStudent', array('student_id'));
->condition('eStudent.finalized', 0 , '='); //->condition('eStudent.finalized', 0 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array(); $studentIds = array();
//array_push($studentIds,-1); array_push($studentIds,-1);
foreach ($epalStudents as $epalStudent) foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id); array_push($studentIds, $epalStudent->student_id);
...@@ -107,7 +108,6 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -107,7 +108,6 @@ class InformUnlocatedStudents extends ControllerBase {
$sCon = $this->connection->select('epal_student', 'eStudent') $sCon = $this->connection->select('epal_student', 'eStudent')
->fields('eStudent', array('id', 'user_id', 'created')) ->fields('eStudent', array('id', 'user_id', 'created'))
->condition('eStudent.id', $studentIds, 'NOT IN'); ->condition('eStudent.id', $studentIds, 'NOT IN');
//$numNoAllocated = $sCon->countQuery()->execute()->fetchField();
$epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalNonLocatedStudents as $epalNonLocatedStudent) { foreach ($epalNonLocatedStudents as $epalNonLocatedStudent) {
...@@ -155,6 +155,106 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -155,6 +155,106 @@ class InformUnlocatedStudents extends ControllerBase {
} }
public function sendMailToUnallocatedStudentsSC(Request $request) {
try {
if (!$request->isMethod('GET')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
], Response::HTTP_METHOD_NOT_ALLOWED);
}
//user validation
$authToken = $request->headers->get('PHP_AUTH_USER');
$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 role validation
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role)
if ($role === "ministry") {
$validRole = true;
break;
}
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User Invalid Role"),
], Response::HTTP_FORBIDDEN);
}
$cnt_success = 0;
$cnt_fail = 0;
// εύρεση μαθητών που η αίτησή τους ΔΕΝ ικανοποιήθηκε,
//(δεν κατανεμήθηκαν πουθενά)
$sCon = $this->connection->select('epal_student_class', 'eStudent')
->fields('eStudent', array('student_id'))
->condition('eStudent.finalized', 0 , '=');
$epalStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$studentIds = array();
array_push($studentIds,-1);
foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id);
$sCon = $this->connection->select('epal_student', 'eStudent')
->fields('eStudent', array('id', 'user_id', 'created'))
->condition('eStudent.id', $studentIds, 'IN');
$epalNonLocatedStudents = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($epalNonLocatedStudents as $epalNonLocatedStudent) {
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('user_id' => $epalNonLocatedStudent->user_id));
$epalUser = reset($epalUsers);
if ($epalUser) {
$user = $this->entityTypeManager->getStorage('user')->load($epalUser->user_id->target_id);
//$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('uid' => $epalUser->user_id));
//$user = reset($users);
if ($user) {
$langcode = $user->getPreferredLangcode();
if ($this->sendEmailToUnallocated($user->getEmail(), $epalNonLocatedStudent->id, $epalNonLocatedStudent->created, $langcode))
$cnt_success++;
}
else {
return $this->respondWithStatus([
'message' => t("user not found"),
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
} else {
$cnt_fail++;
}
} //end foreach
return $this->respondWithStatus([
'message' => t("post successful"),
'num_success_mail' => $cnt_success,
'num_fail_mail' => $cnt_fail,
//'test' => $test,
], Response::HTTP_OK);
} //end try
catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected problem occured during sendMailToStudents Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
//sendEmail(e-mail address, A/A, application Date, lang) //sendEmail(e-mail address, A/A, application Date, lang)
private function sendEmailToUnallocated($email, $appId, $appDate, $langcode) { private function sendEmailToUnallocated($email, $appId, $appDate, $langcode) {
$mailManager = \Drupal::service('plugin.manager.mail'); $mailManager = \Drupal::service('plugin.manager.mail');
...@@ -163,9 +263,10 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -163,9 +263,10 @@ class InformUnlocatedStudents extends ControllerBase {
$key = 'massive_mail_unallocated'; //to be checked.. $key = 'massive_mail_unallocated'; //to be checked..
$to = $email; $to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " - " . date('d-m-y H:i:s', $appDate) $params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " δεν ικανοποιήθηκε. Παρακαλώ επικοινωνήστε άμεσα τηλεφωνικά με τη Διεύθυνση Δευτεροβάθμιας Εκπαίδευσης / Τμήμα Επαγγελματικής Εκπαίδευσης," . " δεν ικανοποιήθηκε. Παρακαλώ επικοινωνήστε άμεσα τηλεφωνικά με τη Διεύθυνση Δευτεροβάθμιας Εκπαίδευσης / Τμήμα Επαγγελματικής Εκπαίδευσης."
. "\r\nΤεστ1\nΤεστ2" ;//e-mail body . "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα.." ;//e-mail body" ;//e-mail body
//add new lines with SENDER name - check it //add new lines with SENDER name - check it
//$params['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ'); //$params['subject'] = t('Μη ικανοποίηση ηλεκτρονικής αίτησης για εγγραφή σε ΕΠΑΛ');
...@@ -231,7 +332,7 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -231,7 +332,7 @@ class InformUnlocatedStudents extends ControllerBase {
$studentIds = array(); $studentIds = array();
//if sizeof(studentIds = 0..distribution has not been made!) //if sizeof(studentIds = 0..distribution has not been made!)
//array_push($studentIds, -1); array_push($studentIds, -1);
foreach ($epalStudents as $epalStudent) foreach ($epalStudents as $epalStudent)
array_push($studentIds, $epalStudent->student_id); array_push($studentIds, $epalStudent->student_id);
...@@ -328,12 +429,13 @@ class InformUnlocatedStudents extends ControllerBase { ...@@ -328,12 +429,13 @@ class InformUnlocatedStudents extends ControllerBase {
$key = 'massive_mail_located'; $key = 'massive_mail_located';
$to = $email; $to = $email;
$params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " - " . date('d-m-y H:i:s', $appDate) $params['message'] = "Σας ενημερώνουμε ότι η αίτησή σας με Α/Α: " . $appId . " / " . date('d-m-y H:i:s', $appDate)
. " ΙΚΑΝΟΠΟΙΗΘΗΚΕ. Έχετε επιλεγεί να γίνει η εγγραφή σας στο " . $schName .", που βρίσκεται στη διεύθυνση: " . $schStreet . " ΙΚΑΝΟΠΟΙΗΘΗΚΕ. Έχετε επιλεγεί να γίνει η εγγραφή σας στο " . $schName .", που βρίσκεται στη διεύθυνση: " . $schStreet
. ". Παρακαλώ επικοινωνήστε άμεσα με τη Σχολική Μονάδα τοποθέτησής σας" . ". Παρακαλώ επικοινωνήστε άμεσα με τη Σχολική Μονάδα τοποθέτησής σας"
. ", ώστε να ενημερωθείτε για τη διαδικασία που πρέπει να ακολουθήσετε για την εγγραφή σας στο σχολείο. " . ", ώστε να ενημερωθείτε για τη διαδικασία που πρέπει να ακολουθήσετε για την εγγραφή σας στο σχολείο. "
. "Τηλέφωνο επικοινωνίας σχολείου: " . $schTel . "Τηλέφωνο επικοινωνίας σχολείου: " . $schTel
. "\r\nΤεστ1\nΤεστ2" ;//e-mail body . "\r\n\r\n Ομάδα Διαχείρισης της εφαρμογής e-epal."
. "\r\n Προσοχή: το μήνυμα που διαβάζετε είναι αυτοματοποιημένο. Παρακαλώ μην απαντάτε σε αυτό το μήνυμα." ;//e-mail body
//$this->logger->info($params['message']); //$this->logger->info($params['message']);
......
...@@ -32,6 +32,10 @@ class PDFCreator extends ControllerBase { ...@@ -32,6 +32,10 @@ class PDFCreator extends ControllerBase {
protected $logger; protected $logger;
protected $connection; protected $connection;
protected $pdf; protected $pdf;
protected $fontLight;
protected $fontBold;
protected $fontSizeHeader;
protected $fontSizeRegular;
public function __construct( public function __construct(
EntityTypeManagerInterface $entityTypeManager, EntityTypeManagerInterface $entityTypeManager,
...@@ -117,6 +121,11 @@ class PDFCreator extends ControllerBase { ...@@ -117,6 +121,11 @@ class PDFCreator extends ControllerBase {
], Response::HTTP_INTERNAL_SERVER_ERROR); ], Response::HTTP_INTERNAL_SERVER_ERROR);
} }
$this->fontLight = "open-sans.light";
$this->fontBold = "open-sans.bold";
$this->fontSizeHeader = 14;
$this->fontSizeRegular = 11;
$this->initPdfHandler(); $this->initPdfHandler();
$this->createHeader($epalStudent); $this->createHeader($epalStudent);
...@@ -170,17 +179,17 @@ class PDFCreator extends ControllerBase { ...@@ -170,17 +179,17 @@ class PDFCreator extends ControllerBase {
$this->pdf->AliasNbPages(); $this->pdf->AliasNbPages();
$this->pdf->AddPage(); $this->pdf->AddPage();
$this->pdf->AddFont('open-sans.light', '', 'open-sans.light.php'); $this->pdf->AddFont($this->fontLight, '', 'open-sans.light.php');
$this->pdf->AddFont('open-sans.bold', '', 'open-sans.bold.php'); $this->pdf->AddFont($this->fontBold, '', 'open-sans.bold.php');
} }
private function createHeader($student) { private function createHeader($student) {
$this->pdf->SetFont('open-sans.bold', '', 16); $this->pdf->SetFont($this->fontBold, '', 16);
$this->pdf->MultiCell(0, 8, $this->prepareString('Ηλεκτρονική Αίτηση Εγγραφής Μαθητή σε ΕΠΑΛ'), 0, 'C'); $this->pdf->MultiCell(0, 8, $this->prepareString('Ηλεκτρονική Αίτηση Εγγραφής Μαθητή σε ΕΠΑΛ'), 0, 'C');
$this->pdf->SetFont('open-sans.bold', '', 14); $this->pdf->SetFont($this->fontBold, '', $this->fontSizeHeader);
$this->pdf->MultiCell(0, 8, $this->prepareString('με αρ.πρωτ. ' . $student->id->value . ' / ' . date('d-m-y (ώρα: H:i:s)', $student->created->value)), 0, 'C'); $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(); $this->pdf->Ln();
} }
...@@ -190,35 +199,52 @@ class PDFCreator extends ControllerBase { ...@@ -190,35 +199,52 @@ class PDFCreator extends ControllerBase {
$width = 45; $width = 45;
$height = 8; $height = 8;
$this->pdf->SetFont('open-sans.bold', '', 14);
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeHeader);
$this->pdf->SetFillColor(255,178,102); $this->pdf->SetFillColor(255,178,102);
$this->pdf->MultiCell(0, $height, $this->prepareString('Στοιχεία αιτούμενου κηδεμόνα'), 0, 'C',true); $this->pdf->MultiCell(0, $height, $this->prepareString('Στοιχεία αιτούμενου'), 0, 'C',true);
$this->pdf->Ln(4); $this->pdf->Ln(4);
$this->pdf->SetFont('open-sans.light', '', 12); $this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Όνομα:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->guardian_name->value), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->guardian_name->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Επώνυμο:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Επώνυμο:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->guardian_surname->value), 0, 'L'); //$x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->Ln(); $this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->guardian_surname->value), 0, 'L');
//$this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα πατέρα:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Όνομα πατέρα:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->guardian_fathername->value), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->guardian_fathername->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα μητέρας:'), 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->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Ln(); $this->pdf->multiCell($width, $height, $this->prepareString($student->guardian_mothername->value), 0, 'L');
//$this->pdf->Ln();
$fullAddressTxt = /*'Διεύθυνση κατοικίας: ' . */ $student->regionaddress->value . ', ΤΚ: ' . $student->regiontk->value . ', ' . $student->regionarea->value; //$fullAddressTxt = $student->regionaddress->value . ', ΤΚ: ' . $student->regiontk->value . ', ' . $student->regionarea->value;
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$regAddressTxt = 'ΤΚ: ' . $student->regiontk->value . ', ' . $student->regionarea->value;
$this->pdf->Cell($width, $height, $this->prepareString('Διεύθυνση κατοικίας: '), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Διεύθυνση κατοικίας: '), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($fullAddressTxt), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->Ln(); $this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Ln(); $this->pdf->multiCell($width, $height, $this->prepareString($student->regionaddress->value), 0, 'L');
$this->pdf->Cell($width+30, $height, $this->prepareString('Αποδοχή όρων χρήσης συστήματος:'), 0, 'L'); $this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetFont('open-sans.bold', '', 12); $this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString($this->retrieveAgreementLiteral($student->agreement->value) ), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('ΤΚ - Πόλη: '), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($regAddressTxt), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->Ln(); $this->pdf->Ln();
...@@ -232,55 +258,84 @@ class PDFCreator extends ControllerBase { ...@@ -232,55 +258,84 @@ class PDFCreator extends ControllerBase {
$height = 8; $height = 8;
$heightln = 4; $heightln = 4;
$this->pdf->SetFont('open-sans.bold', '', 14); $this->pdf->SetFont($this->fontBold, '', $this->fontSizeHeader);
$this->pdf->SetFillColor(255,178,102); $this->pdf->SetFillColor(255,178,102);
$this->pdf->MultiCell(0, $height, $this->prepareString('Στοιχεία μαθητή'), 0, 'C',true); $this->pdf->MultiCell(0, $height, $this->prepareString('Στοιχεία μαθητή'), 0, 'C',true);
$this->pdf->Ln(4); $this->pdf->Ln(4);
$this->pdf->SetFont('open-sans.light', '', 12); $this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα μαθητή:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Όνομα μαθητή:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->name->value), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->name->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Επώνυμο μαθητή:'), 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->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Ln(); $this->pdf->multiCell($width, $height, $this->prepareString($student->studentsurname->value), 0, 'L');
//$this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα πατέρα:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Όνομα πατέρα:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->fatherfirstname->value), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->fatherfirstname->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Όνομα μητέρας:'), 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->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Ln(); $this->pdf->multiCell($width, $height, $this->prepareString($student->motherfirstname->value), 0, 'L');
//$this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString('Ημ/νία γέννησης:'), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString('Ημ/νία γέννησης:'), 0, 'L');
$this->pdf->Cell($width, $height, $this->prepareString($student->birthdate->value), 0, 'L'); $x=$this->pdf->GetX(); $y=$this->pdf->GetY();
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell($width, $height, $this->prepareString($student->birthdate->value), 0, 'L');
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->SetXY($x+$width,$y);
$this->pdf->Cell($width, $height, $this->prepareString('Τηλ. επικ/νίας:'), 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->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Ln(); $this->pdf->multiCell($width, $height, $this->prepareString($student->telnum->value), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
//$this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Τύπος απολυτηρίου:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Τύπος απολυτηρίου:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($student->certificatetype->value), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString($student->certificatetype->value), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Έτος κτήσης απολυτηρίου:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Έτος κτήσης απολυτηρίου:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($student->graduation_year->value), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString($student->graduation_year->value), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Σχολείο τελευταίας φοίτησης:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Σχολείο τελευταίας φοίτησης:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->multiCell(0, $height, $this->prepareString($student->lastschool_schoolname->value), 0, 'L'); $this->pdf->multiCell(0, $height, $this->prepareString($student->lastschool_schoolname->value), 0, 'L');
//$this->pdf->Ln(); //$this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Τάξη τελευταίας φοίτησης:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Τάξη τελευταίας φοίτησης:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($this->retrieveClassName($student->lastschool_class->value)), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString($this->retrieveClassName($student->lastschool_class->value)), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Σχ.έτος τελευταίας φοίτησης:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Σχ.έτος τελευταίας φοίτησης:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($student->lastschool_schoolyear->value), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString($student->lastschool_schoolyear->value), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->SetFont($this->fontLight, '', $this->fontSizeRegular);
$this->pdf->Cell($width+15, $height, $this->prepareString('Αίτηση από:'), 0, 'L'); $this->pdf->Cell($width+15, $height, $this->prepareString('Αίτηση από:'), 0, 'L');
$this->pdf->SetFont($this->fontBold, '', $this->fontSizeRegular);
$this->pdf->Cell($width, $height, $this->prepareString($student->relationtostudent->value), 0, 'L'); $this->pdf->Cell($width, $height, $this->prepareString($student->relationtostudent->value), 0, 'L');
$this->pdf->Ln(); $this->pdf->Ln();
$this->pdf->Ln(); $this->pdf->Ln();
...@@ -292,13 +347,14 @@ class PDFCreator extends ControllerBase { ...@@ -292,13 +347,14 @@ class PDFCreator extends ControllerBase {
$width = 45; $width = 45;