changes by Suren
This commit is contained in:
parent
6e32259b93
commit
25a064598f
@ -49,6 +49,7 @@ import { MyAccountComponent } from './components/my-account/my-account.component
|
||||
import { TokenInterceptorService } from './shared/guards/token-interceptor.service';
|
||||
import { AuthGuardService } from './shared/guards/auth-guard.service';
|
||||
import { MatTableDataSource, MatTableModule } from '@angular/material';
|
||||
import { SchoolDetailsService } from './shared/school-details.service';
|
||||
// import { AddEventModule } from './add-event.module';
|
||||
|
||||
export function HttpLoaderFactory(http: HttpClient) {
|
||||
@ -121,7 +122,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
provide:HTTP_INTERCEPTORS,
|
||||
useClass: TokenInterceptorService,
|
||||
multi: true
|
||||
},AuthGuardService,
|
||||
},AuthGuardService,SchoolDetailsService,
|
||||
],
|
||||
entryComponents: [],
|
||||
bootstrap: [AppComponent]
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div fxLayout fxLayout="row" fxLayout.xs="column" fxLayoutGap.xs="0">
|
||||
<!-- <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">Be a Champion of Change </h5></mat-card-title>
|
||||
<mat-card-title class="mb-1"><h5 class="mt-0">Contribute to Specific Need </h5></mat-card-title>
|
||||
<hr>
|
||||
<form [formGroup]="Contribute">
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2 pt-1">
|
||||
@ -52,39 +52,45 @@
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<!-- Requirement Column -->
|
||||
<ng-container matColumnDef="Image" >
|
||||
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Image</th>
|
||||
<ng-container matColumnDef="Requirement">
|
||||
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Requirement</th>
|
||||
<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>
|
||||
|
||||
<!-- Requirement Column -->
|
||||
<ng-container matColumnDef="Description">
|
||||
<th style="width: 35% !important;text-align: center !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Description</th>
|
||||
<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>
|
||||
<!-- Item Need Column -->
|
||||
<ng-container matColumnDef="Item Need">
|
||||
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header>Item Need</th>
|
||||
<td style="width: 15% !important;" mat-cell *matCellDef="let row" class="product-thumbnail"> {{row.material_name}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- School Column -->
|
||||
<ng-container matColumnDef="School">
|
||||
<th style="width: 25% !important;text-align: center !important;" mat-header-cell *matHeaderCellDef mat-sort-header>School</th>
|
||||
<td style="width: 25% !important;" mat-cell *matCellDef="let row"> <a [routerLink]="'/home/project-detail'">{{row.school_name}}</a>, {{row.block_name}} Block, {{row.district_name}} District.</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="Requirement Qty">
|
||||
<th style="width: 10% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Requirement Qty </th>
|
||||
<ng-container matColumnDef="Required Qty">
|
||||
<th style="width: 10% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Required Qty </th>
|
||||
<td style="width: 10% !important;" mat-cell *matCellDef="let row"> {{row.qty}}</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Sponsor Column -->
|
||||
<ng-container matColumnDef="Sponsor">
|
||||
<th style="width: 15% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Sponsor </th>
|
||||
<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 matColumnDef="Sponsor Qty">
|
||||
<th style="width: 10% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Sponsor Qty </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,row.mat_id)" style="width: 100% !important;text-align: center;"> </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- price Column -->
|
||||
<ng-container matColumnDef="Cost Per Unit">
|
||||
<th style="width: 15% !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 (in RS) </th>
|
||||
<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> -->
|
||||
</ng-container>
|
||||
|
||||
<!-- Total Column -->
|
||||
<ng-container matColumnDef="Total">
|
||||
<th style="width: 20% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Total </th>
|
||||
<ng-container matColumnDef="Amount">
|
||||
<th style="width: 20% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Amount (in RS) </th>
|
||||
<td style="width: 20% !important;" mat-cell *matCellDef="let row ;let i=index">{{Total[i]}} </td>
|
||||
<!-- <td mat-footer-cell *matFooterCellDef> {{somethingChanged()}} </td> -->
|
||||
</ng-container>
|
||||
@ -106,8 +112,8 @@
|
||||
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
<div class="pt-1 pr-1" style="text-align: right;">
|
||||
<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" >I would like to Contribute in Cash</button>
|
||||
<button mat-raised-button color="primary" (click)="finalSave(1)" class="mr-1 mb-1">I'd like to Contribute in kind</button>
|
||||
<button (click)="finalSave(2)" mat-raised-button style="background-color:rgb(69, 189, 189);color:white" >I'd like to Contribute in Cash</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--*********************-->
|
||||
@ -132,7 +138,7 @@
|
||||
<mat-card class="support_mat" fxFlex="30%" fxFlex.xs="100" fxFlex.sm="100px">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<h5>Or Contribute to General Development Fund</h5>
|
||||
<h5> Contribute to General Development Fund</h5>
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
@ -145,8 +151,8 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <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" class="pb-1">State 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-select placeholder="Select District" >
|
||||
<mat-option>
|
||||
|
||||
@ -14,7 +14,7 @@ import { Router } from '@angular/router';
|
||||
})
|
||||
export class ContributeComponent implements OnInit {
|
||||
|
||||
displayedColumns: string[] = ['Image', 'Description', 'Requirement Qty', 'Sponsor', 'Cost Per Unit', 'Total'];
|
||||
displayedColumns: string[] = ['Requirement', 'Item Need', 'School', 'Required Qty', 'Sponsor Qty', 'Cost Per Unit', 'Amount'];
|
||||
dataSource:any = new MatTableDataSource();
|
||||
dataLength :number;
|
||||
@ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
|
||||
@ -27,6 +27,7 @@ export class ContributeComponent implements OnInit {
|
||||
category: any = [];
|
||||
Total: any = [];
|
||||
grandTotal: any = [];
|
||||
finalData: any = [];
|
||||
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) {
|
||||
// Create 100 users
|
||||
@ -88,10 +89,13 @@ export class ContributeComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
somethingChanged(e,i,item){
|
||||
somethingChanged(e,i,item,mat_id){
|
||||
// console.log(e,i,item);
|
||||
this.Total[i] = e*item;
|
||||
|
||||
let data = {'qty': e
|
||||
,'amount' : item
|
||||
,'req_id': mat_id}
|
||||
this.finalData[i] = data;
|
||||
// console.log(this.Total);
|
||||
this.grandTotal = this.Total.reduce((acc, value) => acc + value, 0);
|
||||
|
||||
@ -154,6 +158,24 @@ export class ContributeComponent implements OnInit {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
|
||||
finalSave(flag)
|
||||
{
|
||||
let data = {'records':
|
||||
{
|
||||
'id':'',
|
||||
'user_id':'',
|
||||
"cont_type":flag,
|
||||
"cont_towards":"",
|
||||
"amount":this.grandTotal,
|
||||
"payment_mode":"",
|
||||
"payment_ref":"",
|
||||
"contributions":this.finalData
|
||||
}};
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,32 +25,72 @@
|
||||
</slideshow></div>
|
||||
|
||||
<span class="img-thum-loop" *ngFor="let img of imageSources;let i=index" >
|
||||
<img (click)="thumbnailClick(i)" class="img-thumbnail" [src]="img.url" alt="img.caption" style="width:150px;height:100px;">
|
||||
<img (click)="thumbnailClick(i)" class="img-thumbnail" [src]="img" alt="img" style="width:100px;height:75px;">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="column m-gap p-gap product-info" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
|
||||
<div class="">
|
||||
<h1>Government Higher Secondary School</h1>
|
||||
<h2 class="mt-0">{{schoolInfo.school_name}}</h2>
|
||||
<div class="price">
|
||||
<!-- <h2>$120<span class="sale">$129</span></h2> -->
|
||||
<h4>Thiruvannamalai</h4>
|
||||
<button mat-raised-button [routerLink]="['/contribute']" class="button-cyan">Contribute</button>
|
||||
<h4 class="mt-0">{{schoolInfo.district_name}}</h4>
|
||||
<!-- <button mat-raised-button [routerLink]="['/contribute']" class="button-cyan">Contribute</button> -->
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<p>Tamil Nadu is one of the most literate states in India. The state's literacy rate is 80.33% in 2011, which is above the national average. A survey conducted by the Industry body Assocham ranks Tamil Nadu top among Indian states with about 100% Gross Enrollment Ratio (GER) in primary and upper primary education.</p>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Total Boys</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.total_b}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Total Girls</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.total_g}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Total</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.total}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Teacher</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.teach_tot}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Non-Teacher</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.nonteach_tot}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.sm="33.33" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" class="m-gap p-gap">
|
||||
<mat-card class="p-1 sch_details">
|
||||
<h6>Total Staff</h6>
|
||||
<h2 style="margin-top: 0px !important;">{{schoolInfo.totstaff}}</h2>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <p>Tamil Nadu is one of the most literate states in India. The state's literacy rate is 80.33% in 2011, which is above the national average. A survey conducted by the Industry body Assocham ranks Tamil Nadu top among Indian states with about 100% Gross Enrollment Ratio (GER) in primary and upper primary education.</p> -->
|
||||
</div>
|
||||
<ul class="share-with">
|
||||
<!-- <li><i class="fa fa-eye fa-2x"></i></li> -->
|
||||
<!-- <ul class="share-with">
|
||||
<li><i class="fa fa-eye fa-2x"></i></li>
|
||||
<li><i class="fa fa-heart-o fa-2x"></i></li>
|
||||
<!-- <li><i class="fa fa-envelope-o fa-2x"></i></li> -->
|
||||
<li><i class="fa fa-envelope-o fa-2x"></i></li>
|
||||
<li><i class="fa fa-share-alt fa-2x"></i></li>
|
||||
</ul>
|
||||
</ul> -->
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout fxLayout="row" fxLayout.xs="column" fxLayoutGap.xs="0">
|
||||
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="1000" fxFlex.xl="40"> -->
|
||||
<mat-card class="p-2" fxFlex="75%" fxFlex.xs="100" fxFlex.sm="100">
|
||||
<mat-card class="p-2" fxFlex="100%" fxFlex.xs="100" fxFlex.sm="100">
|
||||
<h4>About Project</h4>
|
||||
<mat-tab-group class="mt-2">
|
||||
<mat-tab class="tab-group">
|
||||
@ -60,24 +100,23 @@
|
||||
<table style="padding:20px;">
|
||||
<tr>
|
||||
<th>Details</th>
|
||||
<th>Material Name</th>
|
||||
<th>Estimation</th>
|
||||
<th>Collected</th>
|
||||
<th>Qty</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Furniture</td>
|
||||
<td>1.50L</td>
|
||||
<td>50,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Building</td>
|
||||
<td>1.50L</td>
|
||||
<td>80,000</td>
|
||||
</tr>
|
||||
<td>{{schoolInfo.cat_name}}</td>
|
||||
<td>{{schoolInfo.material_name}}</td>
|
||||
<td>{{schoolInfo.total_cost}}</td>
|
||||
<td>{{schoolInfo.total_recevied}}</td>
|
||||
<td>{{schoolInfo.qty}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<!-- <mat-tab>
|
||||
<ng-template mat-tab-label>Updates</ng-template>
|
||||
<mat-card-content>
|
||||
No Updates Available
|
||||
@ -167,12 +206,11 @@
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-tab>
|
||||
</mat-tab> -->
|
||||
</mat-tab-group>
|
||||
</mat-card>
|
||||
|
||||
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="20" fxFlex.xl="40"> -->
|
||||
<mat-card class="support_mat" fxFlex="25%" fxFlex.xs="100" fxFlex.sm="100px">
|
||||
<!-- <mat-card class="support_mat" fxFlex="25%" fxFlex.xs="100" fxFlex.sm="100px">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<h5>Support in kind</h5>
|
||||
@ -196,19 +234,9 @@
|
||||
</mat-form-field><br/>
|
||||
<button isRoundButton mat-stroked-button color="tertiary" align="end">Submit</button><br/>
|
||||
<p>Our team will get in touch with you, and coordinate further steps</p>
|
||||
|
||||
<!-- <mat-radio-group
|
||||
aria-labelledby="example-radio-group-label"
|
||||
class="example-radio-group"
|
||||
[(ngModel)]="favoriteSeason">
|
||||
<mat-radio-button class="example-radio-button" *ngFor="let choose of types_of_funds" [value]="season">
|
||||
{{choose}}
|
||||
</mat-radio-button>
|
||||
</mat-radio-group> -->
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
</mat-card> -->
|
||||
</div>
|
||||
</mat-card>
|
||||
<footer class="footer">
|
||||
|
||||
@ -1,6 +1,15 @@
|
||||
mat-card{
|
||||
overflow: visible;
|
||||
}
|
||||
.sch_details{
|
||||
height: 65px;
|
||||
color: #fff;
|
||||
width: 140px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
background-color: #e24d4d94 !important;
|
||||
padding: 5px !important;
|
||||
}
|
||||
.product-detail {
|
||||
margin-top: 1rem;
|
||||
padding-top: 1rem;
|
||||
|
||||
@ -3,6 +3,7 @@ import { environment } from 'environments/environment';
|
||||
import { ApiService } from 'app/shared/api.service';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { SchoolDetailsService } from 'app/shared/school-details.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-detail',
|
||||
@ -11,30 +12,59 @@ import { Router } from '@angular/router';
|
||||
})
|
||||
export class ProjectDetailComponent implements OnInit {
|
||||
@ViewChild('slider',{static:false}) sliderimg
|
||||
imageSources=[{
|
||||
// url:'https://cdn.vox-cdn.com/uploads/chorus_image/image/56748793/dbohn_170625_1801_0018.0.0.jpg',
|
||||
url:'assets/images/csr-img/Back.jpg',
|
||||
caption:'First'
|
||||
},
|
||||
{
|
||||
// url:'https://cdn.vox-cdn.com/uploads/chorus_asset/file/9278671/jbareham_170917_2000_0124.jpg',
|
||||
url:'assets/images/csr-img/img1.jpeg',
|
||||
caption:'Second'
|
||||
},
|
||||
{
|
||||
// url:'https://cdn.vox-cdn.com/uploads/chorus_image/image/56789263/akrales_170919_1976_0104.0.jpg',
|
||||
url:'assets/images/csr-img/img3.jpg',
|
||||
caption:'Third'
|
||||
}]
|
||||
school_details: any;
|
||||
imageSources=[];
|
||||
school_list : any [];
|
||||
|
||||
schoolInfo: any ;
|
||||
|
||||
// types_of_funds=['State Fund','District Fund','School common Fund','For this Project']
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,public schInfo:SchoolDetailsService) { }
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.schInfo.SchoolDetails.subscribe(schDetl=>this.schoolInfo = schDetl);
|
||||
this.imageSources = this.schoolInfo.images;
|
||||
this.getSchoolReqList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
getSchoolReqList()
|
||||
{
|
||||
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
||||
let data = {
|
||||
schoold_id: '',
|
||||
district_id: '',
|
||||
cad_id: '',
|
||||
mat_id: ''
|
||||
};
|
||||
this.restApi.post(url, data).subscribe(schDet => {
|
||||
if (schDet.dataStatus == true) {
|
||||
|
||||
// console.log(schDet);
|
||||
|
||||
let projectList = schDet.records.filter(sch=>sch.school_id==this.schoolInfo.school_id)[0];
|
||||
|
||||
// console.log(projectList);
|
||||
if(projectList !==undefined)
|
||||
{
|
||||
this.schoolInfo.material_name = projectList.material_name;
|
||||
this.schoolInfo.qty = projectList.qty;
|
||||
this.schoolInfo.cat_name = projectList.cat_name;
|
||||
}
|
||||
|
||||
|
||||
// console.log(this.material_category);
|
||||
// this.dataSource.data = schDet.records.map((val, i)=>{
|
||||
// val['SerialNo'] = i + 2;
|
||||
// return val;
|
||||
// })
|
||||
// console.log(this.dataSource.data);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
// Hack: Scrolls to top of Page after page view initialized
|
||||
|
||||
@ -15,13 +15,13 @@
|
||||
|
||||
<!-- <div fxLayout="row wrap" [routerLink]="'/home/project-detail'"> -->
|
||||
<div fxLayout="row wrap">
|
||||
<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 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" (click)="getschDetails(schooldetails)">
|
||||
<div class="p-list-main mb-2">
|
||||
<div class="p-list">
|
||||
<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="p-list">
|
||||
<div class="top"><img src="{{schooldetails.images[0]}}" 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="left">
|
||||
<div class="details">
|
||||
<div class="details" style="width: unset !important;">
|
||||
<h5>{{schooldetails.school_name}}</h5>
|
||||
<p>{{schooldetails.district_name}}</p>
|
||||
</div>
|
||||
@ -41,12 +41,12 @@
|
||||
<td>Urgent</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>Recruitment</th>
|
||||
<th>Total Contribute</th>
|
||||
<th>Total Support Needed</th>
|
||||
<th>Support Recieved</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1.50L</th>
|
||||
<th>50,000</th>
|
||||
<th><span class="currency-symbol">₹</span>{{schooldetails.total_cost}}</th>
|
||||
<th><span class="currency-symbol">₹</span>{{schooldetails.total_recevied === null?0:schooldetails.total_recevied}}</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -4,6 +4,7 @@ import { data } from 'jquery';
|
||||
import { ApiService } from 'app/shared/api.service';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { SchoolDetailsService } from 'app/shared/school-details.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-list',
|
||||
@ -14,20 +15,21 @@ export class ProjectListComponent implements OnInit {
|
||||
filter_toggle:any="all_items"
|
||||
school_list : any [];
|
||||
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) { }
|
||||
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,public schInfo:SchoolDetailsService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.getSchoolReqList();
|
||||
this.getIndividualSchoolReqData();
|
||||
}
|
||||
getSchoolReqList()
|
||||
getIndividualSchoolReqData()
|
||||
{
|
||||
|
||||
let url = `${environment.apiUrl}${'getSchoolReqList'}`;
|
||||
this.restApi.post(url,'').subscribe(schDet=>
|
||||
let url = `${environment.apiUrl}${'getIndividualSchoolReqData/any'}`;
|
||||
//console.log(url);
|
||||
this.restApi.get(url).subscribe(schDet=>
|
||||
{
|
||||
// console.log(schDet);
|
||||
this.school_list = schDet.records;
|
||||
// console.log(this.school_list);
|
||||
this.school_list = schDet['records'];
|
||||
// console.log(this.school_list);
|
||||
|
||||
})
|
||||
}
|
||||
@ -42,4 +44,13 @@ export class ProjectListComponent implements OnInit {
|
||||
// see András Szepesházi's comment below
|
||||
console.debug("Scroll Event", window.pageYOffset );
|
||||
}
|
||||
|
||||
|
||||
getschDetails(schDetails)
|
||||
{
|
||||
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};
|
||||
|
||||
this.schInfo.updateDetails(data);
|
||||
this.router.navigate(['/home/project-detail']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@
|
||||
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="63.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<div class="horizontal-menu text-center">
|
||||
<nav>
|
||||
<ul class="main-h-list">
|
||||
<ul class="main-h-list" style="font-size: 16px;">
|
||||
<li *ngFor="let menuitem of horizontalMenuItems.getAll()">
|
||||
<a [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'link'">
|
||||
<mat-icon>{{ menuitem.icon }}</mat-icon>
|
||||
|
||||
@ -46,24 +46,24 @@ const HORIZONTALMENUITEMS = [
|
||||
// {state: 'paymentconfirmation', name: 'PaymentConfirmation'}
|
||||
]
|
||||
},
|
||||
{
|
||||
state: 'my-account',
|
||||
name: 'My-Account',
|
||||
type: 'link',
|
||||
icon: 'person'
|
||||
},
|
||||
// {
|
||||
// state: 'my-account',
|
||||
// name: 'My-Account',
|
||||
// type: 'link',
|
||||
// icon: 'person'
|
||||
// },
|
||||
// {
|
||||
// state: 'contribute',
|
||||
// name: 'Contribute',
|
||||
// type: 'link',
|
||||
// icon: 'error_outline'
|
||||
// },
|
||||
{
|
||||
state: 'authentication',
|
||||
name: 'Login',
|
||||
type: 'link',
|
||||
icon: 'lock'
|
||||
},
|
||||
// {
|
||||
// state: 'authentication',
|
||||
// name: 'Login',
|
||||
// type: 'link',
|
||||
// icon: 'lock'
|
||||
// },
|
||||
// {
|
||||
// state: 'apps',
|
||||
// name: 'APPS',
|
||||
|
||||
12
ng8-seed/src/app/shared/school-details.service.spec.ts
Normal file
12
ng8-seed/src/app/shared/school-details.service.spec.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SchoolDetailsService } from './school-details.service';
|
||||
|
||||
describe('SchoolDetailsService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: SchoolDetailsService = TestBed.get(SchoolDetailsService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
17
ng8-seed/src/app/shared/school-details.service.ts
Normal file
17
ng8-seed/src/app/shared/school-details.service.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SchoolDetailsService {
|
||||
|
||||
public SchoolDetails = new BehaviorSubject<any>({'school_name':'','images':'','district_name':'','total_b':'','total_g':'','total':'','teach_tot':'','nonteach_tot':'','totstaff':'','total_cost':'','total_recevied':'','school_id':''});
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
||||
updateDetails(schDetails)
|
||||
{
|
||||
this.SchoolDetails.next(schDetails);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user