Commit f9c55197 authored by Open Source Developer's avatar Open Source Developer

trans

parent c93d51dc
...@@ -290,13 +290,17 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas ...@@ -290,13 +290,17 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId, $clas
{ {
$postData = json_decode($content); $postData = json_decode($content);
$arr = $postData->students; $arr = $postData->students;
$type = $postData ->type
foreach ($arr as $value) { foreach ($arr as $value) {
$valnew = intval($value); $valnew = intval($value);
$studentForConfirm = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('id' => $valnew )); $studentForConfirm = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('id' => $valnew ));
$studentConfirm = reset($studentForConfirm); $studentConfirm = reset($studentForConfirm);
if ($studentConfirm) { if ($studentConfirm) {
if ($type == 1)
$studentConfirm->set('directorconfirm', true); $studentConfirm->set('directorconfirm', true);
if ($type == 1)
$studentConfirm->set('directorconfirm', false);
$studentConfirm->save(); $studentConfirm->save();
} }
} }
......
...@@ -123,7 +123,7 @@ class SubmitedApplications extends ControllerBase ...@@ -123,7 +123,7 @@ class SubmitedApplications extends ControllerBase
} else { } else {
return $this->respondWithStatus([ return $this->respondWithStatus([
'message' => t("User not found"), 'message' => t("User not found!!!!"),
], Response::HTTP_FORBIDDEN); ], Response::HTTP_FORBIDDEN);
} }
......
...@@ -41,11 +41,11 @@ import { ...@@ -41,11 +41,11 @@ import {
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option> <option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
</select> </select>
</div> </div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption,1)"> <button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption,1)">
Αναζήτηση Αναζήτηση
</button> </button>
<br>
<br>
<ul class="list-group main-view"> <ul class="list-group main-view">
<div *ngIf="(retrievedStudent | async)"> <div *ngIf="(retrievedStudent | async)">
...@@ -53,10 +53,19 @@ import { ...@@ -53,10 +53,19 @@ import {
<li class="list-group-item isclickable" [class.oddout]="isOdd" [class.evenout]="isEven" (click)="setActiveUser(StudentDetails$.i)" [class.selectedout]="userActive === StudentDetails$.i" > <li class="list-group-item isclickable" [class.oddout]="isOdd" [class.evenout]="isEven" (click)="setActiveUser(StudentDetails$.i)" [class.selectedout]="userActive === StudentDetails$.i" >
<h5> {{StudentDetails$.name}}&nbsp;{{StudentDetails$.name}} </h5> <h5> {{StudentDetails$.name}}&nbsp;{{StudentDetails$.name}} </h5>
</li> </li>
<strong>Επιβεβαίωση Εγγραφής: </strong>
<input #cb class="pull-right" type="checkbox" name="{{ StudentDetails$.id }}" (change)="updateCheckedOptions(StudentDetails$.id, $event)" >
<div [hidden]="userActive !== StudentDetails$.i" > <div [hidden]="userActive !== StudentDetails$.i" >
<p style="margin-top: 20px; line-height: 2em;"> Παρακαλώ αφού γίνει ο έλεγχος των στοιχείων του μαθητή επιβεβαιώστε τη δυνατότητα εγγραφής του.</p>
<strong><label>Επιβεβαίωση Εγγραφής:</label> </strong>
<select #cb name="{{StudentDetails$.id}}" (change)="updateCheckedOptions(StudentDetails$.id, cb)" >
<option value=1>Ναι</option>
<option value=2>Όχι</option>
<option value=3 selected></option>
</select>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής
</button>
<table> <table>
<tr><td> <tr><td>
<div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' "> <div class="form-group" *ngIf="StudentDetails$.relationtostudent === 'Μαθητής' ">
...@@ -116,10 +125,7 @@ import { ...@@ -116,10 +125,7 @@ import {
<input #maxpage type="text" class="form-control" placeholder=".col-1" formControlName="maxpage"> <input #maxpage type="text" class="form-control" placeholder=".col-1" formControlName="maxpage">
</div> </div>
</div> </div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής
</button>
<br> <br>
<nav aria-label="pagination"> <nav aria-label="pagination">
<ul class="pagination justify-content-center"> <ul class="pagination justify-content-center">
...@@ -161,6 +167,7 @@ import { ...@@ -161,6 +167,7 @@ import {
private limitup= 5; private limitup= 5;
private pageno = 1; private pageno = 1;
private userActive = <number>-1; private userActive = <number>-1;
private type: Number;
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
...@@ -319,27 +326,36 @@ import { ...@@ -319,27 +326,36 @@ import {
} }
updateCheckedOptions(id, event) { updateCheckedOptions(id, cbvalue) {
let i = this.saved.length; let i = this.saved.length;
console.log(cbvalue.value,"aaaaa");
if (cbvalue.value === '1') {
if (event.target.checked === false) { this.saved[i] = id;
var count = this.saved.length; this.type = 1;
for (var j = 0; j < count; j++) { console.log("ok")
if (this.saved[j] === id) {
this.saved.splice(j, 1);
}
}
} }
else { else if (cbvalue.value === '2') {
this.saved[i] = id; this.saved[i] = id;
this.type = 2;
//var count = this.saved.length;
//for (var j = 0; j < count; j++) {
// if (this.saved[j] === id) {
// this.saved.splice(j, 1);
// }
console.log("not confirmed")
}
else if (cbvalue.value === '3') {
} }
} }
confirmStudent() { confirmStudent() {
this._hds.saveConfirmStudents(this.saved); this._hds.saveConfirmStudents(this.saved, this.type);
} }
checkcclass() { checkcclass() {
......
...@@ -206,20 +206,15 @@ import * as html2canvas from "html2canvas" ...@@ -206,20 +206,15 @@ import * as html2canvas from "html2canvas"
}, },
() => console.log("Getting Schools")); () => console.log("Getting Schools"));
} }
createPdf() createPdf()
{ {
console.log("lalalalalala");
html2canvas(document.getElementById("target")).then(function(canvas) html2canvas(document.getElementById("target")).then(function(canvas)
{ {
var img = canvas.toDataURL(); var img = canvas.toDataURL();
var doc = new jsPDF('p', 'mm'); var doc = new jsPDF('p', 'mm');
console.log(img, doc, "lalalalalala");
doc.addImage(img, 'PNG', 10, 10); doc.addImage(img, 'PNG', 10, 10);
doc.save('applications.pdf'); doc.save('applications.pdf');
}); });
...@@ -227,12 +222,6 @@ import * as html2canvas from "html2canvas" ...@@ -227,12 +222,6 @@ import * as html2canvas from "html2canvas"
createPdf1() createPdf1()
{ {
......
...@@ -562,7 +562,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -562,7 +562,7 @@ export class HelperDataService implements OnInit, OnDestroy {
saveConfirmStudents(students) { saveConfirmStudents(students, type) {
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role; this.authRole = loginInfoToken.auth_role;
...@@ -573,7 +573,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -573,7 +573,7 @@ export class HelperDataService implements OnInit, OnDestroy {
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.http.post(`${AppSettings.API_ENDPOINT}/epal/confirmstudent`, { students }, options) this.http.post(`${AppSettings.API_ENDPOINT}/epal/confirmstudent`, { students, type}, options)
.map(response => response.json()) .map(response => response.json())
.subscribe(data => { .subscribe(data => {
resolve(data); resolve(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment