[init] -init version

This commit is contained in:
2023-08-04 14:16:52 +07:00
commit 399835a06f
1635 changed files with 104192 additions and 0 deletions

View File

@@ -0,0 +1,613 @@
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { MainLayoutComponent } from "./layout/main-layout/main-layout.component";
import { AuthGuard } from "./core/guards/auth.guard";
import { settingFinanceRoutes } from "./feature/settings-finance/routes";
import { examRegisterRoutes } from "./feature/exam-register/routes";
const routes: Routes = [
{
path: "",
pathMatch: "full",
redirectTo: "/setting-exam",
},
{
path: "auth",
loadChildren: () =>
import("./feature/auth-callback/auth-callback.module").then(
(x) => x.AuthCallbackModule
),
},
{
path: "",
component: MainLayoutComponent,
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
children: [
...settingFinanceRoutes,
...examRegisterRoutes,
{
path: "home",
loadChildren: () =>
import("./feature/default/default.module").then((m) => m.DefaultModule),
},
{
path: "change-exam-room",
loadChildren: () =>
import("./feature/change-exam-room/change-exam-room.module").then((m) => m.ChangeExamRoomModule),
data: {
menu: 'ย้ายห้องสอบ',
}
},
{
path: "change-password",
loadChildren: () =>
import("./feature/change-password/change-password.module").then((m) => m.ChangePasswodModule),
},
{
path: "report",
loadChildren: () =>
import("./feature/report/report.module").then((m) => m.ReportModule),
data: {
menu: 'รายงาน',
}
},
{
path: "import-payment",
loadChildren: () =>
import("./feature/manage-payment/import/import.module").then(
(m) => m.ImportModule
),
data: {
menu: 'จัดการรายการชำระเงิน',
sub_menu: 'นำเข้ารายการชำระเงิน'
}
},
{
path: "confirm-payment",
loadChildren: () =>
import("./feature/manage-payment/confirm/confirm.module").then(
(m) => m.ConfirmModule
),
data: {
menu: 'จัดการรายการชำระเงิน',
sub_menu: 'ยืนยันรายการชำระเงิน'
}
},
{
path: "manage-exam-officer",
loadChildren: () =>
import(
"./feature/exam-setting/manage-exam-officer/manage-exam-officer.module"
).then((m) => m.ManageExamOfficerModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'กำหนดกรรมการคุมสอบ'
}
},
{
path: "create-user",
loadChildren: () =>
import(
"./feature/set-permission/create-user/create-user.module"
).then((m) => m.CreateUserModule),
data: {
menu: 'กำหนดสิทธิ์',
sub_menu: 'สร้าง User'
}
},
{
path: "set-user",
loadChildren: () =>
import("./feature/set-permission/set-user/set-user.module").then(
(m) => m.SetUserModule
),
data: {
menu: 'กำหนดสิทธิ์',
sub_menu: 'User ผู้ใช้งาน'
}
},
{
path: "set-role",
loadChildren: () =>
import("./feature/set-permission/set-role/set-role.module").then(
(m) => m.SetRoleModule
),
data: {
menu: 'กำหนดสิทธิ์',
sub_menu: 'กลุ่มสิทธิ์'
}
},
{
path: "change-exam-day",
loadChildren: () =>
import("./feature/change-exam-day/change-exam-day.module").then(
(m) => m.ChangeExamDayModule
),
data: {
menu: 'ขออนุมัติเปลี่ยนวันสอบ'
}
},
{
path: "testing-field",
loadChildren: () =>
import("./feature/settings/testing-field/testing-field.module").then(
(m) => m.TestingFieldModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'จัดการสนามสอบ'
}
},
{
path: "candidate-list",
loadChildren: () =>
import("./feature/candidate-list/candidate-list/candidate-list.module").then(
(m) => m.CandidateListModule
),
data: {
menu: 'จัดการรายชื่อผู้เข้าสอบ',
sub_menu: 'ข้อมูลผู้สอบ'
}
},
{
path: "check-candidate-list",
loadChildren: () =>
import("./feature/candidate-list/check-candidate-list/check-candidate-list.module").then(
(m) => m.CheckCandidateListModule
),
data: {
menu: 'จัดการรายชื่อผู้เข้าสอบ',
sub_menu: 'สร้างข้อสอบ'
}
},
{
path: "approve-examination",
loadChildren: () =>
import("./feature/approve-examination/approve-examination.module").then(
(m) => m.ApproveExaminationModule
),
data: {
menu: 'ปล่อยข้อสอบ'
}
},
{
path: "change-exam-information",
loadChildren: () =>
import(
"./feature/exam-setting/change-exam-information/change-exam-information.module"
).then((m) => m.ChangeExamInformationModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'ขยายรอบสอบ'
}
},
{
path: "grade-summary",
loadChildren: () =>
import(
"./feature/exam-setting/grade-summary/grade-summary.module"
).then((m) => m.GradeSummaryModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'กำหนดเกณฑ์คะแนน'
}
},
{
path: "random-questions",
loadChildren: () =>
import(
"./feature/exam-setting/random-questions/random-questions.module"
).then((m) => m.RandomQuestionsModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'สร้างเงื่อนไขการสุ่มคำถาม'
}
},
{
path: "academic-semesters",
loadChildren: () =>
import(
"./feature/settings/academic-semesters/academic-semesters.module"
).then((m) => m.AcademicSemestersModule),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ภาคการศึกษา'
}
},
{
path: "department",
loadChildren: () =>
import(
"./feature/settings/department/department.module"
).then((m) => m.DepartmentModule),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'สร้างภาควิชา'
}
},
{
path: "academic-years",
loadChildren: () =>
import(
"./feature/settings/academic-years/academic-years.module"
).then((m) => m.AcademicYearsModule),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ปีการศึกษา'
}
},
{
path: "testing-vdos",
loadChildren: () =>
import(
"./feature/settings/testing-vdos/testing-vdos.module"
).then((m) => m.TestingVdosModule),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'วิดีโอ'
}
},
{
path: "faculties",
loadChildren: () =>
import("./feature/settings/faculties/faculties.module").then(
(m) => m.FacultiesModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ข้อมูลหน่วยงานคณะ'
}
},
{
path: "subject-type",
loadChildren: () =>
import("./feature/settings/typesubject/typesubject.module").then(
(m) => m.TypesubjectModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ประเภทวิชา'
}
},
{
path: "calendars",
loadChildren: () =>
import("./feature/settings/calendars/calendars.module").then(
(m) => m.CalendarsModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'รายการปฎิทิน'
}
},
{
path: "branch",
loadChildren: () =>
import("./feature/settings/testcenter/testcenter.module").then(
(m) => m.TestcenterModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'สร้างศูนย์สอบ'
}
},
{
path: "online-counter",
loadChildren: () =>
import("./feature/settings/online-counter/online-counter.module").then(
(m) => m.OnlineCounterModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ชื่อเค้าเตอร์รับเงินออนไลน์'
}
},
{
path: "signature",
loadChildren: () =>
import("./feature/settings/signature/signature.module").then(
(m) => m.SignatureModule
),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ลายเซ็นผู้รับเงิน'
}
},
{
path: "candidate-payment-status",
loadChildren: () =>
import("./feature/candidate-payment-status/candidate-payment-status.module").then(
(m) => m.CandidatePaymentStatusModule
),
data: {
menu: 'จัดการรายชื่อผู้เข้าสอบ',
sub_menu: 'สถานะการชำระค่าสมัคร'
}
},
{
path: "education-type",
loadChildren: () =>
import(
"./feature/settings/education-type/education-type.module"
).then((m) => m.EducationTypeModule),
data: {
menu: 'ตั้งค่าข้อมูลตั้งต้น',
sub_menu: 'ข้อมูลระดับการศึกษา'
}
},
{
path: "setting-exam",
loadChildren: () =>
import("./feature/setting-exam/setting-exam.module").then(
(m) => m.SettingExamModule
),
data: {
menu: 'กำหนดรายวิชาสอบ',
}
},
{
path: "manage-test-center",
loadChildren: () =>
import("./feature/manage-test-center/manage-test-center.module").then(
(m) => m.ManageTestCenterModule
),
data: {
menu: 'การจัดการศูนย์สอบ'
}
},
{
path: "exam-information",
loadChildren: () =>
import(
"./feature/set-exam-information/set-exam-information.module"
).then((m) => m.SetExamInformationModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'ตรวจสอบข้อมูลรอบสอบ'
}
},
{
path: "approve-exam",
loadChildren: () =>
import(
"./feature/create-exam/approve-exam/approve-exam.module"
).then((m) => m.ApproveExamModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'เปิดรอบสอบ'
}
},
{
path: "reject-exam",
loadChildren: () =>
import(
"./feature/create-exam/reject-exam/reject-exam.module"
).then((m) => m.RejectExamModule),
data: {
menu: 'กำหนดข้อมูลการสอบ',
sub_menu: 'ปิดรอบสอบ'
}
},
{
path: "user-counter",
loadChildren: () =>
import(
"./feature/set-permission/user-couter/user-couter.module"
).then((m) => m.UserCouterModule),
data: {
menu: 'กำหนดสิทธิ์',
sub_menu: 'User Counter รับสมัคร'
}
},
{
path: "print-exam-card",
loadChildren: () =>
import(
"./feature/print-exam-card/print-exam-card.module"
).then((m) => m.PrintExamCardModule),
data: {
menu: 'พิมพ์บัตรเข้าห้องสอบ'
}
},
{
path: "setting-print-card",
loadChildren: () =>
import(
"./feature/setting-print-card/setting-print-card.module"
).then((m) => m.SettingPrintCardModule),
data: {
menu: 'ตั้งค่าเวลาพิมพ์บัตร'
}
},
{
path: "print-exam-result",
loadChildren: () =>
import(
"./feature/print-exam-result/print-exam-result.module"
).then((m) => m.PrintExamResultModule),
data: {
menu: 'พิมพ์ผลสอบ'
}
},
{
path: "student-info",
loadChildren: () =>
import(
"./feature/upload-student/upload-student.module"
).then((m) => m.UploadStudentModule),
data: {
menu: 'อัพโหลดข้อมูลผู้เข้าสอบ'
}
},
{
path: "check-student-info",
loadChildren: () =>
import(
"./feature/student-info/student-info.module"
).then((m) => m.StudentInfoModule),
data: {
menu: 'ตรวจสอบข้อมูลผู้สมัคร'
}
},
{
path: "create-exam-seat",
loadChildren: () =>
import(
"./feature/create-exam-seat/create-exam-seat.module"
).then((m) => m.CreatExamSeatModule),
data: {
menu: 'สร้างเลขที่นั่งสอบ'
}
},
{
path: "notification-check-exam",
loadChildren: () =>
import(
"./feature/notification-check-exam/notification-check-exam.module"
).then((m) => m.NotificationCheckExamModule),
data: {
menu: 'แจ้งเตือนการตรวจสอบ'
}
},
{
path: "create-exam-information",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-information/create-exam-information.module"
).then((m) => m.CreateExamInformationModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'ข้อมูลพื้นฐาน'
}
},
{
path: "create-exam-subject",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-subject/create-exam-subject.module"
).then((m) => m.CreateExamSubjectModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'กำหนดวิชาสอบ'
}
},
{
path: "create-exam-room",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-room/create-exam-room.module"
).then((m) => m.CreateExamRoomModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'กำหนดห้องสอบ'
}
},
{
path: "create-exam-condition",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-condition/create-exam-condition.module"
).then((m) => m.CreateExamConditionModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'กำหนดเงื่อนไข'
}
},
{
path: "create-exam-calendar",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-calendar/create-exam-calendar.module"
).then((m) => m.CreateExamCalendarModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'กำหนดปฏิทิน'
}
},
{
path: "seat-change",
loadChildren: () =>
import(
"./feature/candidate-list/seat-change/seat-change.module"
).then((m) => m.SeatChangeModule),
data: {
menu: 'จัดการที่นั่งสอบกับห้องสอบ',
sub_menu: 'ย้ายวันสอบ'
}
},
{
path: 'daily-summary-ttb',
loadChildren: () =>
import('./feature/exam-register/daily-summary-ttb/daily-summary-ttb.module').then(
(m) => m.DailySummaryTtbModule
),
data: {
menu: 'ลงทะเบียนสอบ',
sub_menu: 'รายงานรับเงิน TTB',
},
},
{
path: "special-period",
loadChildren: () =>
import(
"./feature/create-exam/create-exam-setup-period-by-subject/create-exam-setup-period-by-subject.module"
).then((m) => m.CreateExamSetupPeriodBySubjectModule),
data: {
menu: 'กำหนดข้อมูลรอบสอบ',
sub_menu: 'กำหนดวันสอบของวิชา'
}
},
{
path: "online-summary",
loadChildren: () =>
import(
"./feature/online-summary/online-summary.module"
).then((m) => m.OnlineSummaryModule),
data: {
menu: 'ลงทะเบียนสอบ',
sub_menu: 'รายงานรับเงินออนไลน์'
}
},
{
path: 'register-cancel',
loadChildren: () =>
import(
"./feature/exam-register/register-cancel/register-cancel.module"
).then((m) => m.RegisterCancelModule),
data: {
menu: 'ลงทะเบียนสอบ',
sub_menu: 'ยกเลิกรายการสมัคร'
}
},
{
path: 'extend-information-date',
loadChildren: () =>
import(
'./feature/extend-information/extend-information-date/extend-information-date.module'
).then((m) => m.ExtendInformationDateModule),
data: {
menu: 'ขยายรอบสอบ(ที่เปิดแล้ว)',
sub_menu: 'ขยายวันที่สอบ'
}
},
{
path: 'extend-information-room',
loadChildren: () =>
import(
'./feature/extend-information/extend-information-room/extend-information-room.module'
).then((m) => m.ExtendInformationRoomModule),
data: {
menu: 'ขยายรอบสอบ(ที่เปิดแล้ว)',
sub_menu: 'จัดการห้องสอบ'
}
},
],
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: "legacy" })],
exports: [RouterModule],
})
export class AppRoutingModule {}

