changes by suren

This commit is contained in:
sriram-at-840620226347 2019-10-10 17:08:02 +05:30
parent 14f65a1eea
commit a89b18b6c7
14 changed files with 179 additions and 17 deletions

View File

@ -59,6 +59,7 @@ import { ReqListComponent } from './components/req-list/req-list.component';
import { UserProfileComponent } from './components/user-profile/user-profile.component';
import { SuccessComponent } from './components/payment-status/success/success.component';
import { FailureComponent } from './components/payment-status/failure/failure.component';
import { UserCertificateComponent } from './components/user-certificate/user-certificate.component';
export function HttpLoaderFactory(http: HttpClient) {
@ -91,6 +92,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
UserProfileComponent,
SuccessComponent,
FailureComponent,
UserCertificateComponent,
// ProjectListComponent
],

View File

@ -15,6 +15,7 @@ import { Component } from '@angular/core';
import { UserProfileComponent } from './components/user-profile/user-profile.component';
import { SuccessComponent } from './components/payment-status/success/success.component';
import { FailureComponent } from './components/payment-status/failure/failure.component';
import { UserCertificateComponent } from './components/user-certificate/user-certificate.component';
export const AppRoutes: Routes = [{
path: '',
redirectTo: 'home',
@ -63,6 +64,10 @@ export const AppRoutes: Routes = [{
path:'user-profile',
component:UserProfileComponent
},
{
path:'user-certificate',
component:UserCertificateComponent
},
{
canActivate:[AuthGuardService],
path:'payment-status/:status',

View File

@ -319,7 +319,7 @@ export class ContributeComponent implements OnInit {
return
}
if(this.grandTotal ==''){
alert("Please Fill the amount");
alert("Please tell us the number of items you would like to contribute");
return
}
let data = {'records':
@ -364,7 +364,7 @@ export class ContributeComponent implements OnInit {
return
}
if(this.general_devlop_amt ==''){
alert("Please Fill the amount");
alert("Please tell us the number of items you would like to contribute");
return
}
let data = {'records':

View File

@ -44,8 +44,8 @@
<div class="mt-2" fxLayout="row wrap" fxLayoutAlign="center" *ngIf="contribute_type != '2'">
<div fxLayoutAlign="center" fxFlex.sm="40.33" fxFlex.xs="100" fxFlex.sm="40.33" fxFlex.md="40.33" fxFlex.lg="40.33" fxFlex.xl="40.33" class="m-gap p-gap">
<mat-card class="p-1" style="background: linear-gradient(58deg,#009688,#673ab7);color: #fff;">
<mat-card-content>
<mat-card class="p-1" style="border-radius: 10px;">
<mat-card-content style="text-align: center;">
<h3><strong><span class="amount"><span class="currency-symbol">&#8377;&nbsp;</span>{{grand_tot_value}}</span></strong></h3><br/>
<mat-radio-group aria-label="Payment Mode" [(ngModel)]="payment_mode">
@ -69,16 +69,18 @@
<!-- <mat-form-field appearance="outline" >
<input matInput placeholder = "Delivery Point" type="text" formControlName="delivery_point">
</mat-form-field>&nbsp;&nbsp;&nbsp; -->
<mat-form-field appearance="outline">
<label>Please tell us when you would like to deliver the selected items :</label><br>
<mat-form-field appearance="outline">
<input matInput [matDatepicker]="picker" [min]="maxDate" placeholder="Delivery date" formControlName="do_delivery">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>&nbsp;&nbsp;&nbsp;<br/>
<mat-form-field appearance="outline" >
<label>Please deliver the items to the following address :</label><br>
<mat-form-field appearance="outline" >
<input matInput placeholder = "Delivery Point" type="text" formControlName="delivery_point">
</mat-form-field>&nbsp;&nbsp;&nbsp;<br/>
<mat-form-field appearance="outline">
<label>Please leave your comments and any other inputs here :</label><br>
<mat-form-field appearance="outline">
<textarea matInput placeholder="Remarks" type="text" formControlName="remarks"></textarea>
</mat-form-field>

View File

@ -76,7 +76,7 @@
</mat-form-field>
</div>
</div>
<mat-checkbox formControlName="profile_share">I hereby give my consent to share details of my contribution in public domain</mat-checkbox><br/><br/>
<mat-checkbox formControlName="profile_share">I hereby consent to share details of my contributions with the public</mat-checkbox><br/><br/>
<mat-checkbox formControlName="notify_pref" text-wrap></mat-checkbox>&nbsp;
<span tex-wrap>I hereby give my consent to receive periodic updates through email and other modes</span>
<!-- <mat-label>Conscent profile share to public</mat-label>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { UserCertificateComponent } from './user-certificate.component';
describe('UserCertificateComponent', () => {
let component: UserCertificateComponent;
let fixture: ComponentFixture<UserCertificateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UserCertificateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UserCertificateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,38 @@
import { Component, OnInit } 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 { UserProfileComponent } from '../user-profile/user-profile.component';
@Component({
selector: 'app-user-certificate',
templateUrl: './user-certificate.component.html',
styleUrls: ['./user-certificate.component.scss']
})
export class UserCertificateComponent implements OnInit {
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,private matDialog:MatDialog,private dialog_ref:MatDialogRef<UserCertificateComponent>) { }
ngOnInit() {
}
generateimg(){
console.log("pd")
// var doc = new DOMParser().parseFromString(html_source, "text/html");
// var doc=$(html_source)
var data=document.getElementById('content_img')
console.log(data);
html2canvas(data).then(canvas => {
// Few necessary setting options
var imgWidth = 208;
var pageHeight = 265;
var imgHeight = canvas.height * imgWidth / canvas.width;
var heightLeft = imgHeight;
const contentDataURL = canvas.toDataURL('image/png')
console.log("ima",contentDataURL)
});
}
}

View File

@ -142,6 +142,9 @@
<mat-card class="login-session" style="width: 80%">
<ng-template mat-tab-label>Contributions</ng-template>
<h2 class="base-border">Contributions</h2>
<div style="text-align: right;">
<button mat-raised-button class="mb-1" color="primary" (click)="certificateDialog()">certificate</button>
</div>
<table mat-table
[dataSource]="dataSource" multiTemplateDataRows
class="mat-elevation-z8">
@ -159,6 +162,20 @@
<!-- <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">
<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-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">
@ -169,7 +186,7 @@
<ng-container matColumnDef="payment_ref">
<mat-header-cell class="cell" *matHeaderCellDef > </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 ? 'Check Status' : ''}}</button></div>
<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>
<div mat-line *ngIf="data.txnstatus == 'FAILURE' && data.payment_mode == '1'" style="text-align: center;color:red;">Failed</div>
<!-- <small mat-line>{{details.pd_type_name}}</small> -->
@ -237,8 +254,15 @@
<div style="text-align:center">
<h3>TAMIL NADU STATE PARENT TEACHER ASSOCIATION</h3>
</div>
<div >
<h4>Ack No. : {{pdf_data_source.trackid}}</h4>
<div>
<table style="height: 19px;" width="638">
<tbody>
<tr>
<td style="width: 312.708px;"><h4>Ack No. : {{pdf_data_source.trackid}}</h4></td>
<td style="width: 313.819px;text-align: right;"><h4>ref_id. : {{pdf_data_source.ref_id}}</h4></td>
</tr>
</tbody>
</table>
</div>
<div style="text-align:justify;">
<p>Received with thanks, the sum of Rs. {{pdf_data_source.amount}} /- ({{pdf_data_source.numtowords}}) from Mr/Ms. {{pdf_data_source.name}} (PAN : {{pdf_data_source.org_pan}}) as donation towards improvement of Government Schools in Tamil Nadu through the online portal https://contribute.tnschools.gov.in </p>
@ -259,4 +283,4 @@ Contribution to Tamil Nadu State Parent Teacher Association CSR Fund is tax
</div>
</body>
</html>
</div>
</div>

View File

@ -2,10 +2,12 @@ import { Component, OnInit } from '@angular/core';
import { ApiService } from 'app/shared/api.service';
import { FormGroup, FormBuilder } from '@angular/forms';
import {animate, state, style, transition, trigger} from '@angular/animations';
import { MatTableDataSource, MatSnackBar } from '@angular/material';
import { MatTableDataSource, MatSnackBar, MatDialog } from '@angular/material';
import * as jspdf from 'jspdf';
import html2canvas from 'html2canvas';
import { Router } from '@angular/router';
import { UserCertificateComponent } from '../user-certificate/user-certificate.component';
@Component({
selector: 'app-user-profile',
@ -24,14 +26,14 @@ export class UserProfileComponent implements OnInit {
profile_form:FormGroup;
user_data:any;
contribution_data:any=[];
displayedColumns=['Date','contribute_type','payment_mode','tot_amount','payment_ref']
displayedColumns=['Date','contribute_type','ref_id','trackid','payment_mode','tot_amount','payment_ref']
public dataSource = new MatTableDataSource();
isExpansionDetailRow = (i: number, row: Object) => row.hasOwnProperty('detailRow');
expandedElement: any
pdf_data_source: any={amount:'',name:'',org_pan:''};
constructor(private apiService:ApiService,private _fb:FormBuilder,private matSnackBar:MatSnackBar) { }
constructor(private apiService:ApiService,private _fb:FormBuilder,private matSnackBar:MatSnackBar,public router:Router,private matDialog:MatDialog) { }
ngOnInit() {
this.getProfile()
@ -115,4 +117,16 @@ export class UserProfileComponent implements OnInit {
this.modal_hide=true
}
closeDialog(){
this.matDialog.closeAll();
}
certificateDialog(){
this.closeDialog()
this.matDialog.open(UserCertificateComponent,{
"height":"1000px",
"width":"800px",
panelClass: 'custom-modalbox'
})
}
}

View File

@ -87,7 +87,7 @@
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="100.33" fxFlex.xl="33.33" fxFlex="100">
<div class="horizontal-logo">
<div class="header-name">
<h2><a href="#"><img src="assets/images/csr-img/tn_logo.png" style="width:40%;height:54px;"></a>
<h2><a href="#"><img src="assets/images/csr-img/tn_logo.png" style="width:35%;height:54px;"></a>
</h2>
</div>
</div>

View File

@ -241,12 +241,17 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
if(this.user_name != ''){
// return
this.router.navigateByUrl('/user-profile')
return;
}
else{
// this.router.navigateByUrl('/'+menuitem.state)
this.loginScreen()
return;
}
}
if(menuitem.name == 'General Guidelines'){
window.open("https://contribute.tnschools.gov.in/img/Champion_Of_Change.pdf")
}
else{
this.router.navigateByUrl('/'+menuitem.state)
}

View File

@ -58,12 +58,20 @@ const HORIZONTALMENUITEMS = [
// type: 'link',
// icon: 'error_outline'
// },
{
state: '',
name: 'General Guidelines',
type: 'link',
icon: 'lock'
},
{
state: 'authentication',
name: 'Login',
type: 'link',
icon: 'lock'
},
// {
// state: 'apps',
// name: 'APPS',