changes by suren

This commit is contained in:
sriram-at-840620226347 2019-09-30 19:57:44 +05:30
parent 27fb4a9a3e
commit 7ced838009
16 changed files with 133 additions and 86 deletions

View File

@ -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">Contribute to Specific Need </h5></mat-card-title>
<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">
@ -36,25 +36,23 @@
</mat-select>
</mat-form-field>
</div>
<div fxLayout fxLayout="row" style="text-align: right;">
<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)="getSchoolReqList()">Submit</button>
<button mat-raised-button color="primary" (click)="refresh()">View All</button>
<button class="ml-2" mat-raised-button color="primary" (click)="reset()">Clear</button>
<button class="ml-2" mat-raised-button color="primary" (click)="getSchoolReqList()">Submit</button>
</div>
</div>
</form>
<!--*********************-->
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
<!--*********************-->
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<!-- Requirement Column -->
<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>
<td style="width: 15% !important;" mat-cell *matCellDef="let row" class="product-thumbnail"><img src="{{row.img_url}}" onerror="this.onerror=null;this.src='assets/images/csr-img/error_img.jpg';" alt="School Img" width="70"></td>
</ng-container>
<!-- Item Need Column -->
@ -72,25 +70,25 @@
<!-- Quantity Column -->
<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>
<td style="width: 10% !important;text-align: center;" mat-cell *matCellDef="let row"> {{row.qty}}</td>
</ng-container>
<!-- Sponsor Column -->
<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>
<td style="width: 10% !important;text-align: center;" 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 (in RS) </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="Amount">
<th style="width: 20% !important;" mat-header-cell *matHeaderCellDef mat-sort-header> Amount (in RS) </th>
<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>
@ -135,17 +133,17 @@
</mat-card>
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="20" fxFlex.xl="40"> -->
<mat-card class="support_mat" fxFlex="30%" fxFlex.xs="100" fxFlex.sm="100px">
<mat-card class="support_mat sidescroll" fxFlex="27%" fxFlex.xs="100" fxFlex.sm="100px">
<mat-card-header>
<mat-card-title>
<h5> Contribute to General Development Fund</h5>
<h5 class="text-center"> Contribute to General Development Fund</h5>
</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="column" fxLayoutAlign="start stretch">
<div fxLayout fxLayout="row" fxLayout.xs="column" fxLayoutGap.xs="0">
<div class="pl-3" fxFlex="100%" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="100" fxFlex.xl="100">
<div class="text-center" fxFlex="100%" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="40" fxFlex.lg="100" fxFlex.xl="100">
<mat-form-field appearance="outline" style="width: 70%;text-align: center;">
<input matInput type="number" placeholder="Amount">
</mat-form-field>

View File