View File

@@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

View File

@@ -0,0 +1,35 @@
import { TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'angular-folder-structure'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('angular-folder-structure');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to angular-folder-structure!');
});
});

10
src/app/app.component.ts Normal file
View File

@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'angular-folder-structure';
}

53
src/app/app.module.ts Normal file
View File

@@ -0,0 +1,53 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CoreModule } from './core/core.module';
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
import { appReducers } from './state/app-reducer';
import { environment } from '../environments/environment.prod';
import { EffectsModule } from '@ngrx/effects';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
import { MainLayoutComponent } from './layout/main-layout/main-layout.component';
import { MenuComponent } from './layout/menu/menu/menu.component';
import { ToolbarComponent } from './layout/toolbar/toolbar/toolbar.component';
import { SharedModule } from './shared/shared.module';
// for debugging
export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
return function(state, action) {
// console.log('state', state);
return reducer(state, action);
};
}
export const metaReducers: MetaReducer<any>[] = [debug];
@NgModule({
declarations: [
AppComponent,
MainLayoutComponent,
MenuComponent,
ToolbarComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
CoreModule,
SharedModule,
BrowserAnimationsModule,
StoreModule.forRoot(appReducers, {
metaReducers,
runtimeChecks: {
strictStateImmutability: false,
strictActionImmutability: false,
}
}),
EffectsModule.forRoot([]),
StoreDevtoolsModule.instrument({maxAge: 25, logOnly: environment.production}),
StoreRouterConnectingModule.forRoot(),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@@ -0,0 +1,93 @@
import { environment } from 'src/environments/environment';
import { Router, ActivatedRoute } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
import { tap } from 'rxjs/operators';
import { Location } from '@angular/common';
import { Directive } from '@angular/core';
@Directive()
export class BaseFormUid {
tinyMCE;
isHideForm: boolean = environment.hideForm
form: FormGroup
state: string
id: number
constructor(
public _router:Router,
public _activeRouter: ActivatedRoute,
public fb: FormBuilder,
public location: Location
){
this.form = this.createForm()
this._activeRouter.params.pipe(
tap(x => x.id ? this.state = 'edit' : this.state = 'add'),
tap(x => x.id ? this.id = x.id : this.id = null)
).subscribe()
this.mce()
}
back(){
// if(this.state == 'add') {
// this._router.navigate(['../'],{relativeTo: this._activeRouter})
// return
// }
this.location.back()
// this._router.navigate(['../'],{relativeTo: this._activeRouter})
}
createForm(){
return this.fb.group({})
}
mce(){
return this.tinyMCE = {
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table directionality',
'emoticons template paste textpattern autoresize',
],
document_base_url: 'test',
video_template_callback: function(data) {
return '<video width="' + 450 + '" height="' + 225 + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
},
relative_urls: false,
remove_script_host: true,
forced_root_block: false,
force_br_newlines: true,
force_p_newlines: false,
branding: false,
toolbar:
'media image code link',
image_advtab: true,
file_picker_callback: function (cb, value, meta) {
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/* audio/* video/*');
input.onchange = function() {
let file = input.files[0];
let reader = new FileReader();
const formData: FormData = new FormData();
formData.append('file', file, file.name)
reader.readAsDataURL(file);
}
input.click();
}
}
}
}
export var sortByProperty = function (property) {
return function (x, y) {
return ((x[property] === y[property]) ? 0 : ((x[property] > y[property]) ? 1 : -1));
};
};

View File

@@ -0,0 +1,95 @@
import { environment } from 'src/environments/environment';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
import { filter, startWith, switchMap, tap } from 'rxjs/operators';
import { Location } from '@angular/common';
import { Directive } from '@angular/core';
@Directive()
export class BaseForm {
tinyMCE;
isHideForm: boolean = environment.hideForm
form: FormGroup
state: string
id: any
role;
constructor(
public _router:Router,
public _activeRouter: ActivatedRoute,
public fb: FormBuilder,
public location: Location
){
this.form = this.createForm()
this._activeRouter.params.pipe(
tap(x => x.id ? this.state = 'edit' : this.state = 'add'),
tap(x => x.id ? this.id = x.id : this.id = null)
).subscribe()
this._router.events.pipe(
filter(r => r instanceof NavigationEnd),
tap(x => this.role = this._activeRouter.snapshot.parent.data)
).subscribe()
this.mce()
}
back(){
// if(this.state == 'add') {
// this._router.navigate(['../'],{relativeTo: this._activeRouter})
// return
// }
this.location.back()
// this._router.navigate(['../'],{relativeTo: this._activeRouter})
}
createForm(){
return this.fb.group({})
}
mce(){
return this.tinyMCE = {
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table directionality',
'emoticons template paste textpattern autoresize',
],
document_base_url: 'test',
video_template_callback: function(data) {
return '<video width="' + 450 + '" height="' + 225 + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
},
relative_urls: false,
remove_script_host: true,
forced_root_block: false,
force_br_newlines: true,
force_p_newlines: false,
branding: false,
toolbar:
'media image code link',
image_advtab: true,
file_picker_callback: function (cb, value, meta) {
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/* audio/* video/*');
input.onchange = function() {
let file = input.files[0];
let reader = new FileReader();
const formData: FormData = new FormData();
formData.append('file', file, file.name)
reader.readAsDataURL(file);
}
input.click();
}
}
}
}
export var sortByProperty = function (property) {
return function (x, y) {
return ((x[property] === y[property]) ? 0 : ((x[property] > y[property]) ? 1 : -1));
};
};

View File

@@ -0,0 +1,39 @@
import { Directive, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router';
import { Observable } from 'rxjs';
import { filter, startWith, switchMap, tap } from 'rxjs/operators';
import { environment } from 'src/environments/environment';
import { AppTokenService } from '../service/security/app-token.service';
@Directive()
export class BaseListRole {
isProduction = environment.production
@ViewChild(MatSort,{ static: true }) sort: MatSort;
@ViewChild(MatPaginator,{ static: true }) paginator: MatPaginator;
role;
protected updateMatTable(res: any){
res = new MatTableDataSource(res)
res.paginator = this.paginator
res.sort = this.sort
return res
}
constructor(
public router: Router,
public activeRoute: ActivatedRoute,
public apptokenSV: AppTokenService
){
this.router.events.pipe(
filter(r => r instanceof NavigationEnd),
startWith(this.router),
// tap(x => console.log(this.activeRoute.firstchild.data)),
switchMap(r => this.activeRoute.data),
// tap(x => console.log(x)),
tap(x => this.role = this.apptokenSV.getPerm(x.role))
).subscribe()
}
}

View File

@@ -0,0 +1,98 @@
// import { Directive, ViewChild } from '@angular/core';
// import { MatPaginator } from '@angular/material/paginator';
// import { MatSort } from '@angular/material/sort';
// import { MatTableDataSource } from '@angular/material/table';
// import { environment } from 'src/environments/environment';
// @Directive()
// export class BaseList {
// isProduction = environment.production
// @ViewChild(MatSort,{ static: true }) sort: MatSort;
// @ViewChild(MatPaginator,{ static: true }) paginator: MatPaginator;
// protected updateMatTable(res: any){
// res = new MatTableDataSource(res)
// res.paginator = this.paginator
// res.sort = this.sort
// return res
// }
// getIndex(i){
// return this.paginator.pageIndex * this.paginator.pageSize + i + 1
// }
// }
import { Observable } from 'rxjs';
import { Directive, Output, ViewChild, EventEmitter } from '@angular/core';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { environment } from 'src/environments/environment';
import { map, startWith } from 'rxjs/operators';
export interface ResultPageEvent<T> {
results: T[];
current_page: number;
page_count: number;
page_size: number;
row_count: number;
first_row_on_page: number;
last_row_on_page: number;
}
export interface CustomeEventPage extends PageEvent {
queryStringPage?: string,
paginator?: MatPaginator
}
@Directive()
export class BaseList {
protected INT_PAGING:CustomeEventPage = {
length: 0,
pageIndex: 0,
pageSize: 5,
previousPageIndex: null,
queryStringPage: `0/5`,
}
isProduction = environment.production
@ViewChild(MatSort,{ static: true }) sort: MatSort;
@ViewChild(MatPaginator,{ static: true }) paginator: MatPaginator;
@Output() onPaginatorPageChange = new EventEmitter<PageEvent>()
protected updateMatTable(res: any){
if(res instanceof Array){
res = new MatTableDataSource(res)
res.paginator = this.paginator
res.sort = this.sort
return res
}
return res
}
protected updatePagingMatabe<T>(data: ResultPageEvent<T>){
this.paginator.length = data.row_count
return data.results
}
protected getEventPage(): Observable<PageEvent> {
return this.paginator.page.pipe(
startWith(this.INT_PAGING),
map( event => {
return {
...event,
paginator: this.paginator,
queryStringPage: `${event.pageIndex + 1}/${event.pageSize}`
}
})
)
}
getIndex(i){
return this.paginator.pageIndex * this.paginator.pageSize + i + 1
}
}

View File

@@ -0,0 +1,92 @@
import { HttpClient, HttpEventType } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { environment } from 'src/environments/environment';
export interface IapiResponse<T>{
apiResponse:{
id:number,
desc:string,
},
data:Array<T>
}
export class OpenidService {
host:string = `${environment.openidPath}`
protected prefix:string = `${this.host}/openid`
protected fullUrl:string = ''
constructor(
endpoint:string,
protected http: HttpClient
) {
this.fullUrl = this.prefix + endpoint
}
// callService<T>(action: string, data?: any[]): Observable<IapiResponse<T>> {
// const body = {
// apiRequest: {
// action: action
// }
// , data: data || []
// };
// return this.http.post<IapiResponse<T>>(this.fullUrl, body)
// }
uploadDocument<HttpHeaderResponse>(target: FormData){
return this.http.post(this.fullUrl,target,{
reportProgress: true,
observe:'events'
}).pipe(
map((event) => {
switch(event.type){
case HttpEventType.UploadProgress:
const progress = Math.round(100 * event.loaded / event.total);
return { status: 'progress', message: `${progress}` };
case HttpEventType.Response:
return { status: 'success', message: event.body };
default:
return `Unhandled event: ${event.type}`;
}
}
),
catchError(err => {
return of({ status: 'error', message: `${err.message}` })
})
)
}
getAll<T>(): Observable<T[]>{
return this.http.get<T[]>(this.fullUrl)
}
add<T>(data: T): Observable<T> {
return this.http.post<T>(this.fullUrl,data)
}
get<T>(id: any): Observable<T> {
return this.http.get<T>(`${this.fullUrl}/${id}`)
}
update<T>(id: number,data: T): Observable<Response>{
return this.http.put<Response>(`${this.fullUrl}/${id}`,data)
}
update2<T>(data:T): Observable<Response>{
return this.http.put<Response>(this.fullUrl,data)
}
deleteData(id: number): Observable<Response> {
return this.http.delete<Response>(`${this.fullUrl}/${id}`)
}
query<T>(query: string): Observable<T> {
return this.http.get<T>(`${this.fullUrl}/${query}`)
}
search<T>(query: string): Observable<T> {
return this.http.get<T>(`${this.fullUrl}${query}`)
}
}

View File

@@ -0,0 +1,93 @@
import {HttpClient, HttpEventType} from '@angular/common/http';
import {Observable, of} from 'rxjs';
import {map, catchError} from 'rxjs/operators';
import {environment} from 'src/environments/environment';
export interface IapiResponse<T> {
apiResponse: {
id: number,
desc: string,
},
data: Array<T>
}
export class BaseService {
// host:string = 'https://ru.71dev.com/etest-admin'
host: string = `${environment.adminApi}`
protected prefix: string = `${this.host}/api`
protected fullUrl: string = ''
constructor(
endpoint: string,
protected http: HttpClient
) {
this.fullUrl = this.prefix + endpoint
}
// callService<T>(action: string, data?: any[]): Observable<IapiResponse<T>> {
// const body = {
// apiRequest: {
// action: action
// }
// , data: data || []
// };
// return this.http.post<IapiResponse<T>>(this.fullUrl, body)
// }
uploadDocument<HttpHeaderResponse>(target: FormData) {
return this.http.post(this.fullUrl, target, {
reportProgress: true,
observe: 'events'
}).pipe(
map((event) => {
switch (event.type) {
case HttpEventType.UploadProgress:
const progress = Math.round(100 * event.loaded / event.total);
return {status: 'progress', message: `${progress}`};
case HttpEventType.Response:
return {status: 'success', message: event.body};
default:
return `Unhandled event: ${event.type}`;
}
}
),
catchError(err => {
return of({status: 'error', message: `${err.message}`})
})
)
}
getAll<T>(): Observable<T[]> {
return this.http.get<T[]>(this.fullUrl)
}
add<T>(data: T): Observable<T> {
return this.http.post<T>(this.fullUrl, data)
}
get<T>(id: any): Observable<T> {
return this.http.get<T>(`${this.fullUrl}/${id}`)
}
update<T>(id: number, data: T): Observable<Response> {
return this.http.put<Response>(`${this.fullUrl}/${id}`, data)
}
update2<T>(data: T): Observable<Response> {
return this.http.put<Response>(this.fullUrl, data)
}
deleteData(id: number): Observable<Response> {
return this.http.delete<Response>(`${this.fullUrl}/${id}`)
}
query<T>(query: string): Observable<T> {
return this.http.get<T>(`${this.fullUrl}/${query}`)
}
search<T>(query: string): Observable<T> {
return this.http.get<T>(`${this.fullUrl}${query}`)
}
}

View File

@@ -0,0 +1,36 @@
import { Router, ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators';
import { Directive, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
@Directive()
export class BaseSubList {
state: string
id: number
constructor(
public _activeRouter: ActivatedRoute,
){
this._activeRouter.params.pipe(
tap(x => x.id ? this.state = 'edit' : this.state = 'add'),
tap(x => x.id ? this.id = x.id : this.id = null)
).subscribe()
}
@ViewChild(MatSort,{ static: true }) sort: MatSort;
@ViewChild(MatPaginator,{ static: true }) paginator: MatPaginator;
protected updateMatTable(res: any){
if(res instanceof Array){
res = new MatTableDataSource(res)
res.paginator = this.paginator
res.sort = this.sort
return res
}
return res
}
getIndex(i){
return this.paginator.pageIndex * this.paginator.pageSize + i + 1
}
}

View File

@@ -0,0 +1,49 @@
export class BaseTiny {
tinyMCE
protected id: number
protected state: string
constructor(
) {
this.tinyMCE = {
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table directionality',
'emoticons template paste textpattern autoresize',
],
document_base_url: 'test',
video_template_callback: function(data) {
return '<video width="' + 450 + '" height="' + 225 + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
},
relative_urls: false,
remove_script_host: true,
forced_root_block: false,
force_br_newlines: true,
force_p_newlines: false,
branding: false,
toolbar:
'media image code link',
image_advtab: true,
file_picker_callback: function (cb, value, meta) {
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/* audio/* video/*');
input.onchange = function() {
let file = input.files[0];
let reader = new FileReader();
const formData: FormData = new FormData();
formData.append('file', file, file.name);
// uploadSV.uploadDocument(formData).subscribe((x: any) => {
// if (x.status === 'success'){
// cb(x.message[0].file_name)
// }
// });
reader.readAsDataURL(file);
}
input.click();
}
}
}
}

View File

View File

@@ -0,0 +1,23 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { TokenIntercepterInterceptor } from './intercepter/token-intercepter.interceptor';
import { AuthGuard } from './guards/auth.guard';
@NgModule({
declarations: [],
imports: [
CommonModule,
HttpClientModule,
],
exports: [
CommonModule,
HttpClientModule,
],
providers: [
AuthGuard,
{ provide: HTTP_INTERCEPTORS, useClass: TokenIntercepterInterceptor, multi: true },
]
})
export class CoreModule { }

76
src/app/core/enum/role.ts Normal file
View File

@@ -0,0 +1,76 @@
export enum OBJECT {
SET_SUB_EXAM = 'SET-SUB-EXAM',
SET_INFO_EXAM = 'SET-INFO-EXAM',
MN_EXAM_BRANCH = 'MN-EXAM-BRANCH',
EXAM_REG = 'EXAM-REG',
CHK_EXM_INFO = 'CHK-EXAMINEE-INFO',
CHK_CAD_LIST = 'CHK-CANDIDATE-LIST',
PERM = 'PERM',
SETTINGS = 'SETTINGS',
PAYMENT = 'PAYMENT',
CH_EX_DAY_PERM = 'CH-EXAM-DAY-PERM',
PRINT_EXAM_CARD = 'PRINT-EX-CARD',
SET_PRINT_CARD = 'SET-PRINT-CARD',
PRINT_EXAM_RESULT = 'PRINT-EXAM-RESULT',
STUDENT_INFO = 'STUDENT-INFO',
CHECK_STUDENT_INFO = 'CHECK-STUDENT-INFO',
MANAGE_PAYMENT = 'MANAGE-PAYMENT',
REPORT = 'REPORT',
CRE_EX_INFO = 'CRE-EX-INFO',
MN_EX_OFF = 'MN-EX-OFF',
CHG_EX_INFO = 'CHG-EX-INFO',
RANDOM_QUESTIONS = 'RANDOM-QUESTIONS',
GRADE_SUMMARY = 'GRADE-SUMMARY',
REGISTER_SUMMARY = 'REGISTER-SUMMARY',
MANAGE_RECEIPT = 'MANAGE-RECEIPT',
PERIOD_SUMMARY = 'PERIOD-SUMMARY',
DAILY_SUMMARY = 'DAILY-SUMMARY',
DAILY_SUMMARY_TTB = 'DAILY_SUMMARY_TTB',
IMPORT_PAYMENT = 'IMPORT-PAYMENT',
CONFIRM_PAYMENT = 'CONFIRM-PAYMENT',
PERM_GROUP = 'PERM-GROUP',
CREATE_USER = 'CREATE-USER',
SET_USER = 'SET-USER',
USER_COUNTER = 'USER-COUNTER',
CALENDAR = 'CALENDAR',
BRANCH = 'BRANCH',
TESTING_FIELD = 'TESTING-FIELD',
FACULTY = 'FACULTY',
EDUCATION_TYPE = 'EDUCATION-TYPE',
ACADEMIC_YEAR = 'ACADEMIC-YEAR',
ACADEMIC_SEMESTER = 'ACADEMIC-SEMESTER',
SUBJECT_TYPE = 'SUBJECT-TYPE',
SET_EX_FINANCE = 'SET-EX-FINANCE',
SET_TEA_FINANCE = 'SET-TEA-FINANCE',
SET_INV_FINANCE = 'SET-INV-FINANCE',
CON_EX = 'CON-EX',
RES_EX = 'RES-EX',
TAB_EX = 'TAB-EX',
CHK_EX = 'CHK-EX',
CREATE_EXAM_SEAT = 'CREATE-EXAM-SEAT',
NOTI_CHECK_EXAM = 'NOTI-CHECK-EXAM',
CHANGE_EXAM_ROOM = 'CHANGE-EXAM-ROOM',
SET_TESTING_INFO_EXAM = 'SET-TESTING-INFO-EXAM',
SET_TESTING_INFO_EXAM_BASIC = 'SET-TESTING-INFO-EXAM-BASIC',
SET_TESTING_INFO_EXAM_CALENDAR = 'SET-TESTING-INFO-EXAM-CALENDAR',
SET_TESTING_INFO_EXAM_SUBJECT = 'SET-TESTING-INFO-EXAM-SUBJECT',
SET_TESTING_INFO_EXAM_ROOM = 'SET-TESTING-INFO-EXAM-ROOM',
SET_TESTING_INFO_EXAM_COND = 'SET-TESTING-INFO-EXAM-COND',
APPROVE_EXAM = 'APPROVE-EXAM',
REJECT_EXAM = 'REJECT-EXAM',
SEAT_CHANGE = 'SEAT-CHANGE',
SPECIAL_PERIOD = 'SPECIAL-PERIOD',
MANAGE_EXAM_ROOM_AND_SEAT = 'MANAGE-EXAM-ROOM-AND-SEAT',
EXTEND_INFORMATION_DATE = 'EXTEND_INFORMATION_DATE',
EXTEND_INFORMATION_ROOM = 'EXTEND_INFORMATION_ROOM',
ONLINE_SUMMARY = 'ONLINE-SUMMARY',
CREATE_EXAM = 'CREATE-EXAM',
CANDIDATE_PAYMENT_STATUS = 'CANDIDATE-PAYMENT-STATUS',
RECIPIENT_SIGNATURE = 'RECIPIENT-SIGNATURE',
ONLINE_COUNTER = 'ONLINE-COUNTER',
REGISTER_CANCEL = 'REGISTER_CANCEL',
CANCEL_TIME = 'CANCEL_TIME',
UPLOAD_VIDEO = 'UPLOAD_VIDEO',
DEPARTMENT = 'DEPARTMENT',
MANAGE_CANDIDATE_LIST = 'MANAGE-CANDIDATE-LIST'
}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AuthGuard } from './auth.guard';
describe('AuthGuard', () => {
let guard: AuthGuard;
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(AuthGuard);
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});

View File

@@ -0,0 +1,29 @@
import { Injectable } from "@angular/core";
import { CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from "@angular/router";
import { Observable } from "rxjs";
import { OidcAuthService } from "../service/oidc/oidc.service";
@Injectable()
export class AuthGuard implements CanActivate,CanActivateChild {
constructor(
private odicSV: OidcAuthService
){
}
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {
return this.canActivate(childRoute,state)
}
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if (this.odicSV.isLoggedIn()) {
return true
}
this.odicSV.startAuthentication()
return false;
}
}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TokenIntercepterInterceptor } from './token-intercepter.interceptor';
describe('TokenIntercepterInterceptor', () => {
beforeEach(() => TestBed.configureTestingModule({
providers: [
TokenIntercepterInterceptor
]
}));
it('should be created', () => {
const interceptor: TokenIntercepterInterceptor = TestBed.inject(TokenIntercepterInterceptor);
expect(interceptor).toBeTruthy();
});
});

View File

@@ -0,0 +1,41 @@
import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { catchError, finalize } from 'rxjs/operators';
import { OidcAuthService } from '../service/oidc/oidc.service';
import { AppTokenService } from '../service/security/app-token.service';
import { Router } from '@angular/router';
import { NgProgress } from 'ngx-progressbar';
// import { NgProgress } from 'ngx-progressbar';
// import { AppTokenService } from '../service/security/app-token.service';
@Injectable()
export class TokenIntercepterInterceptor implements HttpInterceptor {
constructor( private odicOpenService: OidcAuthService,
public appTokenService : AppTokenService,
private router: Router,
private progress: NgProgress
) {
}
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
const customReq = request.clone({
setHeaders:{
Authorization: request.url.includes('app_tokens') ? this.odicOpenService.getAuthorizationHeaderValue() : `Bearer ${this.appTokenService.getToken()}`
}
})
this.progress.ref('home-progress').start()
return next.handle(customReq).pipe(
finalize(() => this.progress.ref('home-progress').complete())
);
}
}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TestingCenterService } from './testing-center.service';
describe('TestingCenterService', () => {
let service: TestingCenterService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TestingCenterService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class TestingCenterService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/testing_centers', http);
}
getByBrandID(BrandID){
return this.http.get(`${this.fullUrl}?branch_uid=${BrandID}`);
}
getByFiledID(FieldID){
return this.http.get(`${this.fullUrl}?testing_field_uid=${FieldID}`);
}
getAvailableSeat(data){
return this.http.get(`${this.prefix}/v1/setting/testing_center_chk_seat/${data.testing_center_uid}/${data.from_date}/${data.to_date}`);
}
}

View File

@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AppService } from './app.service';
describe('AppService', () => {
let service: AppService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AppService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AppService {
constructor() { }
}

View File

@@ -0,0 +1,23 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class CardPrintingTimeService extends BaseService {
constructor(
public http : HttpClient
) {
super('/v1/information/testing_periods',http)
}
getTime(id){
return this.http.get(`${this.prefix}/v1/information/testing_period_list_by_infomation/${id}`);
}
changeTime(data){
return this.http.put(`${this.prefix}/v1/information/list_testing_period`,data);
}
}

View File

@@ -0,0 +1,16 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {BaseService} from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class CardPrintingService extends BaseService {
studentList: any = [];
constructor(
public http: HttpClient
) {
super('/v1/information/card_printing', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class TestingScoreService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/information/testing_score',http)
}
}

View File

@@ -0,0 +1,17 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {environment} from 'src/environments/environment';
import {BaseService} from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class CandidateTypeService extends BaseService {
constructor(
public http: HttpClient
) {
super(`/${environment.apiVersion}/enrollment/candidate_types`, http)
super.fullUrl = `${environment.enrollmentApi}/api/${environment.apiVersion}/enrollment/candidate_types`
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { BaseService } from '../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class TestingRegisterEnrollmentService extends BaseService {
constructor(
public http: HttpClient
) {
super(`/${environment.apiVersion}/enrollment/testing_registers`,http);
super.fullUrl = `${environment.enrollmentApi}/api/${environment.apiVersion}/enrollment`;
}
paid(registerUid){
return this.http.put<Response>(`${this.fullUrl}/cancle/${registerUid}`,null);
}
cancle(registerUid){
return this.http.put<Response>(`${this.fullUrl}/cancel/${registerUid}`,null);
}
cancleAdmin(registerUid){
return this.http.put<Response>(`${this.prefix}/v1/register/cancel_testing_receipts/${registerUid}`,null);
}
deleteAdmin(registerUid){
return this.http.delete<Response>(`${this.prefix}/v1/register/testing_registers/${registerUid}`);
}
}

View File

@@ -0,0 +1,55 @@
import { Injectable } from "@angular/core";
import { User, UserManager, UserManagerSettings } from "oidc-client";
import { environment } from "src/environments/environment";
export function getClientSettings() :UserManagerSettings {
return environment.clientSettings
}
@Injectable({
providedIn: 'root'
})
export class OidcAuthService {
public manager = new UserManager(getClientSettings())
public user: User = null
constructor() {
this.manager.getUser().then(user => {
this.user = user;
});
}
isLoggedIn(): boolean {
return this.user != null && !this.user.expired;
}
getClaims(): any {
return this.user.profile;
}
getAuthorizationHeaderValue(): string {
return `${this.user.token_type} ${this.user.access_token}`;
}
startAuthentication(): Promise<void> {
return this.manager.signinRedirect();
}
completeAuthentication(): Promise<void> {
return this.manager.signinRedirectCallback().then(user => {
// console.log(user)
this.user = user;
}).catch(err => {
// console.log('error')
});
}
logout(){
this.manager.signoutRedirect(
{id_token_hint: this.user.id_token}
).then(res => console.log(res))
}
}

View File

@@ -0,0 +1,30 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { OpenidService } from '../../base/base-openid-service';
@Injectable({
providedIn: 'root'
})
export class UserOpenidService extends OpenidService {
constructor(
public http: HttpClient
) {
super('/user',http)
}
changePassword(uid,data){
return this.http.put(`${this.prefix}/password/${uid}`,data)
}
active(uid){
return this.http.put(`${this.prefix}/user/active/${uid}`,null)
}
inactive(uid){
return this.http.put(`${this.prefix}/user/inactive/${uid}`,null)
}
searchUser(uid){
return this.http.get(`${this.prefix}/search_user${uid}`)
}
}

View File

@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class UserCounterLoginService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/permission/counter_login', http);
}
checkpin(pin){
return this.http.post(`${this.fullUrl}/${pin}`,null);
}
}

View File

@@ -0,0 +1,27 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class UserCountersService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/permission/counters', http)
}
getByInfo(id){
return this.http.get(`${this.fullUrl}_by_information/${id}`)
}
getCounterSummary(CounterNo, CounterId, Period){
return this.http.get(`${this.prefix}/v1/permission/counter_summary_by_period/${CounterNo}/${CounterId}/${Period}`)
}
logout(pin){
return this.http.put(`${this.prefix}/v1/permission/counter_logout/${pin}`, null);
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class ProviceService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/provinces',http)
}
}

View File

@@ -0,0 +1,35 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class QuestionCategoryService extends BaseService {
constructor(
public http: HttpClient
) {
super('v1/question/question_category',http)
super.fullUrl = `${environment.storeApi}/api/question/question_category`
}
getSubject(id){
return this.http.get(`${this.fullUrl}_detail?subject_uid=${id}`)
}
getAllSubject(id){
return this.http.get(`${this.fullUrl}_detail2?subject_uid=${id}`)
}
getSubjectWithInstructor(id){
return this.http.get(`${this.fullUrl}_detail3?subject_uid=${id}`)
}
getCategoryType(subject,category){
return this.http.get(`${this.fullUrl}_detail2_one_cat?subject_uid=${subject}&question_category_master_uid=${category}`)
}
}

View File

@@ -0,0 +1,14 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class RegionService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/regions',http)
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class CandidateRegisteredByCenterService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/candidates_registered_by_center', http)
}
getPdfReport(academic_year_uid, academic_semester_uid, branch_uid, testing_field_uid, testing_center_uid , subject_uid) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${subject_uid}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(academic_year_uid, academic_semester_uid, branch_uid, testing_field_uid, testing_center_uid , subject_uid) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${subject_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class CandidateRegisteredBySubjectService extends BaseService{
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/candidates_registered_by_subject', http)
}
getPdfReport(subject_uid,academic_year_uid,academic_semester_uid) {
this.requestUrl = `${this.fullUrl}/${subject_uid}/${academic_year_uid}/${academic_semester_uid}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(subject_uid,academic_year_uid,academic_semester_uid) {
this.requestUrl = `${this.fullUrl}/${subject_uid}/${academic_year_uid}/${academic_semester_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class CandidateSubjectService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/candidate_registered_by_subject', http)
}
getPdfReport(academic_year_uid, academic_semester_uid, subject_uid) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${subject_uid}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(academic_year_uid, academic_semester_uid, subject_uid) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${subject_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class CandidateService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/application', http)
}
getPdfReport(informationUid, academicyearUid, academicsemesterUid, fromdate, todate) {
// console.log(this.fullUrl);
this.requestUrl = `${this.fullUrl}/${informationUid}/${academicyearUid}/${academicsemesterUid}/${fromdate}/${todate}/pdf`;
// console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(informationUid, academicyearUid, academicsemesterUid, fromdate, todate) {
this.requestUrl = `${this.fullUrl}/${informationUid}/${academicyearUid}/${academicsemesterUid}/${fromdate}/${todate}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,31 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class DailyRegisterPaymentTotalService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/payment/print/total_daily_register_payment', http)
}
etest102(data) {
return (`${this.fullUrl}/${data.date}/${data.counter_no}/view/${data.period}`)
}
etest102Online(data) {
return (`${this.fullUrl}_online/${data.date}/view`)
}
etest102Information(data) {
return (`${this.fullUrl}_testing_information/${data.testing_information_uid}/${data.date}/${data.counter_no}/view/${data.period}`)
}
etest102InformationOnline(data) {
return (`${this.fullUrl}_online_testing_information/${data.testing_information_uid}/${data.date}/view`)
}
}

View File

@@ -0,0 +1,31 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class DailyRegisterPaymentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/payment/print/daily_register_payment', http)
}
etest101(data) {
return (`${this.fullUrl}/${data.counter_no}/${data.date}/${data.period}/view`)
}
etest101Online(data) {
return (`${this.fullUrl}_online/${data.date}/view?is_cash=${data.is_cash}/is_credit_card=${data.is_credit_card}/is_qrcode=${data.is_payin}/is_qrcode=${data.is_payin}`)
}
etest101Information(data) {
return (`${this.fullUrl}_testing_information/${data.testing_information_uid}/${data.counter_no}/${data.date}/${data.period}/view`)
}
etest101InformationOnline(data) {
return (`${this.fullUrl}_testing_information_online/${data.testing_information_uid}/${data.date}/view?is_cash=${data.is_cash}/is_credit_card=${data.is_credit_card}/is_qrcode=${data.is_payin}/is_qrcode=${data.is_payin}`)
}
}

View File

@@ -0,0 +1,23 @@
import { Injectable } from '@angular/core';
import {BaseService} from '../../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class EligibleCandidateService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/eligible_candidate', http)
}
getReportWithTestInforUid(tsetInUid){
this.requestUrl = `${this.fullUrl}?testing_information_uid=${tsetInUid}`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,21 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { BaseService } from 'src/app/core/base/base-service';
import { SweetalertService } from '../../sweetalert/sweetalert';
@Injectable({
providedIn: 'root'
})
export class TestingCardService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/registration/print/testing_card',http)
}
print(id){
return (`${this.fullUrl}/${id}/view`)
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class ExamResultPrintService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/registration/print/testing_grade',http)
}
print(id){
return (`${this.fullUrl}/${id}/view`)
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
import {environment} from '../../../../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class ExamResultSubjectService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report//Test/exam_result_subject', http)
super.fullUrl = `${environment.storeApi}/api/report/Test/exam_result_subject`
}
// ${this.fullUrl}
getPdfReport(subject_uid,testing_information_uid,period_id,test_date) {
this.requestUrl = `${this.fullUrl}/${period_id}/${test_date}/${subject_uid}/${testing_information_uid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(subject_uid,testing_information_uid,period_id,test_date){
this.requestUrl = `${this.fullUrl}/${period_id}/${test_date}/${subject_uid}/${testing_information_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
import {environment} from '../../../../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class ExamTotalService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/Test/exam_result_subject', http)
super.fullUrl = `${environment.storeApi}/api/report/Test/exam_total`
}
// ${this.fullUrl}
getPdfReport(testing_information_uid) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid){
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import {BaseService} from '../../../base/base-service';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../../../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class ExcelAllTestService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/tests/export/excel_all_test', http)
super.fullUrl = `${environment.storeApi}/api/tests/export/excel_all_test`
}
getExcelReport(testing_information_code){
this.requestUrl = `${this.fullUrl}/${testing_information_code}`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class ReportInvigilatorCostService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/candidate/print/invigilator_cost', http)
}
report(uid){
return (`${this.fullUrl}_export/${uid}`)
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class PaymentAndApplicationByCenterService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/payment_and_application_by_center', http)
}
getPdfReport(academic_year_uid,academic_semester_uid,branch_uid,testing_field_uid,testing_center_uid,subject_uid,from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${subject_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(academic_year_uid,academic_semester_uid,branch_uid,testing_field_uid,testing_center_uid,subject_uid,from_date,to_date) {
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class PaymentAndApplicationBySubjectService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/payment_and_application_by_subject', http)
}
getPdfReport(academic_year_uid,academic_semester_uid,subject_uid,from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${subject_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(academic_year_uid,academic_semester_uid,subject_uid,from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${subject_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,23 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class PeriodRegisterPaymentOnlineService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/payment/print/period_register_payment_online',http)
}
etest103Online(data){
return (`${this.fullUrl}/${data.start_date}/${data.end_date}/view`)
}
etest103InformationOnline(data) {
return (`${this.fullUrl}_testing_information/${data.testing_information_uid}/${data.start_date}/${data.end_date}/view`)
}
}

View File

@@ -0,0 +1,23 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class PeriodRegisterPaymentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/report/payment/print/period_register_payment', http)
}
etest103(data) {
return (`${this.fullUrl}/${data.start_date}/${data.end_date}/view`)
}
etest103Information(data) {
return (`${this.fullUrl}_testing_information/${data.testing_information_uid}/${data.start_date}/${data.end_date}/view`)
}
}

View File

@@ -0,0 +1,71 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class ReceiptByPaymentCodeService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/print/receipt_by_payment_code', http)
}
getPDF(paymentcode){
return this.http.get(`https://ru.71dev.com/etest-admin/api/report/print/receipt_by_payment_code/256400052/pdf`);
}
getPdfReport(paymentcode) {
this.requestUrl = `${this.fullUrl}/${paymentcode}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getPdfReportRealUat(registeruid) {
// this.requestUrl = `${this.fullUrl}/${registeruid}/pdf`;
this.requestUrl = `${environment.adminApi}/api/report/print/receipt_form_for_all/${registeruid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getPdfReportReceiptForAll(registeruid) {
// this.requestUrl = `${this.fullUrl}/${registeruid}/pdf`;
this.requestUrl = `${environment.adminApi}/api/report/print/receipt_for_all/${registeruid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getPdfReportCopy(paymentcode) {
this.requestUrl = `${environment.adminApi}/api/report/print/receipt_copy_by_payment_code/${paymentcode}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getPdfReportCopyRealUat(registeruid) {
this.requestUrl = `${environment.adminApi}/api/report/print/receipt_copy_for_all/${registeruid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
// return this.http.get<T>(`${environment.adminApi}/api/v1/register/testing_receipts_paymant/${paymentcode}`);
}

View File

@@ -0,0 +1,26 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class ReceiptAllService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/print/receipt_form_for_all', http)
}
getPdfReport(registeruid) {
this.requestUrl = `${this.fullUrl}/${registeruid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
}

View File

@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class RecieptService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/print/receipt', http)
}
getPdfReport(registeruid) {
this.requestUrl = `${this.fullUrl}/${registeruid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
}

View File

@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class RegisterByPaymentService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/register_by_payment', http)
}
getPdfReport(testing_information_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,35 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
import {environment} from '../../../../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class SeparatedByExamCenterService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report//Test/separated_by_exam_center', http)
super.fullUrl = `${environment.storeApi}/api/report/Test/separated_by_exam_center`
}
getPdfReport(testing_information_uid, subject_uid, branch_uid,start_date,end_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${subject_uid}/${branch_uid}/${start_date}/${end_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid, subject_uid, branch_uid,start_date,end_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${subject_uid}/${branch_uid}/${start_date}/${end_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,35 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SettingTestingCenterService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/setting_testing_center', http)
}
getPdfReport(testing_information_uid,academic_year_uid,academic_semester_uid,from_date,to_date) {
this.requestUrl =
`${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid,academic_year_uid,academic_semester_uid,from_date,to_date) {
this.requestUrl =
`${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,66 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import { environment } from 'src/environments/environment';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SettingTestingRoomService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/setting_testing_room', http)
}
getPdfReport(testing_information_uid,academic_year_uid,academic_semester_uid,branch_uid,testing_field_uid,testing_center_uid,from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid,academic_year_uid,academic_semester_uid,branch_uid,testing_field_uid,testing_center_uid,from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
getPdfReport16(subject_uid,testing_information_uid) {
this.requestUrl = `${environment.storeApi}/api/report/Test/exam_result_subject/${subject_uid}/${testing_information_uid}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport16(subject_uid,testing_information_uid) {
this.requestUrl = `${environment.storeApi}/api/report/Test/exam_result_subject/${subject_uid}/${testing_information_uid}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
getPdfReport17(testing_information_uid,academic_year_code,academic_semester_code,branch_uid,testing_center_uid,room_name_th) {
this.requestUrl = `${environment.storeApi}/api/report/Test/summary_candidates_absentees_passers/${testing_center_uid}/${academic_year_code}/${branch_uid}/${testing_information_uid}/${academic_semester_code}/${room_name_th}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport17(testing_information_uid,academic_year_code,academic_semester_code,branch_uid,testing_center_uid,room_name_th) {
this.requestUrl = `${environment.storeApi}/api/report/Test/summary_candidates_absentees_passers/${testing_center_uid}/${academic_year_code}/${branch_uid}/${testing_information_uid}/${academic_semester_code}/${room_name_th}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SignatureExaminationService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/signature_examination', http)
}
getPdfReport(testing_information_uid,branch_uid,testing_field_uid,testing_center_uid,period_id,test_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${period_id}/${test_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid,branch_uid,testing_field_uid,testing_center_uid,period_id,test_date){
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${branch_uid}/${testing_field_uid}/${testing_center_uid}/${period_id}/${test_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {BaseService} from '../../../base/base-service';
import {HttpClient} from '@angular/common/http';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SummaryCandidateService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/candidate/print/summary_application', http)
}
getPdfReport(academic_year_uid, academic_semester_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(academic_year_uid, academic_semester_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,29 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../../../../environments/environment';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SummaryCandidatesAbsenteesPassersService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/Test/summary_candidates_absentees_passers', http)
super.fullUrl = `${environment.storeApi}/api/report/Test/summary_candidates_absentees_passers`
}
getPdfReport(testing_information_uid,academic_year_code,academic_semester_code,branch_uid,testing_center_uid,room_name_th) {
this.requestUrl = `${this.fullUrl}/${testing_center_uid}/${academic_year_code}/${branch_uid}/${testing_information_uid}/${academic_semester_code}/${room_name_th}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class TestingCenterInformationService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/testing_center_information', http)
}
getPdfReport(testing_information_uid, subject_uid, academic_year_uid,academic_semester_uid,from_date, to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${subject_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid, subject_uid, academic_year_uid,academic_semester_uid,from_date, to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${subject_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {BaseService} from "../../../base/base-service";
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class TestingRegistrationService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/testing_registration', http)
}
getPdfReport(testing_information_uid,academic_year_uid, academic_semester_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid,academic_year_uid, academic_semester_uid, from_date,to_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${academic_year_uid}/${academic_semester_uid}/${from_date}/${to_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import {map} from 'rxjs/operators';
import {BaseService} from '../../../base/base-service';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../../../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class TestingRoomService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/testing_room', http)
}
getPdfReport(testing_information_uid) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid){
this.requestUrl = `${this.fullUrl}/${testing_information_uid}`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../../../base/base-service';
import {map} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class TestingSeatAndRoomService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/registration/print/testing_seat_room', http)
}
getPdfReport(testing_information_uid,branch_uid,period_id, test_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${branch_uid}/${period_id}/${test_date}/pdf`;
console.log(this.requestUrl);
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid,branch_uid,period_id, test_date) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/${branch_uid}/${period_id}/${test_date}/xls`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import {map} from 'rxjs/operators';
import {BaseService} from '../../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class TesingSubjectService extends BaseService {
requestUrl;
constructor(
public http: HttpClient
) {
super('/report/testing_subject', http)
}
getPdfReport(testing_information_uid) {
this.requestUrl = `${this.fullUrl}/${testing_information_uid}/pdf`;
return this.http.get(this.requestUrl, { responseType: 'blob', observe: 'response'}).pipe(
map((res: any) => {
return new Blob([res.body], { type: 'application/pdf' });
})
);
}
getExcelReport(testing_information_uid){
this.requestUrl = `${this.fullUrl}/${testing_information_uid}`;
window.open(this.requestUrl);
return this.requestUrl;
}
}

View File

@@ -0,0 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class RuStudentRegistersService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student/ru_student_registers',http)
}
}

View File

@@ -0,0 +1,27 @@
import { HttpClient, HttpEventType } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { map } from 'rxjs/internal/operators/map';
import { catchError } from 'rxjs/operators';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class RuStudentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student/ru',http)
}
uploadStudent(target: FormData){
return this.http.post(`${this.fullUrl}/student_upload`,target)
}
registerUpload(code,target: FormData){
return this.http.post(`${this.fullUrl}/register_upload/${code}`,target)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AppObjectService extends BaseService {
constructor(
public http: HttpClient
) {
super('/security/app_objects',http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AppPermissionService extends BaseService {
constructor(
public http: HttpClient
) {
super('/security/app_permissions',http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AppRoleService extends BaseService {
constructor(
public http: HttpClient
) {
super('/security/app_roles',http)
}
}

View File

@@ -0,0 +1,72 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { JwtHelperService } from '@auth0/angular-jwt';
import { tap } from 'rxjs/operators';
import { BaseService } from '../../base/base-service';
export interface Right {
obj: string;
perm: string;
filter: string;
}
export interface UserToken {
login: string;
display: string;
token: string;
rights: Right[];
user_uid: string;
}
export interface ExtractUser {
// งานหลักสูตร|ALL: string;
user_uid: string;
login_name: string;
display_name: string;
agency_uid: string;
exp: number;
iss: string;
aud: string;
}
@Injectable({
providedIn: 'root'
})
export class AppTokenService extends BaseService {
user: UserToken
constructor(public http : HttpClient) {
super('/security/app_tokens',http);
}
exchangeToken(){
return this.http.get<UserToken>(`${this.fullUrl}`,{}).pipe(
// tap(x => console.log(x)),
tap(res => this.user = {...res})
)
}
getDataTokens(){
return this.http.get(`${this.fullUrl}`)
}
getToken() {
return this.user?.token
}
getPerm(role){
// console.log(role)
// console.log(this.user)
return this.user.rights.find(obj => obj.obj == role)?.perm
}
decodeToken(): ExtractUser {
const helper = new JwtHelperService();
const decodedToken = helper.decodeToken(this.user?.token);
// console.log(decodedToken)
return decodedToken
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AppUserService extends BaseService {
constructor(
public http: HttpClient
) {
super('/security/app_users',http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class InsturctorPaymentAccoutService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/instructor_payment_accounts', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class invigilatorCostService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/invigilator_costs', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AcademicSemesterService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/academic_semesters', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class AcademicYearService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/academic_years', http)
}
}

View File

@@ -0,0 +1,20 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class BranchService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/branchs', http);
}
getAllStatus1(){
return this.http.get(`${this.fullUrl}?status_id=1`);
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class CalendarTypeService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/calendar_types', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class DepartmentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/departments', http);
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class EducationTypesService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/education_types', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class FacultysService extends BaseService{
constructor(
public http: HttpClient
) {
super('/v1/setting/facultys', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class OnlineCountersService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/online_counters', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class RecipientSignatureService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/recipient_signature', http)
}
}

View File

@@ -0,0 +1,15 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class SubjectTypesService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/subject_types', http)
}
}

View File

@@ -0,0 +1,27 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class SubjectsService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/subjects', http)
}
upload(data){
return this.http.post(`${this.fullUrl}/upload`,data)
}
getSubjectReady(){
return this.http.get(`${this.fullUrl}?status_id=1`);
}
check(uid){
return this.http.get(`${this.prefix}/v1/setting/check_subjects/${uid}`)
}
}

View File

@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import {BaseService} from '../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class TestingFieldService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/setting/testing_fields', http);
}
getByBrandID(BrandID){
return this.http.get(`${this.fullUrl}?branch_uid=${BrandID}`);
}
}

View File

@@ -0,0 +1,14 @@
import { Injectable } from '@angular/core';
import {BaseService} from '../../base/base-service';
import {HttpClient} from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class TestingVdosService extends BaseService{
constructor(
public http: HttpClient
) {
super('/v1/setting/testing_vdos', http);
}
}

View File

@@ -0,0 +1,17 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class SubjectInformationService extends BaseService {
constructor(
public http: HttpClient
) {
super('v1/question/question_category',http)
super.fullUrl = `${environment.storeApi}/api/question/subject_information`
}
}

View File

@@ -0,0 +1,22 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class SyncStoreService extends BaseService {
constructor(
public http: HttpClient
) {
super('',http)
super.fullUrl = `${environment.storeApi}/api/sync`
}
deleteTest(uid,subject){
return this.http.delete(`${this.fullUrl}/delete_test/${uid}?subject_uid=${subject}`)
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class StudentPaymentConfirmService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student_payment/student_payment_confirm',http)
}
getByDate(date){
return this.http.get(`${this.fullUrl}/${date}`)
}
}

View File

@@ -0,0 +1,19 @@
import {HttpClient, HttpHeaders} from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class StudentPaymentNotPaidService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student_payment/student_payment_not_paid',http)
}
putNotPaids(data){
return this.http.put(`${this.prefix}/v1/student_payment/cancel_payment_not_paid`,data)
}
}

View File

@@ -0,0 +1,31 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class StudentPaymentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student_payment/bill_receivable_item',http)
}
getByDate(date){
return this.http.get(`${this.fullUrl}_by_date/${date}`)
}
confirmPayment(data){
return this.http.put(`${this.prefix}/v1/student_payment/confirm_list_payment`,data)
}
deletePayment(data){
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
body: data
}
return this.http.delete(`${this.prefix}/v1/student_payment/delete_list_payment`,httpOptions)
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from 'src/app/core/base/base-service';
@Injectable({
providedIn: 'root'
})
export class StudentPaymentUploadService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student_payment/upload',http)
}
confirm(data){
return this.http.post(`${this.fullUrl}/confirm`,data)
}
}

View File

@@ -0,0 +1,31 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class DeleteImportStudentService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student',http)
}
deleteImportType2(data){
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
body: data
}
return this.http.delete(`${this.fullUrl}/delete_import_students`,httpOptions);
}
deleteImportType1(uid,data){
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
body: data
}
return this.http.delete(`${this.fullUrl}/delete_ru_import_students/${uid}`,httpOptions);
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class GenerateGroupSeatDetailService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student/generate_group_seat_detail',http)
}
getDetail(data){
return this.http.get(`${this.fullUrl}/${data.testing_information_uid}/${data.branch_uid}/${data.testing_field_uid}/${data.testing_center_uid}/${data.testing_date}/${data.section}`);
}
}

View File

@@ -0,0 +1,19 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BaseService } from '../../base/base-service';
@Injectable({
providedIn: 'root'
})
export class GenerateGroupService extends BaseService {
constructor(
public http: HttpClient
) {
super('/v1/student/student_generate_group',http)
}
getDetail(data){
return this.http.get(`${this.fullUrl}/${data.testing_information_uid}/${data.branch_uid}/${data.testing_field_uid}/${data.testing_center_uid}/${data.testing_date}/${data.section}`);
}
}

Some files were not shown because too many files have changed in this diff Show More