Fairoj : issue Fixes
This commit is contained in:
parent
9f98ee256f
commit
84230b6d9e
@ -1,13 +1,13 @@
|
||||
<div id="top"></div>
|
||||
<!--starts-->
|
||||
<div fxLayout fxLayout="row" fxLayout.xs="column" fxLayoutGap.xs="0">
|
||||
<div fxLayout fxLayout="row" fxLayout.xs="column" >
|
||||
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="1000" fxFlex.xl="40"> -->
|
||||
<mat-card class="p-2" fxFlex="70%" fxFlex.xs="100" fxFlex.sm="100">
|
||||
<mat-card-title class="mb-1"><h5 class="mt-0 text-center">Contribute to Specific Need </h5></mat-card-title>
|
||||
<hr>
|
||||
<form [formGroup]="Contribute">
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2 pt-1">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 100%;">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 40%;">
|
||||
<mat-select placeholder="Select District" formControlName="district_id" (selectionChange)="getFilterValue($event.value,'school')">
|
||||
<mat-option *ngFor="let item of district" [value]="item.district_id" >
|
||||
{{ item.district_name }}
|
||||
@ -21,6 +21,8 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" >
|
||||
<mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;">
|
||||
<mat-select placeholder="Select Category" formControlName="cad_id" (selectionChange)="getFilterValue($event.value,'material')">
|
||||
<mat-option *ngFor="let item of category" [value]="item.cat_id" >
|
||||
@ -35,7 +37,7 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout fxLayout="row" style="text-align: right;" class="mb-2">
|
||||
<div class="" fxFlex="100%" fxFlex.xs="100" fxFlex.sm="100">
|
||||
<button mat-raised-button color="primary" (click)="refresh()">View All</button>
|
||||
|
||||
@ -101,7 +101,7 @@ export class ContributeComponent implements OnInit {
|
||||
{
|
||||
if(res['dataStatus'])
|
||||
{
|
||||
this.district = res['records'];
|
||||
this.district = res['records'].filter(val=>val.district_name != null);
|
||||
}
|
||||
})
|
||||
break;
|
||||
@ -123,7 +123,7 @@ export class ContributeComponent implements OnInit {
|
||||
{
|
||||
if(res['dataStatus'])
|
||||
{
|
||||
this.category = res['records'];
|
||||
this.category = res['records'].filter(val=>val.cat_name != null);
|
||||
}
|
||||
})
|
||||
break;
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
|
||||
<div fxLayout fxLayout="row" fxLayout.xs="column" fxLayoutGap.xs="0">
|
||||
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center" class="m-gap p-gap">
|
||||
<button mat-raised-button (click)="toTop($event)" class="button-cyan">Contribute</button>
|
||||
<button mat-raised-button (click)="toTop()" class="button-cyan">Contribute</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -167,7 +167,19 @@ getIndividualSchoolReqData(id){
|
||||
};
|
||||
this.restApi.post(url, data).subscribe(schDet => {
|
||||
if (schDet.dataStatus == true) {
|
||||
|
||||
// schDet.records.filter(val=>{
|
||||
// console.log("school det",val)
|
||||
// val.material_name.sort()
|
||||
// return val
|
||||
// })
|
||||
schDet.records.sort((a,b)=>{
|
||||
console.log("scholl det",a,b)
|
||||
if(a.material_name < b.material_name)
|
||||
return -1
|
||||
if(a.material_name > b.material_name)
|
||||
return 1
|
||||
return 0
|
||||
})
|
||||
// console.log(schDet);
|
||||
this.dataSource=schDet.records
|
||||
this.dataLength=schDet.records.length
|
||||
|
||||
@ -53,6 +53,6 @@ export class ProjectListComponent implements OnInit {
|
||||
let data = {'school_name':schDetails.school_name,'images':schDetails.images,'district_name':schDetails.district_name,'total_b':schDetails.total_b,'total_g':schDetails.total_g,'total':schDetails.total,'teach_tot':schDetails.teach_tot,'nonteach_tot':schDetails.nonteach_tot,'totstaff':schDetails.totstaff,'total_cost':schDetails.total_cost,'total_recevied':schDetails.total_recevied,'school_id':schDetails.school_id,'block_name':schDetails.block_name,'management':schDetails.management,'category':schDetails.category,'high_class':schDetails.high_class,'low_class':schDetails.low_class,'latitude':schDetails.longitude,'longitude':schDetails.longitude,'school_req_id':schDetails.school_req_id};
|
||||
|
||||
this.schInfo.updateDetails(data);
|
||||
this.router.navigate(['/home/project-detail']);
|
||||
this.router.navigate(['/home/project-detail',{schoolreqid:schDetails.school_id}]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
<input matInput placeholder="Organisation Name" type="text" name="orgname" formControlName="orgname" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<textarea matInput placeholder="Register Address" name="org_address" formControlName="org_address" required></textarea>
|
||||
<textarea matInput placeholder="Registered Address" name="org_address" formControlName="org_address" required></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="mt-1 mb-1">
|
||||
|
||||
@ -45,6 +45,7 @@ export class RegisterComponent {
|
||||
// user_dob:new FormControl(''),
|
||||
password: new FormControl(''),
|
||||
confirm_password:new FormControl(''),
|
||||
user_type:new FormControl('1'),
|
||||
org_info: this.fb.group({
|
||||
orgname: new FormControl(''),
|
||||
org_address: new FormControl(''),
|
||||
@ -61,9 +62,11 @@ export class RegisterComponent {
|
||||
console.log(value)
|
||||
if(value.checked == true){
|
||||
this.slide1=true
|
||||
this.go_reg.controls['user_type'].setValue('2');
|
||||
}
|
||||
else{
|
||||
this.slide1=false
|
||||
this.go_reg.controls['user_type'].setValue('1');
|
||||
}
|
||||
}
|
||||
setValidatorConfirmPass(value){
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
<h1 style="color:#8e640d;text-align: center;">CHAMPION OF CHANGE</h1>
|
||||
<br>
|
||||
<br>
|
||||
<h5 style="color:#a8760d;text-align: center;">M/S Company Technologies Pvt Ltd</h5>
|
||||
<h5 style="color:#a8760d;text-align: center;">{{data.org_name != '' ? 'M/S'+' '+data.org_name : 'Mr/Ms'+' '+data.logged_user_name}}</h5>
|
||||
<p style="text-align: center;color:#5b5858de;font-size: 14px;">in acknowledgement of the valuable conribution made towards improvement of government<br> schools in tamil nadu </p>
|
||||
<br>
|
||||
<h4 style="text-align: center;">School Education Department </h4>
|
||||
<h2 style="text-align: center;">Government of Tamil Nadu </h2>
|
||||
<br>
|
||||
<br>
|
||||
<h1 style="text-align: center;">29-Sep-2019</h1>
|
||||
<h1 style="text-align: center;">{{data.latest_contribute_date.split(' ')[0]}}</h1>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import html2canvas from 'html2canvas';
|
||||
import { ApiService } from 'app/shared/api.service';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatDialog, MatDialogRef } from '@angular/material';
|
||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { UserProfileComponent } from '../user-profile/user-profile.component';
|
||||
|
||||
@Component({
|
||||
@ -13,9 +13,10 @@ import { UserProfileComponent } from '../user-profile/user-profile.component';
|
||||
})
|
||||
export class UserCertificateComponent implements OnInit {
|
||||
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,private matDialog:MatDialog,private dialog_ref:MatDialogRef<UserCertificateComponent>) { }
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,private matDialog:MatDialog,private dialog_ref:MatDialogRef<UserCertificateComponent>,@Inject(MAT_DIALOG_DATA) public data:any) { }
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.data)
|
||||
}
|
||||
generateimg(){
|
||||
console.log("pd")
|
||||
|
||||
@ -27,26 +27,27 @@
|
||||
|
||||
<!-- <div class=""> -->
|
||||
<!-- <div class=""> -->
|
||||
<div fxLayoutAlign="center start" >
|
||||
<div fxLayoutAlign="start" >
|
||||
|
||||
<mat-tab-group class="mt-2">
|
||||
<mat-tab class="tab-group">
|
||||
<div fxLayout="column " fxFlex.xl="40" fxFlex.lg="100" fxFlex.md="50" fxFlex.sm="80" fxFlex.xs="90">
|
||||
<mat-tab class="tab-group" >
|
||||
<ng-template mat-tab-label style="color: white">My Profile</ng-template>
|
||||
<mat-card class="login-session">
|
||||
<div fxLayout="row" fxFlex.xl="100" fxFlex.lg="100" fxFlex.md="100" fxFlex.sm="80" fxFlex.xs="90" >
|
||||
|
||||
<mat-card class="login-session" >
|
||||
<!-- <p class="mb-0" style="text-align: right;">Already Registered ? <a (click)="login_screen()" class="mat-text-primary">Login Here</a></p> -->
|
||||
<!-- <div> -->
|
||||
<h2 class="base-border">My Profile</h2>
|
||||
<!-- <p>We would need some of your information to facilitate your contributions and keep you updated on the progress of the projects or new projects</p> -->
|
||||
<form [formGroup]="profile_form">
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 80%;justify-content:center;align-content: center;">
|
||||
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="10px" >
|
||||
<mat-form-field style="width: 70%;justify-content:center;align-content: center;">
|
||||
<input matInput placeholder="Name" type="text" name="name" formControlName="name" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 80%">
|
||||
<mat-form-field style="width: 60%">
|
||||
<input matInput placeholder="E Mail" type="email" name="email" formControlName="email" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 80%">
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Phone Number" type="number" name="mobile" formControlName="mobile" required>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field style="width: 100%">
|
||||
@ -63,33 +64,33 @@
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<!-- <hr>
|
||||
<div class="mt-1 mb-1">
|
||||
|
||||
<!-- <div class="mt-1 mb-1">
|
||||
<label class="mr-1">Registering as on Organisation ?</label>
|
||||
<mat-slide-toggle name="slideToggle" required (change)="change_fun($event)">
|
||||
</mat-slide-toggle>
|
||||
{{slidetoggle}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch" formGroupName="org_info">
|
||||
<div *ngIf="slide1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Organisation Name" type="text" name="orgname" formControlName="orgname" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<textarea matInput placeholder="Register Address" name="org_address" formControlName="org_address" required></textarea>
|
||||
<textarea matInput placeholder="Registered Address" name="org_address" formControlName="org_address" required></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="mt-1 mb-1">
|
||||
<!-- <div class="mt-1 mb-1">
|
||||
<label class="mr-1">Do you want to avail 80G Exemption</label>
|
||||
<mat-slide-toggle name="slideToggle" (change)="change_fun2($event)" required>
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</div> -->
|
||||
<div *ngIf="slide2">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="PAN of the Organisation" type="tel" name="org_pan" maxlength="10" formControlName="org_pan" required>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<mat-checkbox formControlName="profile_share"></mat-checkbox> <span>I hereby give my consent to share my profile with public</span><br/><br/>
|
||||
<mat-checkbox formControlName="notify_pref" text-wrap></mat-checkbox>
|
||||
<span tex-wrap>I hereby give my consent to receive updates on various requirements and progress, through email or other modes</span>
|
||||
@ -138,53 +139,58 @@
|
||||
</mat-card> -->
|
||||
<!-- </mat-tab> -->
|
||||
<mat-tab class="tab-group">
|
||||
<div fxLayout="column" fxFlex.xl="100" fxFlex.lg="100" fxFlex.md="100" fxFlex.sm="100" fxFlex.xs="90" fxLayoutAlign="center center">
|
||||
<mat-card class="login-session" style="width: 80%">
|
||||
<div fxLayout="column" fxFlex.xl="100" fxFlex.lg="98" fxFlex.md="100" fxFlex.sm="100" fxFlex.xs="90" fxLayoutAlign="center center">
|
||||
<mat-card class="login-session" style="width: 100%">
|
||||
<ng-template mat-tab-label>Contributions</ng-template>
|
||||
<h2 class="base-border">Contributions</h2>
|
||||
<div *ngIf="contribution_data.length > 0">
|
||||
<div style="text-align: right;">
|
||||
<button mat-raised-button class="mb-1" color="primary" (click)="certificateDialog()">certificate</button>
|
||||
<button mat-raised-button class="mb-1" color="primary" (click)="certificateDialog()">Certificate</button>
|
||||
</div>
|
||||
<table mat-table
|
||||
<table mat-table
|
||||
[dataSource]="dataSource" multiTemplateDataRows
|
||||
class="mat-elevation-z8">
|
||||
>
|
||||
<ng-container matColumnDef="Date">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef> Date and Time </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let details;" style="justify-content:flex-start">
|
||||
<div mat-line>{{details.contribute_date}}</div>
|
||||
<mat-header-cell class="cell" *matHeaderCellDef style="justify-content:flex-start"> Date and Time </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let details;" style="justify-content:center">
|
||||
<div mat-line>{{details.contribute_date.split(' ')[0]}}<br/> {{details.contribute_date.split(' ')[1]}} {{details.contribute_date.split(' ')[2]}}</div>
|
||||
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="contribute_type">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef> Contribution Type </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let details;" style="justify-content:flex-start">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef
|
||||
style="justify-content:start"> Contribution Type </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let details;" style="justify-content:start center">
|
||||
<div mat-line style="font-weight: bold">{{details.cont_towards == '1' ? 'State School Development Fund' : details.cont_type == '1' ? 'Fund' : 'Materials'}}</div>
|
||||
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="ref_id">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef> Reference</mat-header-cell>
|
||||
<mat-cell style="width: 15%" class="cell" *matCellDef="let details;" style="justify-content:flex-start">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef
|
||||
style="justify-content:center"> Reference</mat-header-cell>
|
||||
<mat-cell style="width: 15%" class="cell" *matCellDef="let details;" style="justify-content:center">
|
||||
<div style="width: 15%" mat-line style="font-weight: bold">{{details.ref_id}}</div>
|
||||
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="trackid">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef> Tracking</mat-header-cell>
|
||||
<mat-header-cell class="cell" *matHeaderCellDef
|
||||
style="justify-content:flex-start"> Tracking</mat-header-cell>
|
||||
<mat-cell style="width: 15%" class="cell" *matCellDef="let details;" style="justify-content:flex-start">
|
||||
<div style="width: 15%" mat-line style="font-weight: bold">{{details.trackid}}</div>
|
||||
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="payment_mode">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef style="justify-content:flex-end"> Payment Mode </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let data;" style="justify-content:flex-end">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef style="justify-content:center"> Payment Mode </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let data;" style="justify-content:center">
|
||||
<div mat-line>{{data.payment_mode == '1' ? 'Online' : data.payment_mode == '2' ? 'Offline' : 'Offline'}}</div>
|
||||
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="payment_ref">
|
||||
<mat-header-cell class="cell" *matHeaderCellDef > </mat-header-cell>
|
||||
<mat-header-cell class="cell" *matHeaderCellDef
|
||||
style="justify-content:center "> </mat-header-cell>
|
||||
<mat-cell class="cell" *matCellDef="let data;" style="justify-content:center ">
|
||||
<div mat-line *ngIf="data.payment_mode == '1' && data.txnstatus != 'FAILURE'"><button mat-button mat-stroked-button (click)="performOperation(data)">{{data.txnstatus == 'SUCCESS' ? 'Print Receipt' : data.txnstatus == null || data.txnstatus == 'AWAITED' ? 'Check Status' : ''}}</button></div>
|
||||
<div mat-line *ngIf="data.payment_mode == '2'">-</div>
|
||||
@ -202,21 +208,27 @@
|
||||
<div matColumnDef="expandedDetail" class="detail_row">
|
||||
<ng-container >
|
||||
<div *matCellDef="let detail">
|
||||
<div *ngFor="let det of detail.child_data;let i=index" class="child_card">
|
||||
<p style="margin-left:20px;"> {{det.material_name}} ({{det.qty}}) at {{det.school_name}} , {{det.district_name}} District, <span> Valuing Rs. {{det.amount}}</span></p>
|
||||
<p style="margin-left:190px;font-size:13.5px;" *ngIf="detail.cont_towards == '1'">Comments : {{detail.gen_dev_fund_remarks != null ? detail.gen_dev_fund_remarks : ' -'}}</p>
|
||||
<div *ngIf="detail.cont_towards != '1'">
|
||||
<div *ngFor="let det of detail.child_data;let i=index" class="child_card">
|
||||
<p style="margin-left:130px;font-size:13.5px;" > {{det.material_name}} ({{det.qty}}) at {{det.school_name}} , {{det.district_name}} District, <span> Valuing Rs. {{det.amount}}</span></p>
|
||||
|
||||
<!-- <p>{{det.amount}}</p> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
<mat-header-row style="align-items: normal !important;" *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-header-row style="align-items: normal !important;padding-left:10px;" *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;"
|
||||
|
||||
matRipple
|
||||
class="element-row"
|
||||
[class.expanded]="expandedElement == row"
|
||||
(click)="expandedElement = row">
|
||||
|
||||
</mat-row>
|
||||
|
||||
<mat-row *matRowDef="let row; columns: ['expandedDetail']"
|
||||
@ -224,6 +236,11 @@
|
||||
style="overflow: hidden;background-color:rgb(236, 236, 236);">
|
||||
</mat-row>
|
||||
</table>
|
||||
</div>
|
||||
<div *ngIf="contribution_data.length == 0" style="justify-content: center;width:100%">
|
||||
<h5>No Contribution Found </h5>
|
||||
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-tab>
|
||||
|
||||
@ -50,12 +50,12 @@
|
||||
}
|
||||
|
||||
|
||||
th, td {
|
||||
overflow: hidden;
|
||||
width: 200px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
// th, td {
|
||||
// overflow: hidden;
|
||||
// width: 200px;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
.element-row {
|
||||
position: relative;
|
||||
}
|
||||
@ -73,11 +73,14 @@
|
||||
}
|
||||
.child_card{
|
||||
color:black;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
// background-color: bisque;
|
||||
padding-left: 55px;
|
||||
margin: 15px;
|
||||
// margin: 15px;
|
||||
}
|
||||
.detail_row{
|
||||
background-color: blue;
|
||||
}
|
||||
mat-header-cell{
|
||||
font-size: 14px;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ApiService } from 'app/shared/api.service';
|
||||
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||
import { FormGroup, FormBuilder, FormControl } from '@angular/forms';
|
||||
import {animate, state, style, transition, trigger} from '@angular/animations';
|
||||
import { MatTableDataSource, MatSnackBar, MatDialog } from '@angular/material';
|
||||
import * as jspdf from 'jspdf';
|
||||
@ -31,6 +31,8 @@ export class UserProfileComponent implements OnInit {
|
||||
isExpansionDetailRow = (i: number, row: Object) => row.hasOwnProperty('detailRow');
|
||||
expandedElement: any
|
||||
pdf_data_source: any={amount:'',name:'',org_pan:''};
|
||||
slide1: boolean;
|
||||
slide2: boolean;
|
||||
|
||||
|
||||
constructor(private apiService:ApiService,private _fb:FormBuilder,private matSnackBar:MatSnackBar,public router:Router,private matDialog:MatDialog) { }
|
||||
@ -41,6 +43,12 @@ export class UserProfileComponent implements OnInit {
|
||||
name:['',{disabled:true}],
|
||||
email:['',{disabled:true}],
|
||||
mobile:['',{disabled:true}],
|
||||
user_type:new FormControl(''),
|
||||
org_info: this._fb.group({
|
||||
orgname: new FormControl(''),
|
||||
org_address: new FormControl(''),
|
||||
org_pan: new FormControl(''),
|
||||
}),
|
||||
profile_share:['',{disabled:true}],
|
||||
notify_pref:['',{disable:true}]
|
||||
})
|
||||
@ -50,7 +58,12 @@ export class UserProfileComponent implements OnInit {
|
||||
this.apiService.getMyProfile().subscribe(res=>{
|
||||
if(res['dataStatus']){
|
||||
this.user_data=res['records'].user_data[0];
|
||||
this.user_data.profile_share == '1' ? this.user_data.profile_share = true : this.user_data.profile_share=false
|
||||
this.user_data.notify_pref == '1' ? this.user_data.notify_pref = true : this.user_data.notify_pref=false
|
||||
this.user_data.org_pan!= null && this.user_data.org_pan != '' ? this.slide2=true: false
|
||||
this.user_data.user_type == '2' ? this.slide1 =true : this.slide1=false
|
||||
this.profile_form.patchValue(this.user_data)
|
||||
this.profile_form.controls['org_info'].patchValue(this.user_data);
|
||||
this.contribution_data=res['records'].contribution_data
|
||||
this.contribution_data.forEach(element=>{
|
||||
element.detailRow=true;
|
||||
@ -64,6 +77,27 @@ export class UserProfileComponent implements OnInit {
|
||||
console.log(value);
|
||||
|
||||
}
|
||||
change_fun(value){
|
||||
console.log(value)
|
||||
if(value.checked == true){
|
||||
this.slide1=true
|
||||
this.profile_form.controls['user_type'].setValue('2');
|
||||
}
|
||||
else{
|
||||
this.slide1=false
|
||||
this.profile_form.controls['user_type'].setValue('1');
|
||||
}
|
||||
}
|
||||
change_fun2(value){
|
||||
console.log(value)
|
||||
if(value.checked == true){
|
||||
this.slide2=true
|
||||
// this.go_reg.controls['org_pan'].setV
|
||||
}
|
||||
else{
|
||||
this.slide2=false
|
||||
}
|
||||
}
|
||||
performOperation(data){
|
||||
|
||||
console.log(data)
|
||||
@ -112,7 +146,7 @@ export class UserProfileComponent implements OnInit {
|
||||
var position = 30;
|
||||
pdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight)
|
||||
|
||||
pdf.save('MYPdf.pdf'); // Generated PDF
|
||||
pdf.save('receipt.pdf'); // Generated PDF
|
||||
});
|
||||
this.modal_hide=true
|
||||
}
|
||||
@ -121,11 +155,14 @@ export class UserProfileComponent implements OnInit {
|
||||
this.matDialog.closeAll();
|
||||
}
|
||||
certificateDialog(){
|
||||
this.closeDialog()
|
||||
// this.closeDialog()
|
||||
let user_name=this.apiService.jwtDecode(localStorage.getItem('token'))
|
||||
user_name=user_name['payload'].username
|
||||
this.matDialog.open(UserCertificateComponent,{
|
||||
"height":"1000px",
|
||||
"width":"800px",
|
||||
panelClass: 'custom-modalbox'
|
||||
"height":"630px",
|
||||
"width":"820px",
|
||||
panelClass: 'custom-modalbox',
|
||||
data:{org_name:this.user_data.orgname,logged_user_name:user_name,latest_contribute_date:this.contribution_data[0].contribute_date}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -18,13 +18,16 @@ export class AuthGuardService implements CanActivate{
|
||||
|
||||
|
||||
canActivate(): boolean {
|
||||
console.log("can activate",this.api.isToken())
|
||||
console.log("authguard",this.router.url)
|
||||
// console.log("can activate",this.api.isToken())
|
||||
// console.log("authguard",this.router.url)
|
||||
let url_split=this.router.url.split(';')
|
||||
// console.log(url_split)
|
||||
if(this.api.isToken()){
|
||||
return this.api.isToken();
|
||||
|
||||
}
|
||||
else if(this.router.url == '/home/project-detail' || this.router.url == '/contribute'){
|
||||
|
||||
else if(url_split[0] == '/home/project-detail' || this.router.url == '/contribute'){
|
||||
|
||||
const dialogConfig = new MatDialogConfig();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user