import { Component, OnInit } from '@angular/core';

@Component({
  templateUrl: 'student.component.html',
  styleUrls:['./student.component.scss']
})
export class StudentComponent implements OnInit {
  show = false;
  closed = false;
  public myModal;
  public myModalData;
  public myModelReReg;
  public modelType: string;
  students: any;
  oldReg: boolean = false;
  public feesModal;
  public feesModalData;
  constructor() { }
  ngOnInit(){
    this.students = [
      {
        formId: 'KAN00128',
        studentName: 'xyz',
        fatherName: 'mmm mmm',
        course: 'B.Sc',
        univ: 'KR univ',
        sem: 2,
        batch: 'Jan 2018',
        status: 'Send To Univ',
        comments: 'approved by Univ',
        feesDetails:[
          {
            feesName:"Tution Fees",
            feesAmount:25000,
            feesType:"Per Sem",
            status:"Pending"
        },
        {
          feesName:"Exam Fees",
          feesAmount:800,
          feesType:"Per Sem",
      },
        ],
      },
      {
        formId: 'KAN00107',
        studentName: 'abc',
        fatherName: 'sss sss',
        course: 'B.Sc',
        univ: 'KR univ',
        sem: 4,
        batch: 'Jan 2018',
        status: 'Send To Univ',
        comments: 'approved by Univ',
        feesDetails:[
          {
            feesName:"Tution Fees",
            feesAmount:25000,
            feesType:"Per Sem",
            status:"Pending"
        },
        {
          feesName:"Exam Fees",
          feesAmount:800,
          feesType:"Per Sem",
      },
        ],
      },
      {
        formId: 'KAN00086',
        studentName: 'uvw',
        fatherName: 'nnn nnn',
        course: 'B.Sc',
        univ: 'KR univ',
        sem: 8,
        batch: 'Jan 2018',
        status: 'rejected by Univ',
        comments: 'rejected by Univ',
        feesDetails:[
          {
            feesName:"Tution Fees",
            feesAmount:25000,
            feesType:"Per Sem",
            status:"Pending"
        },
        {
          feesName:"Exam Fees",
          feesAmount:800,
          feesType:"Per Sem",
      },
        ],
      }
    ]
  }
  getModelWindowDetails(emp, type) {
    this.myModalData = emp||null;
    this.modelType = type;
  }

  editEmployee(){
     this.show = !this.show;
  }
  // open student fees modal 
  getFeesModelWindowDetails(details) {
    this.feesModalData = details.feesDetails||null;
  }
}