@ -1,6 +1,12 @@
.calculated-shipping[_ngcontent-gen-c13]{
padding: 0px !important;
}
.sidescroll{
right: 45px !important;
height: fit-content;
position: fixed;
z-index: 1;
}
a {
text-decoration: underline;
color: #4CAF50;
@ -16,7 +22,7 @@ a {
td, th {
width: 25%;
text-align: center;
// text-align: center;
}
table.shop-table {
// border-collapse: separate;

View File

@ -4,6 +4,7 @@ import { ApiService } from '../../shared/api.service';
import { FormGroup, FormBuilder, FormControl, Validators, } from '@angular/forms';
import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
import { Router } from '@angular/router';
import { SchoolDetailsService } from 'app/shared/school-details.service';
@ -28,10 +29,11 @@ export class ContributeComponent implements OnInit {
Total: any = [];
grandTotal: any = [];
finalData: any = [];
schRquId:any ;
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router) {
constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,public schInfo:SchoolDetailsService) {
// Create 100 users
}
// ngOnInit() {
@ -53,6 +55,13 @@ export class ContributeComponent implements OnInit {
this.initForm();
this.getSchoolReqList();
this.getSchoolReqList2();
this.schInfo.schReqId.subscribe(res=>
{
this.schRquId = res;
// console.log(res);
})
// window.localStorage.clear();
}
@ -77,9 +86,19 @@ export class ContributeComponent implements OnInit {
{
if(schDet.dataStatus==true)
{
this.dataLength = schDet.records.length;
this.dataSource.data = schDet.records;
let data ='';
// console.log(schDet.records);
if(this.schRquId.sch_req_id !='')
{
data = schDet.records.filter(sch=>sch.school_id==this.schRquId);
}else
{
data = schDet.records;
}
// console.log(data,this.schRquId);
this.dataSource.data = data;
this.dataLength = data.length;
// console.log(this.material_category);
// this.dataSource.data = schDet.records.map((val, i)=>{
// val['SerialNo'] = i + 2;
@ -89,6 +108,7 @@ export class ContributeComponent implements OnInit {
}
})
}
somethingChanged(e,i,item,mat_id){
// console.log(e,i,item);
this.Total[i] = e*item;
@ -100,7 +120,7 @@ export class ContributeComponent implements OnInit {
this.grandTotal = this.Total.reduce((acc, value) => acc + value, 0);
}
getSchoolReqList2()
{
@ -146,6 +166,10 @@ export class ContributeComponent implements OnInit {
})
// console.log('mat'+this.material_category);
}
reset(){
this.Contribute.reset();
}
ngAfterViewInit() {
// Hack: Scrolls to top of Page after page view initialized
@ -174,9 +198,11 @@ export class ContributeComponent implements OnInit {
"contributions":this.finalData
}};
console.log(data);
// console.log(data);
}
refresh(): void {
window.location.reload();
}
}

View File

@ -104,7 +104,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 [routerLink]="['/contribute']" class="button-cyan">Contribute</button>
<button mat-raised-button (click)="navigate(schoolInfo.school_id)" class="button-cyan">Contribute</button>
</div>
</div>
@ -184,7 +184,7 @@
</table>
<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="end center" class="m-gap p-gap">
<button mat-raised-button [routerLink]="['/contribute']" class="button-cyan">Contribute</button>
<button mat-raised-button (click)="navigate(schoolInfo.school_id)" class="button-cyan">Contribute</button>
</div>
</div>

View File

@ -70,7 +70,7 @@ export class ProjectDetailComponent implements OnInit {
ngAfterViewInit() {
// Hack: Scrolls to top of Page after page view initialized
let top = document.getElementById('top');
console.log("d",top);
// console.log("d",top);
if (top !== null) {
top.scrollIntoView();
top = null;
@ -81,7 +81,16 @@ export class ProjectDetailComponent implements OnInit {
this.sliderimg.goToSlide(index);
}
navigate(schReferId)
{
// console.log(schReferId);
let data = {'sch_req_id':schReferId};
// console.log(88,data);
this.schInfo.updateSchRequ(schReferId);
this.router.navigate(['/contribute']);
}
}

View File

@ -18,7 +18,7 @@
<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.images[0]}}" onerror="this.onerror=null;this.src='https://image.shutterstock.com/image-vector/school-boy-standing-his-uniform-260nw-1216095019.jpg';" alt=""></div>
<div class="top"><img src="{{schooldetails.images[0]}}" onerror="this.onerror=null;this.src='assets/images/csr-img/error_img.jpg';" alt=""></div>
<div class="bottom">
<div class="left">
<div class="details" style="width: unset !important;">

View File

@ -50,7 +50,7 @@ export class ProjectListComponent implements OnInit {
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,'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};
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']);

View File

@ -4,11 +4,11 @@
<div class="opt-side relative ">
<div class="sidebar-container ">
<div class="branding text-center">
<h2><img src="assets/images/csr-img/tn_logo.png" style="width:50px;height: 48px;"> <span> TN Schools</span>
<h2><img src="assets/images/csr-img/tn_logo.png" style="width:95%;height:54px;">
</h2>
</div>
<div class="main-nav">
<div class="user-pro-wrap">
<!-- <div class="user-pro-wrap">
<div class="user-profile-thumb text-center">
<div class="user-i">
<img src="assets/images/userpic.jpg" class="rad-full mb-1" width="100" height="100" alt="">
@ -26,7 +26,7 @@
<mat-icon>settings</mat-icon>
</a>
</div>
</div>
</div> -->
<mat-nav-list appAccordion class="navigation relative">
<mat-list-item appAccordionLink *ngFor="let menuitem of menuItems.getAll()">
<a appAccordionToggle class="relative" mat-ripple [routerLink]="['/', menuitem.state]" *ngIf="menuitem.type === 'link'">
@ -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:50px;height: 48px;"> <span> TN Schools</span></a>
<h2><a href="#"><img src="assets/images/csr-img/tn_logo.png" style="width:40%;height:54px;"></a>
</h2>
</div>
</div>

View File

@ -1,7 +1,7 @@
<div class="relative">
<div class="form-bg">
<div fxLayout="row" fxLayoutAlign="center start" class="pt-2">
<div fxLayout="column" fxFlex.xl="40" fxFlex.lg="40" fxFlex.md="50" fxFlex.sm="80" fxFlex.xs="90">
<div fxLayout="column" fxLayoutAlign="center" fxFlex.xl="40" fxFlex.lg="40" fxFlex.md="50" fxFlex.sm="80" fxFlex.xs="90">
<mat-card class="login-session">
<div>
<h2 class="base-border">Login Form</h2>

View File

@ -28,25 +28,25 @@ const HORIZONTALMENUITEMS = [
type: 'link',
icon: 'home'
},
// {
// state: 'contribute',
// name: 'Contribute',
// type: 'link',
// icon: 'error_outline'
// },
{
state: 'apps',
name: 'Support',
type: 'sub',
icon: 'apps',
children: [
{state: 'contribute', name: 'Contribute',},
{state: 'projects', name: 'View Projects',},
// {state: 'payment', name: 'Payment'},
// {state: 'paymentconfirmation', name: 'PaymentConfirmation'}
]
state: 'contribute',
name: 'Contribute',
type: 'link',
icon: 'error_outline'
},
// {
// state: 'apps',
// name: 'Support',
// type: 'sub',
// icon: 'apps',
// children: [
// {state: 'contribute', name: 'Contribute',},
// {state: 'projects', name: 'View Projects',},
// {state: 'payment', name: 'Payment'},
// {state: 'paymentconfirmation', name: 'PaymentConfirmation'}
// ]
// },
// {
// state: 'my-account',
// name: 'My-Account',
// type: 'link',
@ -58,12 +58,12 @@ const HORIZONTALMENUITEMS = [
// 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',

View File

@ -49,36 +49,36 @@ const MENUITEMS : Menu[] = [
// {state: '503', name: '503'}
// ]
// },
{
state: 'projects',
name: 'Projects',
type: 'link',
icon: 'bookmark'
},
// {
// state: 'projects',
// name: 'Projects',
// type: 'link',
// icon: 'bookmark'
// },
{
state: 'contribute',
name: 'Contribute',
type: 'link',
icon: 'error_outline'
},
{
state: 'apps',
name: 'Pages',
type: 'sub',
icon: 'apps',
children: [
{state: 'contribute', name: 'Contribute',},
{state: 'projects', name: 'Projects',},
{state: 'payment', name: 'Payment'},
{state: 'paymentconfirmation', name: 'PaymentConfirmation'}
]
},
{
state: 'my-account',
name: 'My-Account',
type: 'link',
icon: 'person'
},
// {
// state: 'apps',
// name: 'Pages',
// type: 'sub',
// icon: 'apps',
// children: [
// {state: 'contribute', name: 'Contribute',},
// {state: 'projects', name: 'Projects',},
// {state: 'payment', name: 'Payment'},
// {state: 'paymentconfirmation', name: 'PaymentConfirmation'}
// ]
// },
// {
// state: 'my-account',
// name: 'My-Account',
// type: 'link',
// icon: 'person'
// },
// {
// state: 'payment',
// name: 'Payment',

View File

@ -6,7 +6,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
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':'','block_name':'','category':'','management':'','latitude':'','longitude':'','high_class':'','low_class':''});
public schReqId = new BehaviorSubject<any>({'sch_req_id':''});
constructor() { }
@ -14,4 +14,10 @@ export class SchoolDetailsService {
{
this.SchoolDetails.next(schDetails);
}
updateSchRequ(schReqId)
{
this.schReqId.next(schReqId);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

View File

@ -126,6 +126,7 @@ $mat-toolbar-height-mobile-landscape: 48px !default;
position: relative;
}
.dropdown {
margin-left: 28px;
position: fixed;
z-index: 5;
opacity: 1;
@ -133,8 +134,8 @@ $mat-toolbar-height-mobile-landscape: 48px !default;
// width: 200px;
transition: all 0.2s ease-in-out 0s;
transform: translateY(-20px);
background: #fff;
color:black;
background: #51caca;
color:#fff;
padding: 0;
list-style: none;
text-align: left;
@ -144,7 +145,8 @@ $mat-toolbar-height-mobile-landscape: 48px !default;
padding: 0.5rem 1rem;
display: block;
&:hover{
background: #f2f4f8;
background: #51caca;
color: #101010;
}
}
li:hover {