changes by suren

This commit is contained in:
sriram-at-840620226347 2019-09-27 10:52:44 +05:30
parent 477e11004c
commit 6e32259b93
13 changed files with 197 additions and 351 deletions

View File

@ -8,13 +8,16 @@ import { ProjectsComponent } from './components/projects/projects.component';
import { PaymentComponent } from './components/payment/payment.component'; import { PaymentComponent } from './components/payment/payment.component';
import { PaymentConfirmationComponent } from './components/payment-confirmation/payment-confirmation.component'; import { PaymentConfirmationComponent } from './components/payment-confirmation/payment-confirmation.component';
import { MyAccountComponent } from './components/my-account/my-account.component'; import { MyAccountComponent } from './components/my-account/my-account.component';
import { AuthGuardService } from './shared/guards/auth-guard.service';
export const AppRoutes: Routes = [{ export const AppRoutes: Routes = [{
path: '', path: '',
redirectTo: 'home', redirectTo: 'home',
pathMatch: 'full', pathMatch: 'full',
}, { }, {
path: '', path: '',
component: AdminLayoutComponent, component: AdminLayoutComponent,
children: [{ children: [{
path: 'home', path: 'home',
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule) loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule)

View File

@ -8,28 +8,28 @@
<form [formGroup]="Contribute"> <form [formGroup]="Contribute">
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2 pt-1"> <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: 100%;">
<mat-select placeholder="Select District" formControlName="district_id" [required]="isRequired" [disabled]="isDisabled"> <mat-select placeholder="Select District" formControlName="district_id" >
<mat-option *ngFor="let item of district" [value]="item.district_id" > <mat-option *ngFor="let item of district" [value]="item.district_id" >
{{ item.district_name }} {{ item.district_name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field dividerColor="accent" class="ml-xs mr-xs" style="width: 100%;"> <mat-form-field dividerColor="accent" class="ml-xs mr-xs" style="width: 100%;">
<mat-select placeholder="Select Schools" formControlName="schoold_id" [required]="isRequired" [disabled]="isDisabled"> <mat-select placeholder="Select Schools" formControlName="schoold_id" >
<mat-option *ngFor="let item of school" [value]="item.school_id" > <mat-option *ngFor="let item of school" [value]="item.school_id" >
{{ item.school_name }} {{ item.school_name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;"> <mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;">
<mat-select placeholder="Select Category" formControlName="cad_id" [required]="isRequired" [disabled]="isDisabled"> <mat-select placeholder="Select Category" formControlName="cad_id" >
<mat-option *ngFor="let item of category" [value]="item.cad_id" > <mat-option *ngFor="let item of category" [value]="item.cad_id" >
{{ item.cat_name }} {{ item.cat_name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;"> <mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;">
<mat-select placeholder="Material Name" formControlName="mat_id" [required]="isRequired" [disabled]="isDisabled"> <mat-select placeholder="Material Name" formControlName="mat_id" >
<mat-option *ngFor="let item of material_category" [value]="item.mat_id" > <mat-option *ngFor="let item of material_category" [value]="item.mat_id" >
{{ item.material_name }} {{ item.material_name }}
</mat-option> </mat-option>
@ -54,13 +54,13 @@
<!-- Requirement Column --> <!-- Requirement Column -->
<ng-container matColumnDef="Image" > <ng-container matColumnDef="Image" >
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Image</th> <th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Image</th>
<td style="width: 15% !important;" mat-cell *matCellDef="let row" class="product-thumbnail"><a href="#"><img src="{{row.img_url}}" alt="School Img" width="70"></a></td> <td style="width: 15% !important;" mat-cell *matCellDef="let row" class="product-thumbnail"><img src="{{row.img_url}}" onerror="this.onerror=null;this.src='https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/No_image_available_600_x_450.svg/600px-No_image_available_600_x_450.svg.png';" alt="School Img" width="70"></td>
</ng-container> </ng-container>
<!-- Requirement Column --> <!-- Requirement Column -->
<ng-container matColumnDef="Description"> <ng-container matColumnDef="Description">
<th style="width: 50% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Description</th> <th style="width: 35% !important;text-align: center !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Description</th>
<td style="width: 50% !important;" mat-cell *matCellDef="let row">{{row.material_name}} required at {{row.school_name}}, {{row.block_name}} Block, {{row.district_name}} District.</td> <td style="width: 35% !important;" mat-cell *matCellDef="let row">{{row.material_name}} required at <a [routerLink]="'/home/project-detail'">{{row.school_name}}</a>, {{row.block_name}} Block, {{row.district_name}} District.</td>
</ng-container> </ng-container>
<!-- Quantity Column --> <!-- Quantity Column -->
@ -71,21 +71,21 @@
<!-- Sponsor Column --> <!-- Sponsor Column -->
<ng-container matColumnDef="Sponsor"> <ng-container matColumnDef="Sponsor">
<th style="width: 10% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Sponsor </th> <th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Sponsor </th>
<td style="width: 10% !important;" mat-cell *matCellDef="let row;let i = index"> <input step="1" min="0" max="" title="Qty" class="text" size="2" type="number" (change)="somethingChanged($event.target.value,i,row.cost_per_unit)" style="width: 100% !important;border: none;border-bottom: 1px solid black;"> </td> <td style="width: 15% !important;" mat-cell *matCellDef="let row;let i = index"> <input step="1" min="0" max="" title="Qty" class="text" size="2" type="number" (change)="somethingChanged($event.target.value,i,row.cost_per_unit)" style="width: 100% !important;text-align: center;"> </td>
</ng-container> </ng-container>
<!-- price Column --> <!-- price Column -->
<ng-container matColumnDef="Cost Per Unit"> <ng-container matColumnDef="Cost Per Unit">
<th style="width: 10% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Cost Per Unit </th> <th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Cost Per Unit </th>
<td style="width: 10% !important;" mat-cell *matCellDef="let row;"> {{row.cost_per_unit === null?0:row.cost_per_unit}} </td> <td style="width: 15% !important;" mat-cell *matCellDef="let row;"> {{row.cost_per_unit === null?0:row.cost_per_unit}} </td>
<!-- <td mat-footer-cell *matFooterCellDef> Total </td> --> <!-- <td mat-footer-cell *matFooterCellDef> Total </td> -->
</ng-container> </ng-container>
<!-- Total Column --> <!-- Total Column -->
<ng-container matColumnDef="Total"> <ng-container matColumnDef="Total">
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Total </th> <th style="width: 20% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Total </th>
<td style="width: 15% !important;" mat-cell *matCellDef="let row ;let i=index">{{Total[i]}} </td> <td style="width: 20% !important;" mat-cell *matCellDef="let row ;let i=index">{{Total[i]}} </td>
<!-- <td mat-footer-cell *matFooterCellDef> {{somethingChanged()}} </td> --> <!-- <td mat-footer-cell *matFooterCellDef> {{somethingChanged()}} </td> -->
</ng-container> </ng-container>
@ -98,7 +98,7 @@
<table class="table-responsive" cellspacing="0" style="width: 50% !important;"> <table class="table-responsive" cellspacing="0" style="width: 50% !important;">
<tr class="order-total" style="text-align: right;"> <tr class="order-total" style="text-align: right;">
<td style="font-weight: bold;">Total</td> <td style="font-weight: bold;">Total</td>
<td> <strong><span class="amount"><span class="currency-symbol">&#8377;</span>{{somethingChanged()}}</span></strong></td> <td> <strong><span class="amount"><span class="currency-symbol">&#8377;</span>{{grandTotal}}</span></strong></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -106,8 +106,8 @@
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator> <mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
<div class="pt-1 pr-1" style="text-align: right;"> <div class="pt-1 pr-1" style="text-align: right;">
<button mat-raised-button color="primary" class="mr-1 mb-1">Will Contribute the above in kind</button> <button mat-raised-button color="primary" class="mr-1 mb-1">I'd like to Contribute in kind</button>
<button [routerLink]="['../payment']" mat-raised-button style="background-color:rgb(69, 189, 189);color:white" >Proceed for Payment</button> <button [routerLink]="['../payment']" mat-raised-button style="background-color:rgb(69, 189, 189);color:white" >I would like to Contribute in Cash</button>
</div> </div>
</div> </div>
<!--*********************--> <!--*********************-->
@ -145,30 +145,30 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<mat-radio-button name="group1" class="pb-1">State School Development Fund</mat-radio-button> <!-- <mat-radio-button name="group1" class="pb-1">State School Development Fund</mat-radio-button>
<mat-radio-button name="group1">District School Development Fund</mat-radio-button> <mat-radio-button name="group1">District School Development Fund</mat-radio-button>
<mat-form-field style="width: 100%" class="pl-1"> <mat-form-field style="width: 100%" class="pl-1">
<mat-select placeholder="Select District" [required]="isRequired" [disabled]="isDisabled" > <mat-select placeholder="Select District" >
<mat-option *ngFor="let item of districtList" [value]="item.id" > <mat-option>
{{ item.value }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-radio-button name="group1">School Development Fund</mat-radio-button> <mat-radio-button name="group1">School Development Fund</mat-radio-button>
<mat-form-field style="width: 100%" class="pl-1"> <mat-form-field style="width: 100%" class="pl-1">
<mat-select placeholder="Select District" [required]="isRequired" [disabled]="isDisabled" > <mat-select placeholder="Select District" >
<mat-option *ngFor="let item of districtList" [value]="item.id" > <mat-option >
{{ item.value }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" class="pl-1"> <mat-form-field style="width: 100%" class="pl-1">
<mat-select placeholder="Select School" [required]="isRequired" [disabled]="isDisabled" > <mat-select placeholder="Select School">
<mat-option *ngFor="let item of schoolList" [value]="item.id" > <mat-option >
{{ item.value }}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;"> <mat-form-field dividerColor="warn" class="ml-xs mr-xs" style="width: 100%;">
<textarea matInput placeholder="Remarks" value="Some Text ..."></textarea> <textarea matInput placeholder="Remarks" value="Some Text ..."></textarea>
</mat-form-field> </mat-form-field>

View File

@ -1,5 +1,9 @@
.calculated-shipping[_ngcontent-gen-c13]{ .calculated-shipping[_ngcontent-gen-c13]{
padding: 0px !important; padding: 0px !important;
}
a {
text-decoration: underline;
color: #4CAF50;
} }
table { table {
width: 100%; width: 100%;
@ -12,6 +16,7 @@
td, th { td, th {
width: 25%; width: 25%;
text-align: center;
} }
table.shop-table { table.shop-table {
// border-collapse: separate; // border-collapse: separate;

View File

@ -3,6 +3,7 @@ import { environment } from '../../../environments/environment';
import { ApiService } from '../../shared/api.service'; import { ApiService } from '../../shared/api.service';
import { FormGroup, FormBuilder, FormControl, Validators, } from '@angular/forms'; import { FormGroup, FormBuilder, FormControl, Validators, } from '@angular/forms';
import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material'; import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
import { Router } from '@angular/router';
@ -25,8 +26,9 @@ export class ContributeComponent implements OnInit {
school: any = []; school: any = [];
category: any = []; category: any = [];
Total: any = []; Total: any = [];
grandTotal: any = [];
constructor(public restApi:ApiService,public fb:FormBuilder) { constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) {
// Create 100 users // Create 100 users
} }
@ -46,11 +48,11 @@ export class ContributeComponent implements OnInit {
} }
} }
ngOnInit() { ngOnInit() {
// this.getSchoolReqList();
this.initForm(); this.initForm();
this.getSchoolReqList(); this.getSchoolReqList();
this.getSchoolReqList2(); this.getSchoolReqList2();
// window.localStorage.clear();
} }
@ -89,8 +91,10 @@ export class ContributeComponent implements OnInit {
somethingChanged(e,i,item){ somethingChanged(e,i,item){
// console.log(e,i,item); // console.log(e,i,item);
this.Total[i] = e*item; this.Total[i] = e*item;
// console.log(this.Total); // console.log(this.Total);
return ( this.Total.reduce((acc, value) => acc + value, 0)); this.grandTotal = this.Total.reduce((acc, value) => acc + value, 0);
} }
@ -137,7 +141,8 @@ export class ContributeComponent implements OnInit {
} }
}) })
// console.log('mat'+this.material_category); // console.log('mat'+this.material_category);
} }
ngAfterViewInit() { ngAfterViewInit() {
// Hack: Scrolls to top of Page after page view initialized // Hack: Scrolls to top of Page after page view initialized
let top = document.getElementById('top'); let top = document.getElementById('top');
@ -149,6 +154,7 @@ export class ContributeComponent implements OnInit {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
} }
} }

View File

@ -26,7 +26,23 @@
<mat-card> <mat-card>
<mat-card-title><h5 class="mt-0">Choose a Payment Option</h5></mat-card-title> <mat-card-title><h5 class="mt-0">Choose a Payment Option</h5></mat-card-title>
<hr> <hr>
<mat-tab-group class="p-2">
<div class="mt-2" fxLayout="row wrap" fxLayoutAlign="center">
<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>
<h3><strong><span class="amount"><span class="currency-symbol">&#8377;&nbsp;</span>70,000</span></strong></h3>
</mat-card-content>
</mat-card>
</div>
</div>
<ul>
<li><span>Government of Tamil Nadu accepts online voluntary contributions using Net Banking or VISA-Debit/Credit Cards in Indian Rupees (INR) from Individuals, Organizations, Trusts,Companies and Institutions etc.</span></li>
<li><span>All contributions towards Tamil Nadu State Parent Teacher Association (TNPTA) are exempt from Income Tax under section 80 (G).</span></li>
<li><span>The PAN Number of Tamil Nadu State Tamil Nadu Parent Teacher Association (TNPTA) is AACAT2920R.</span></li>
</ul>
<!-- <mat-tab-group class="p-2">
<mat-tab> <mat-tab>
<ng-template mat-tab-label>Credit/Debit Cards</ng-template> <ng-template mat-tab-label>Credit/Debit Cards</ng-template>
<mat-card-content> <mat-card-content>
@ -44,7 +60,6 @@
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Expiration Date: 01/16" type="text" name="ctry" required> <input matInput placeholder="Expiration Date: 01/16" type="text" name="ctry" required>
</mat-form-field> </mat-form-field>
<!-- <button class="mat-green" mat-raised-button>Submit</button> -->
</div> </div>
</form> </form>
</mat-card-content> </mat-card-content>
@ -74,16 +89,16 @@
</form> </form>
</mat-card-content> </mat-card-content>
</mat-tab> </mat-tab>
<!-- <mat-tab> <mat-tab>
<ng-template mat-tab-label>Paypal</ng-template> <ng-template mat-tab-label>Paypal</ng-template>
<h6><strong>Paypal</strong></h6> <h6><strong>Paypal</strong></h6>
<mat-card-content> <mat-card-content>
<p>Pay via PayPal; you can pay with your credit card if you dont have a PayPal account.</p> <p>Pay via PayPal; you can pay with your credit card if you dont have a PayPal account.</p>
<button class="mat-green" mat-raised-button>Proceed To Paypal</button> <button class="mat-green" mat-raised-button>Proceed To Paypal</button>
</mat-card-content> </mat-card-content>
</mat-tab> --> </mat-tab>
</mat-tab-group> </mat-tab-group> -->
<div class="pt-1" style="text-align: right;"> <div class="pt-1" style="text-align: right;">
<button [routerLink]="['../paymentconfirmation']" mat-raised-button color="primary" class="mr-1 mb-1">Complete Payment</button> <button [routerLink]="['../paymentconfirmation']" mat-raised-button color="primary" class="mr-1 mb-1">Proceed for Payment</button>
</div> </div>
</mat-card> </mat-card>

View File

@ -1,3 +1,8 @@
ul{
color:#007805;
font-size: 14px;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7); $product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main { .p-list-main {

View File

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormBuilder } from '@angular/forms';
import { ApiService } from 'app/shared/api.service';
@Component({ @Component({
selector: 'app-payment', selector: 'app-payment',
@ -39,9 +42,23 @@ export class PaymentComponent implements OnInit {
value: 'milk-8', value: 'milk-8',
viewValue: 'Milk' viewValue: 'Milk'
}]; }];
constructor() { } constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) {
this.isToken();
}
ngOnInit() { ngOnInit() {
// window.localStorage.clear();
}
isToken(){
// console.log(this.restApi.isToken());
if(this.restApi.isToken())
{
}else{
this.router.navigate(['/authentication']);
}
} }
} }

View File

@ -1,4 +1,8 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { environment } from 'environments/environment';
import { ApiService } from 'app/shared/api.service';
import { FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-project-detail', selector: 'app-project-detail',
@ -22,12 +26,16 @@ export class ProjectDetailComponent implements OnInit {
url:'assets/images/csr-img/img3.jpg', url:'assets/images/csr-img/img3.jpg',
caption:'Third' caption:'Third'
}] }]
school_details: any;
// types_of_funds=['State Fund','District Fund','School common Fund','For this Project'] // types_of_funds=['State Fund','District Fund','School common Fund','For this Project']
constructor() { } constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) { }
ngOnInit() { ngOnInit() {
} }
ngAfterViewInit() { ngAfterViewInit() {
// Hack: Scrolls to top of Page after page view initialized // Hack: Scrolls to top of Page after page view initialized
let top = document.getElementById('top'); let top = document.getElementById('top');

View File

@ -12,17 +12,18 @@
</mat-button-toggle-group> --> </mat-button-toggle-group> -->
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->
<div fxLayout="row wrap" [routerLink]="'/home/project-detail'"> <!-- <div fxLayout="row wrap" [routerLink]="'/home/project-detail'"> -->
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap" style="margin-left: 5px;"> <div fxLayout="row wrap">
<div class="p-list-main mb-2"> <div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap" style="margin-left: 5px;" *ngFor="let schooldetails of school_list" [routerLink]="'/home/project-detail'">
<div class="p-list-main mb-2">
<div class="p-list"> <div class="p-list">
<div class="top"><img src="assets/images/csr-img/1.jpg" alt=""></div> <div class="top"><img src="{{schooldetails.img_url}}" onerror="this.onerror=null;this.src='https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/No_image_available_600_x_450.svg/600px-No_image_available_600_x_450.svg.png';" alt=""></div>
<div class="bottom"> <div class="bottom">
<div class="left"> <div class="left">
<div class="details"> <div class="details">
<h5>Govt Higher Secondary school</h5> <h5>{{schooldetails.school_name}}</h5>
<p>Thiruvannamalai</p> <p>{{schooldetails.district_name}}</p>
</div> </div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> --> <!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div> </div>
@ -31,17 +32,17 @@
<div class="icon"><i class="material-icons">info_outline</i></div> <div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents"> <div class="contents">
<table> <table>
<tr> <!-- <tr>
<th>Purpose</th> <th>Purpose</th>
<th>Need</th> <th>Need</th>
</tr> </tr>
<tr> <tr>
<td>Building Fund</td> <td>Building Fund</td>
<td>Urgent</td> <td>Urgent</td>
</tr> </tr> -->
<tr> <tr>
<th>Estimation</th> <th>Recruitment</th>
<th>Collected</th> <th>Total Contribute</th>
</tr> </tr>
<tr> <tr>
<th>1.50L</th> <th>1.50L</th>
@ -51,281 +52,9 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/2.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p>Vellore</p>
</div>
<!-- <div class="buy"><i class="material-icons">pageview</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/3.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p>Salem</p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/4.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p>Pallavaram,Chennai</p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/5.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p>Ramanathapuram</p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/6.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p>Nagapattinam</p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/7.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p></p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Purpose</th>
<th>Need</th>
</tr>
<tr>
<td>Building Fund</td>
<td>Urgent</td>
</tr>
<tr>
<th>Estimation</th>
<th>Collected</th>
</tr>
<tr>
<th>1.50L</th>
<th>50,000</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap">
<div class="p-list-main mb-2">
<div class="p-list">
<div class="top"><img src="assets/images/csr-img/8.jpg" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details">
<h5>Govt Higher Secondary school</h5>
<p></p>
</div>
<!-- <div class="buy"><i class="material-icons">add_shopping_cart</i></div> -->
</div>
</div>
<div class="inside">
<div class="icon"><i class="material-icons">info_outline</i></div>
<div class="contents">
<table>
<tr>
<th>Width</th>
<th>Height</th>
</tr>
<tr>
<td>3000mm</td>
<td>4000mm</td>
</tr>
<tr>
<th>Custuert</th>
<th>cutaeyw</th>
</tr>
<tr>
<th>45</th>
<th>29901</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- <div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap"> --> <!-- <div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="23.33" fxFlex.lg="23.33" fxFlex.xl="23.33" class="m-gap p-gap"> -->
<!-- <div class="p-list-main mb-2"> <!-- <div class="p-list-main mb-2">
<div class="p-list"> <div class="p-list">

View File

@ -1,4 +1,9 @@
import { Component, OnInit, HostListener } from '@angular/core'; import { Component, OnInit, HostListener } from '@angular/core';
import { environment } from 'environments/environment';
import { data } from 'jquery';
import { ApiService } from 'app/shared/api.service';
import { FormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-project-list', selector: 'app-project-list',
@ -6,11 +11,27 @@ import { Component, OnInit, HostListener } from '@angular/core';
styleUrls: ['./project-list.component.scss'] styleUrls: ['./project-list.component.scss']
}) })
export class ProjectListComponent implements OnInit { export class ProjectListComponent implements OnInit {
filter_toggle:any="all_items" filter_toggle:any="all_items"
constructor() { } school_list : any [];
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) { }
ngOnInit() { ngOnInit() {
this.getSchoolReqList();
} }
getSchoolReqList()
{
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
this.restApi.post(url,'').subscribe(schDet=>
{
// console.log(schDet);
this.school_list = schDet.records;
// console.log(this.school_list);
})
}
checktop(){ checktop(){
console.log("dd",window); console.log("dd",window);
window.scrollTo(0,0) window.scrollTo(0,0)

View File

@ -33,19 +33,19 @@ export class DashboardComponent {
// } // }
slickInit(e) { slickInit(e) {
console.log('slick initialized'); // console.log('slick initialized');
} }
breakpoint(e) { breakpoint(e) {
console.log('breakpoint'); // console.log('breakpoint');
} }
afterChange(e) { afterChange(e) {
console.log('afterChange'); // console.log('afterChange');
} }
beforeChange(e) { beforeChange(e) {
console.log('beforeChange'); // console.log('beforeChange');
} }
txt:string; txt:string;
height:string="400px" height:string="400px"

View File

@ -1,5 +1,5 @@
import { Component, OnInit ,ViewEncapsulation } from '@angular/core'; import { Component, OnInit ,ViewEncapsulation } from '@angular/core';
import {Router} from "@angular/router"; import {Router, NavigationEnd} from "@angular/router";
import { FormControl, FormBuilder } from '@angular/forms'; import { FormControl, FormBuilder } from '@angular/forms';
import { environment } from 'environments/environment'; import { environment } from 'environments/environment';
import { ApiService } from 'app/shared/api.service'; import { ApiService } from 'app/shared/api.service';
@ -14,13 +14,25 @@ export class LoginComponent {
email: string; email: string;
password: string; password: string;
loginForm: any; loginForm: any;
previousUrl: string;
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) { } constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) {
// console.log(this.router.events);
}
ngOnInit() { ngOnInit() {
// this.getSchoolReqList(); // this.getSchoolReqList();
this.initForm(); this.initForm();
// console.log(this.router.events);
// this.router.events.filter(e => e instanceof NavigationEnd).pairwise().subscribe((e) => {
// console.log('NAVIGATION PREVIOUS => ',e);
// });
this.previousUrl = this.restApi.getPreviousUrl();
} }
@ -44,31 +56,39 @@ export class LoginComponent {
// this.load.loadedDismiss(); // this.load.loadedDismiss();
// console.log(schDet);return false; // console.log(schDet);return false;
// if(schDet.dataStatus==true) if(schDet.dataStatus==true)
// { {
// this.setTokenData(schDet.records); // this.setTokenData(schDet.records);
this.restApi.setToken(schDet.token); this.restApi.setToken(schDet.token);
this.router.navigate(['/home']); if(this.router.url==this.previousUrl)
{
this.router.navigate(['/home']);
}else{
this.router.navigate([this.previousUrl]);
}
// this.router.navigate(['/home']);
// window.localStorage.setItem('token','abcd'); // window.localStorage.setItem('token','abcd');
// }else
// { }else
// // this.toast.apptoast(res.message,'danger'); {
// window.localStorage.clear(); // this.toast.apptoast(res.message,'danger');
// return false; window.localStorage.clear();
// }
alert(schDet.msg);
return false;
}
}) })
} }
// setTokenData(records: any) { // setTokenData(records: any) {
// throw new Error("Method not implemented."); // throw new Error("Method not implemented.");
// } // }
login() { // login() {
this.router.navigate(['/']); // this.router.navigate(['/']);
} // }
} }

View File

@ -8,6 +8,7 @@ import { delay } from 'rxjs/internal/operators';
import 'rxjs/Rx'; import 'rxjs/Rx';
import 'rxjs/add/operator/toPromise'; import 'rxjs/add/operator/toPromise';
import { NavigationEnd, Router } from '@angular/router';
// Api Url Enviroment // Api Url Enviroment
@ -19,11 +20,27 @@ const apiUrl = environment.apiUrl;
}) })
export class ApiService { export class ApiService {
expToken = new BehaviorSubject(false); expToken = new BehaviorSubject(false);
constructor(public http:HttpClient) { private previousUrl: string;
private currentUrl: string;
constructor(public http:HttpClient,private router: Router) {
this.Token(); this.Token();
this.getPreviewUrl();
} }
public getPreviewUrl(){
this.currentUrl = this.router.url;
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
this.previousUrl = this.currentUrl;
this.currentUrl = event.url;
};
});
}
public getPreviousUrl() {
return this.previousUrl;
}
//POST //POST
post(url:any,data:any): Observable<any> post(url:any,data:any): Observable<any>