import { Component, OnInit } from '@angular/core';
import { ModalDirective } from 'ngx-bootstrap/modal';

@Component({
  templateUrl: 'student.component.html',
  styleUrls:['./student.component.scss']
})
export class StudentComponent implements OnInit {
  show = false;
  closed = false;
  public myModal;
  public myModalData;
  students: any;
  oldReg: boolean = false;
  public feesModal;
  public feesModalData;
  constructor() { }
  ngOnInit(){
    this.students = [
      {
        formId: 'KAN00128',
        studentName: 'xyz',
        fatherName: 'mmm mmm',
        mobile: '+919876543210',
        course: 'B.Sc',
        univ: 'KR university',
        sem: 2,
        batch: 'Jan 2018',
        status: '1',
        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',
        mobile: '+919876511111',
        course: 'B.Sc',
        univ: 'KR university',
        sem: 4,
        batch: 'Jan 2018',
        status: '1',
        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',
        mobile: '+919876500000',
        course: 'B.Sc',
        univ: 'KR university',
        sem: 8,
        batch: 'Jan 2018',
        status: '0',
        comments: 'rejected by Univ',
        feesDetails:[
        {
          feesName:"Tution Fees",
          feesAmount:25000,
          feesType:"Per Sem",
      },
      {
        feesName:"Exam Fees",
        feesAmount:800,
        feesType:"Per Sem",
    },
      ],
      }
    ]
  }
  getModelWindowDetails(emp) {
    this.myModalData = emp||null;
  }

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