<?php
require_once GTFWConfiguration::GetValue( 'application', 'docroot') . 'module/mahasiswa/business/AppMahasiswa.class.php';
require_once GTFWConfiguration::GetValue('application', 'docroot') . 'main/function/date.php';

class ViewDaftarMahasiswa extends XlsResponse{
   var $mWorksheets = array('Data');
   
   function GetFileName() {
      // name it whatever you want
      return 'DaftarMahasiswa.xls';
   }
   
   function ProcessRequest(){
      $mhsObj=new AppMahasiswa ();
      
      $tahunMasuk=Dispatcher::Instance()->Decrypt($_GET['tahunMasuk']);
      $isCalon=Dispatcher::Instance()->Decrypt($_GET['isCalon']);
      $notes_nim=Dispatcher::Instance()->Decrypt($_GET['notes_nim']);
      $semsMasuk=Dispatcher::Instance()->Decrypt($_GET['semsMasuk']);
      $prodi=Dispatcher::Instance()->Decrypt($_GET['prodi']);
      $nama=Dispatcher::Instance()->Decrypt($_GET['nama']);
      
      if(($tahunMasuk=='all') and ($semsMasuk='all')){
         $tahunMasuk='';
         $periode='Semua';
      }else{
         $periode=$semsMasuk.' '.$tahunMasuk.'/'.$tahunMasuk+1;
      }
      
      if($prodi=='all'){
         $prodi='';
         $prodiCtk='Semua';
      }
      
      if($tahunMasuk=='all'){
         $tahunMasuk='';
      }   
      if($semsMasuk=='all'){
         $semsMasuk='';
      }      
      
      if($isCalon=='all'){
         $isCalon='';
      }
      
      $dataDaftarMhs=$mhsObj->GetDataPrintDetilDaftarMahasiswa($tahunMasuk,$notes_nim,$isCalon,$prodi,$nama,$semsMasuk);
      $periodeAktif=$mhsObj->GetPeriodeAktif();
      $tahunAktif=$mhsObj->GetTahunPeriodeAktif();
      if(empty($dataDaftarMhs)){
         $this->mWorksheets['Data']->write(0, 0, 'Tidak Ada Data');
      }else{
         $h1 = $this->mrWorkbook->add_format();
         $h1->set_bold();
         $h1->set_size(14);
         $h1->set_align('vcenter');
         
         $h2 = $this->mrWorkbook->add_format();
         $h2->set_bold();
         $h2->set_size(12);
         $h2->set_align('center');
         $h2->set_align('vcenter');
         
         $h3 = $this->mrWorkbook->add_format();
         $h3->set_bold();
         $h3->set_size(11);
         $h3->set_align('center');
         $h3->set_align('vcenter');
         
         $strong = $this->mrWorkbook->add_format();
         $strong->set_bold();
         
         $sign = $this->mrWorkbook->add_format();
         $sign->set_size(10);
         $sign->set_align('center');
         
         $left = $this->mrWorkbook->add_format();
         $left->set_size(10);
         $left->set_align('left');
         
         #set colom
         $th = $this->mrWorkbook->add_format();
         $th->set_border(1);
         $th->set_bold();
         $th->set_size(10);
         $th->set_align('center');
         $th->set_align('vcenter');
         $th->set_text_wrap();
         
         
         $td = $this->mrWorkbook->add_format();
         $td->set_border(1);
         $td->set_size(10);         
         $td->set_align('left');
         $td->set_text_wrap();
         $tdCenter = $this->mrWorkbook->add_format();
         $tdCenter->set_border(1);
         $tdCenter->set_size(10);         
         $tdCenter->set_align('center');
         
         $tdRight = $this->mrWorkbook->add_format();
         $tdRight->set_border(1);
         $tdRight->set_size(10);         
         $tdRight->set_align('right');
         
         $this->mWorksheets['Data']->set_column(0, 0, 4);
         $this->mWorksheets['Data']->set_column(1, 1, 25);
         $this->mWorksheets['Data']->set_column(2, 2, 4);
         $this->mWorksheets['Data']->set_column(3, 3, 30);
         $this->mWorksheets['Data']->set_column(4, 4, 15);
         $this->mWorksheets['Data']->set_column(5, 5, 10);
         $this->mWorksheets['Data']->set_column(6, 6, 10);
         $this->mWorksheets['Data']->set_column(7, 7, 10);
         $this->mWorksheets['Data']->set_column(8, 8, 15);
         $this->mWorksheets['Data']->set_column(9, 9, 25);
         $this->mWorksheets['Data']->set_column(10, 10, 10);
         $this->mWorksheets['Data']->set_column(11, 11, 15);
         $this->mWorksheets['Data']->set_column(12, 12, 15);
         $this->mWorksheets['Data']->set_column(13, 13, 20);
         $this->mWorksheets['Data']->set_column(14, 14, 15);
         $this->mWorksheets['Data']->set_column(15, 15, 10);
         $this->mWorksheets['Data']->set_column(16, 16, 10);
         $this->mWorksheets['Data']->set_column(17, 17, 10);
         $this->mWorksheets['Data']->set_column(18, 18, 30);
         $this->mWorksheets['Data']->set_column(19, 19, 20);
         $this->mWorksheets['Data']->set_column(20, 20, 10);
         $this->mWorksheets['Data']->set_column(21, 21, 20);
         $this->mWorksheets['Data']->set_column(22, 22, 15);
         $this->mWorksheets['Data']->set_column(23, 23, 20);
         $this->mWorksheets['Data']->set_column(24, 24, 15);
         $this->mWorksheets['Data']->set_column(25, 25, 15);
         $this->mWorksheets['Data']->set_column(26, 26, 10);
         $this->mWorksheets['Data']->set_column(27, 27, 10);
         $this->mWorksheets['Data']->set_column(28, 28, 10);
         $this->mWorksheets['Data']->set_column(29, 29, 10);
         $this->mWorksheets['Data']->set_column(30, 30, 15);
         $this->mWorksheets['Data']->set_column(31, 31, 15);
         $this->mWorksheets['Data']->set_column(32, 32, 15);
         $this->mWorksheets['Data']->set_column(33, 33, 30);
         $this->mWorksheets['Data']->set_column(34, 34, 15);
         $this->mWorksheets['Data']->set_column(35, 35, 15);
         $this->mWorksheets['Data']->set_column(36, 36, 15);
         $this->mWorksheets['Data']->set_column(37, 37, 30);
         $this->mWorksheets['Data']->set_column(38, 38, 10);
         $this->mWorksheets['Data']->set_column(39, 39, 20);
         $this->mWorksheets['Data']->set_column(40, 40, 15);
         $this->mWorksheets['Data']->set_column(41, 41, 15);
         $this->mWorksheets['Data']->set_column(42, 42, 15);
         $this->mWorksheets['Data']->set_column(43, 43, 20);
         $this->mWorksheets['Data']->set_column(44, 44, 20);
         $this->mWorksheets['Data']->set_column(45, 45, 20);
         $this->mWorksheets['Data']->set_column(46, 46, 20);
         $this->mWorksheets['Data']->set_column(47, 47, 20);
         $this->mWorksheets['Data']->set_column(48, 48, 20);
         $this->mWorksheets['Data']->set_column(49, 49, 20);
         $this->mWorksheets['Data']->set_column(50, 50, 20);
         $this->mWorksheets['Data']->set_column(51, 51, 20);
         $this->mWorksheets['Data']->set_column(52, 52, 20);
         $this->mWorksheets['Data']->set_column(53, 53, 20);
         $this->mWorksheets['Data']->set_column(54, 54, 20);
         $this->mWorksheets['Data']->set_column(55, 55, 20);
         $this->mWorksheets['Data']->set_column(56, 56, 20);
         $this->mWorksheets['Data']->set_column(57, 57, 20);
         $this->mWorksheets['Data']->set_column(58, 58, 20);
         $this->mWorksheets['Data']->set_column(59, 59, 20);
         $this->mWorksheets['Data']->set_column(60, 60, 20);
         $this->mWorksheets['Data']->set_column(61, 61, 20);
         $this->mWorksheets['Data']->set_column(62, 62, 20);
         $this->mWorksheets['Data']->set_column(63, 63, 20);
         $this->mWorksheets['Data']->set_column(64, 64, 20);
         $this->mWorksheets['Data']->set_column(65, 65, 20);
         $this->mWorksheets['Data']->set_column(66, 66, 20);
         $this->mWorksheets['Data']->set_column(67, 67, 20);
         $this->mWorksheets['Data']->set_column(68, 68, 20);
         $this->mWorksheets['Data']->set_column(69, 69, 20);
         $this->mWorksheets['Data']->set_column(70, 70, 20);
         $this->mWorksheets['Data']->set_column(71, 71, 20);
         $this->mWorksheets['Data']->set_column(72, 72, 20);
         $this->mWorksheets['Data']->set_column(73, 73, 20);
         $this->mWorksheets['Data']->set_column(74, 74, 20);
         $this->mWorksheets['Data']->set_column(75, 75, 20);
         $this->mWorksheets['Data']->set_column(76, 76, 20);
         $this->mWorksheets['Data']->set_column(77, 77, 20);
         $this->mWorksheets['Data']->set_column(78, 78, 20);
         $this->mWorksheets['Data']->set_column(79, 79, 20);
         $this->mWorksheets['Data']->set_column(80, 80, 20);
         $this->mWorksheets['Data']->set_column(81, 81, 20);
         $this->mWorksheets['Data']->set_column(82, 82, 20);
         $this->mWorksheets['Data']->set_column(83, 83, 20);
         $this->mWorksheets['Data']->set_column(84, 84, 20);
         $this->mWorksheets['Data']->set_column(85, 85, 20);
         $this->mWorksheets['Data']->set_column(86, 86, 20);
                  #set header
         $row = 0;
         $this->mWorksheets['Data']->write($row, 0, GTFWConfiguration::GetValue('organization', 'company_name'), $h1);
         $this->mWorksheets['Data']->merge_cells($row, 0, 1, 7);
         
         $row+=3;
         $this->mWorksheets['Data']->write($row, 9, 'DAFTAR MAHASISWA', $h2);
         $this->mWorksheets['Data']->merge_cells($row, 9, $row, 13);
         $row++;
         
         $this->mWorksheets['Data']->write($row, 9, $periodeAktif .' '.$tahunAktif , $h3);
         $this->mWorksheets['Data']->merge_cells($row, 9, $row, 13);
         $row++;
    
         $row+=1;
         $this->mWorksheets['Data']->write($row, 0, 'Periode Masuk', '');
         $this->mWorksheets['Data']->merge_cells($row, 0, $row, 1);
         $this->mWorksheets['Data']->write($row, 2, ': '.$periode, '');
         $this->mWorksheets['Data']->merge_cells($row, 2, $row, 4);
         $row++;
         
         $this->mWorksheets['Data']->write($row, 0, 'Program Studi', '');
         $this->mWorksheets['Data']->merge_cells($row, 0, $row, 1);
         $this->mWorksheets['Data']->write($row, 2, ': '.$prodiCtk, '');
         $this->mWorksheets['Data']->merge_cells($row, 2, $row, 5);
         $row++;
         
                  //set header
         $row+=2;
         $this->mWorksheets['Data']->write($row, 0, 'NO', $th);
         $this->mWorksheets['Data']->write($row, 1, 'Nama Lengkap', $th);    
         $this->mWorksheets['Data']->write($row, 2, 'L/P', $th);
         $this->mWorksheets['Data']->write($row, 3, 'Tempat/Tanggal Lahir', $th);
         $this->mWorksheets['Data']->write($row, 4, 'NIM', $th);
         $this->mWorksheets['Data']->write($row, 5, 'Kode Program Studi', $th);
         $this->mWorksheets['Data']->write($row, 6, 'Periode Masuk', $th);
         $this->mWorksheets['Data']->write($row, 7, 'Angkatan', $th);
         $this->mWorksheets['Data']->write($row, 8, 'No. Tes', $th);
         $this->mWorksheets['Data']->write($row, 9, 'Jalur Masuk', $th);
         $this->mWorksheets['Data']->write($row, 10, 'Tanggal Daftar', $th);
         $this->mWorksheets['Data']->write($row, 11, 'Gelombang Pendaftaran', $th);
         $this->mWorksheets['Data']->write($row, 12, 'Status Akademik', $th);
         $this->mWorksheets['Data']->write($row, 13, 'Status Mahasiswa', $th);
         $this->mWorksheets['Data']->write($row, 14, 'No. KTP', $th);
         $this->mWorksheets['Data']->write($row, 15, 'Agama', $th);
         $this->mWorksheets['Data']->write($row, 16, 'Status Nikah', $th);
         $this->mWorksheets['Data']->write($row, 17, 'Kewarganegaraan', $th);
         $this->mWorksheets['Data']->write($row, 18, 'Status Domisili', $th);
         $this->mWorksheets['Data']->write($row, 19, 'Kota Tinggal', $th);
         $this->mWorksheets['Data']->write($row, 20, 'Alamat', $th);
         $this->mWorksheets['Data']->write($row, 21, 'Kode Pos', $th);
         $this->mWorksheets['Data']->write($row, 22, 'Negara', $th);
         $this->mWorksheets['Data']->write($row, 23, 'No. Telp/Hp', $th);
         $this->mWorksheets['Data']->write($row, 24, 'Email', $th);
         $this->mWorksheets['Data']->write($row, 25, 'Hubungan Biaya', $th);
         $this->mWorksheets['Data']->write($row, 26, 'Sumber Dana Beasiswa', $th);
         $this->mWorksheets['Data']->write($row, 27, 'Jumlah Saudara', $th);
         $this->mWorksheets['Data']->write($row, 28, 'Jumlah Saudara Laki', $th);
         $this->mWorksheets['Data']->write($row, 29, 'Jumlah Saudara Perempuan', $th);
         $this->mWorksheets['Data']->write($row, 30, 'Status Bekerja', $th);
         $this->mWorksheets['Data']->write($row, 31, 'Pekerjaan', $th);
         $this->mWorksheets['Data']->write($row, 32, 'Institusi/Kantor', $th);
         $this->mWorksheets['Data']->write($row, 33, 'Alamat Institusi/Kantor', $th);
         $this->mWorksheets['Data']->write($row, 34, 'No Asuransi', $th);
         $this->mWorksheets['Data']->write($row, 35, 'Hoby', $th);
         $this->mWorksheets['Data']->write($row, 36, 'NIM Lama', $th);
         $this->mWorksheets['Data']->write($row, 37, 'PT Asal', $th);
         $this->mWorksheets['Data']->write($row, 38, 'Tahun Masuk PT Asal', $th);
         $this->mWorksheets['Data']->write($row, 39, 'Nama Ayah', $th);
         $this->mWorksheets['Data']->write($row, 40, 'Tanggal Lahir Ayah', $th);
         $this->mWorksheets['Data']->write($row, 41, 'Status Ayah', $th);
         $this->mWorksheets['Data']->write($row, 42, 'Tanggal Meniggal Ayah', $th);
         $this->mWorksheets['Data']->write($row, 43, 'Pendidikan Ayah', $th);
         $this->mWorksheets['Data']->write($row, 44, 'Pendidikan Terakhir Ayah', $th);
         $this->mWorksheets['Data']->write($row, 45, 'Pekerjaan Ayah', $th);
         $this->mWorksheets['Data']->write($row, 46, 'Nama Ibu', $th);
         $this->mWorksheets['Data']->write($row, 47, 'Tanggal Lahir Ibu', $th);
         $this->mWorksheets['Data']->write($row, 48, 'Status Ibu', $th);
         $this->mWorksheets['Data']->write($row, 49, 'Tanggal Meninggal Ibu', $th);
         $this->mWorksheets['Data']->write($row, 50, 'Pendidikan Ibu', $th);
         $this->mWorksheets['Data']->write($row, 51, 'Pendidikan Terakhir Ibu', $th);
         $this->mWorksheets['Data']->write($row, 52, 'Pekerjaan Ibu', $th);
         $this->mWorksheets['Data']->write($row, 53, 'Agama Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 54, 'Warga Negara Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 55, 'Alamat Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 56, 'Kota Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 57, 'Kode Pos Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 58, 'No. Telp Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 59, 'Email Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 60, 'Orang Tua Mampu', $th);
         $this->mWorksheets['Data']->write($row, 61, 'Penghasilan Orang Tua', $th);
         $this->mWorksheets['Data']->write($row, 62, 'Jumlah Tanggungan', $th);
         $this->mWorksheets['Data']->write($row, 63, 'Nama Wali', $th);
         $this->mWorksheets['Data']->write($row, 64, 'Tanggal Lahir Wali', $th);
         $this->mWorksheets['Data']->write($row, 65, 'Status Wali', $th);
         $this->mWorksheets['Data']->write($row, 66, 'Tanggal Meninggal Wali', $th);
         $this->mWorksheets['Data']->write($row, 67, 'Alamat Wali', $th);
         $this->mWorksheets['Data']->write($row, 68, 'Kota Wali', $th);
         $this->mWorksheets['Data']->write($row, 69, 'Kode Pos Wali', $th);
         $this->mWorksheets['Data']->write($row, 70, 'No Telp Wali', $th);
         $this->mWorksheets['Data']->write($row, 71, 'Email Wali', $th);
         $this->mWorksheets['Data']->write($row, 72, 'Pendidikan Wali', $th);
         $this->mWorksheets['Data']->write($row, 73, 'Pendidikan Terakhir Wali', $th);
         $this->mWorksheets['Data']->write($row, 74, 'Pekerjaan Wali', $th);
         $this->mWorksheets['Data']->write($row, 75, 'Tahun Daftar SMTA', $th);
         $this->mWorksheets['Data']->write($row, 76,  'Tahun Lulus SMTA', $th);
         $this->mWorksheets['Data']->write($row, 77, 'Jurusan SMTA', $th);
         $this->mWorksheets['Data']->write($row, 78, 'Jenis SMTA', $th);
         $this->mWorksheets['Data']->write($row, 79, 'Nama SMTA', $th);
         $this->mWorksheets['Data']->write($row, 80, 'Alamat SMTA', $th);
         $this->mWorksheets['Data']->write($row, 81, 'No Ijazah SMTA', $th);
         $this->mWorksheets['Data']->write($row, 82, 'Ijazah SMTA', $th);
         $this->mWorksheets['Data']->write($row, 83, 'Tanggal Ijazah SMTA', $th);
         $this->mWorksheets['Data']->write($row, 84, 'Status SMTA', $th);
         $this->mWorksheets['Data']->write($row, 85, 'Akreditasi SMTA', $th);
         $this->mWorksheets['Data']->write($row, 86, 'Nilai Ujian AKhir SMTA', $th);
         $row++;
         for($i=0;$i<count($dataDaftarMhs);$i++){
         $this->mWorksheets['Data']->write($row, 0, $i+1, $td);
         $this->mWorksheets['Data']->write($row, 1, $dataDaftarMhs[$i]['mhs_nama'], $td);    
         $this->mWorksheets['Data']->write($row, 2, $dataDaftarMhs[$i]['mhs_jenis_kelamin'], $td);
         $this->mWorksheets['Data']->write($row, 3, $dataDaftarMhs[$i]['mhs_tmpt_lahir']."/ ".ConvertDate($dataDaftarMhs[$i]['mhs_tanggal_lahir'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 4, $dataDaftarMhs[$i]['mhs_nim'], $td);
         $this->mWorksheets['Data']->write($row, 5, $dataDaftarMhs[$i]['mhs_prodi'], $td);
         $this->mWorksheets['Data']->write($row, 6, $dataDaftarMhs[$i]['mhs_periode_masuk'], $td);
         $this->mWorksheets['Data']->write($row, 7, $dataDaftarMhs[$i]['mhs_angkatan'], $td);
         $this->mWorksheets['Data']->write($row, 8, $dataDaftarMhs[$i]['mhs_no_tes'], $td);
         $this->mWorksheets['Data']->write($row, 9, $dataDaftarMhs[$i]['mhs_jalur_masuk'], $td);
         $this->mWorksheets['Data']->write($row, 10, $dataDaftarMhs[$i]['mhs_tanggal_daftar'], $td);
         $this->mWorksheets['Data']->write($row, 11, $dataDaftarMhs[$i]['mhs_gelombang_daftar'], $td);
         $this->mWorksheets['Data']->write($row, 12, $dataDaftarMhs[$i]['mhs_status_aktif'], $td);
         $this->mWorksheets['Data']->write($row, 13, $dataDaftarMhs[$i]['mhs_status'], $td);
         $this->mWorksheets['Data']->write($row, 14, $dataDaftarMhs[$i]['mhs_no_ktp'], $td);
         $this->mWorksheets['Data']->write($row, 15, $dataDaftarMhs[$i]['mhs_agama'], $td);
         $this->mWorksheets['Data']->write($row, 16, $dataDaftarMhs[$i]['mhs_status_nikah'], $td);
         $this->mWorksheets['Data']->write($row, 17, $dataDaftarMhs[$i]['mhs_warga_negara'], $td);
         $this->mWorksheets['Data']->write($row, 18, $dataDaftarMhs[$i]['mhs_status_rumah'], $td);
         $this->mWorksheets['Data']->write($row, 19, $dataDaftarMhs[$i]['mhs_alamat'], $td);
         $this->mWorksheets['Data']->write($row, 20, $dataDaftarMhs[$i]['mhs_kota'], $td);
         $this->mWorksheets['Data']->write($row, 21, $dataDaftarMhs[$i]['mhs_kode_pos'], $td);
         $this->mWorksheets['Data']->write($row, 22, $dataDaftarMhs[$i]['mhs_negara'], $td);
         $this->mWorksheets['Data']->write($row, 23, $dataDaftarMhs[$i]['mhs_no_telp'], $td);
         $this->mWorksheets['Data']->write($row, 24, $dataDaftarMhs[$i]['mhs_email'], $td);
         $this->mWorksheets['Data']->write($row, 25, $dataDaftarMhs[$i]['mhs_hubungan_biaya'], $td);
         $this->mWorksheets['Data']->write($row, 26, $dataDaftarMhs[$i]['mhs_beasiswa'], $td);
         $this->mWorksheets['Data']->write($row, 27, $dataDaftarMhs[$i]['mhs_jumlah_sdr'], $td);
         $this->mWorksheets['Data']->write($row, 28, $dataDaftarMhs[$i]['mhs_jumlah_sdr_lk'], $td);
         $this->mWorksheets['Data']->write($row, 29, $dataDaftarMhs[$i]['mhs_jumlah_sdr_pr'], $td);
         $this->mWorksheets['Data']->write($row, 30, $dataDaftarMhs[$i]['mhs_status_kerja'], $td);
         $this->mWorksheets['Data']->write($row, 31, $dataDaftarMhs[$i]['mhs_kerja'], $td);
         $this->mWorksheets['Data']->write($row, 32, $dataDaftarMhs[$i]['mhs_tempat_kerja'], $td);
         $this->mWorksheets['Data']->write($row, 33, $dataDaftarMhs[$i]['mhs_alamat_kantor'], $td);
         $this->mWorksheets['Data']->write($row, 34, $dataDaftarMhs[$i]['mhs_no_askes'], $td);
         $this->mWorksheets['Data']->write($row, 35, $dataDaftarMhs[$i]['mhs_hoby'], $td);
         $this->mWorksheets['Data']->write($row, 36, $dataDaftarMhs[$i]['mhs_nim_lama'], $td);
         $this->mWorksheets['Data']->write($row, 37, $dataDaftarMhs[$i]['mhs_pt_asal'], $td);
         $this->mWorksheets['Data']->write($row, 38, $dataDaftarMhs[$i]['mhs_tahun_masuk_pt_asal'], $td);
         $this->mWorksheets['Data']->write($row, 39, $dataDaftarMhs[$i]['mhs_nama_ayah'], $td);
         $this->mWorksheets['Data']->write($row, 40, ($dataDaftarMhs[$i]['mhs_tgl_lahir_ayah']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_lahir_ayah'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 41, $dataDaftarMhs[$i]['mhs_ayah_meninggal'], $td);
         $this->mWorksheets['Data']->write($row, 42, ($dataDaftarMhs[$i]['mhs_tgl_ayah_meninggal']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_ayah_meninggal'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 43, $dataDaftarMhs[$i]['mhs_pendidikan_ayah'], $td);
         $this->mWorksheets['Data']->write($row, 44, $dataDaftarMhs[$i]['mhs_pendidikan_terakhir_ayah'], $td);
         $this->mWorksheets['Data']->write($row, 45, $dataDaftarMhs[$i]['mhs_pekerjaan_ayah'], $td);
         $this->mWorksheets['Data']->write($row, 46, $dataDaftarMhs[$i]['mhs_nama_ibu'], $td);
         $this->mWorksheets['Data']->write($row, 47, ($dataDaftarMhs[$i]['mhs_tgl_lahir_ibu']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_lahir_ibu'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 48, $dataDaftarMhs[$i]['mhs_ibu_meninggal'], $td);
         $this->mWorksheets['Data']->write($row, 49, ($dataDaftarMhs[$i]['mhs_tgl_ibu_meninggal']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_ibu_meninggal'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 50, $dataDaftarMhs[$i]['mhs_pendidikan_ibu'], $td);
         $this->mWorksheets['Data']->write($row, 51, $dataDaftarMhs[$i]['mhs_pendidikan_terakhir_ibu'], $td);
         $this->mWorksheets['Data']->write($row, 52, $dataDaftarMhs[$i]['mhs_pekerjaan_ibu'], $td);
         $this->mWorksheets['Data']->write($row, 53, $dataDaftarMhs[$i]['mhs_agama_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 54, $dataDaftarMhs[$i]['mhs_warga_negara_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 55, $dataDaftarMhs[$i]['mhs_alamat_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 56, $dataDaftarMhs[$i]['mhs_kota_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 57, $dataDaftarMhs[$i]['mhs_kode_pos_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 58, $dataDaftarMhs[$i]['mhs_no_telp_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 59, $dataDaftarMhs[$i]['mhs_email_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 60, $dataDaftarMhs[$i]['mhs_ortu_mampu'], $td);
         $this->mWorksheets['Data']->write($row, 61, $dataDaftarMhs[$i]['mhs_penghasilan_ortu'], $td);
         $this->mWorksheets['Data']->write($row, 62, $dataDaftarMhs[$i]['mhs_jumlah_tanggungan'], $td);
         $this->mWorksheets['Data']->write($row, 63, $dataDaftarMhs[$i]['mhs_nama_wali'], $td);
         $this->mWorksheets['Data']->write($row, 64, ($dataDaftarMhs[$i]['mhs_tgl_lahir_wali']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_lahir_wali'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 65, $dataDaftarMhs[$i]['mhs_wali_meninggal'], $td);
         $this->mWorksheets['Data']->write($row, 66, ($dataDaftarMhs[$i]['mhs_tgl_meninggal_wali']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_meninggal_wali'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 67, $dataDaftarMhs[$i]['mhs_alamat_wali'], $td);
         $this->mWorksheets['Data']->write($row, 68, $dataDaftarMhs[$i]['mhs_kota_wali'], $td);
         $this->mWorksheets['Data']->write($row, 69, $dataDaftarMhs[$i]['mhs_kode_pos_wali'], $td);
         $this->mWorksheets['Data']->write($row, 70, $dataDaftarMhs[$i]['mhs_no_telp_wali'], $td);
         $this->mWorksheets['Data']->write($row, 71, $dataDaftarMhs[$i]['mhe_email_wali'], $td);
         $this->mWorksheets['Data']->write($row, 72, $dataDaftarMhs[$i]['mhs_pendidikan_wali'], $td);
         $this->mWorksheets['Data']->write($row, 73, $dataDaftarMhs[$i]['mhs_pendidikan_terakhir_wali'], $td);
         $this->mWorksheets['Data']->write($row, 74, $dataDaftarMhs[$i]['mhs_pekerjaan_wali'], $td);
         $this->mWorksheets['Data']->write($row, 75, $dataDaftarMhs[$i]['mhs_tahun_daftar_smta'], $td);
         $this->mWorksheets['Data']->write($row, 76, $dataDaftarMhs[$i]['mhs_tahun_lulus_smta'], $td);
         $this->mWorksheets['Data']->write($row, 77, $dataDaftarMhs[$i]['mhs_jurusan_smta'], $td);
         $this->mWorksheets['Data']->write($row, 78, $dataDaftarMhs[$i]['mhs_jenis_smta'], $td);
         $this->mWorksheets['Data']->write($row, 79, $dataDaftarMhs[$i]['mhs_smta'], $td);
         $this->mWorksheets['Data']->write($row, 80, $dataDaftarMhs[$i]['mhs_alamat_smta'], $td);
         $this->mWorksheets['Data']->write($row, 81, $dataDaftarMhs[$i]['mhs_no_ijazah_smta'], $td);
         $this->mWorksheets['Data']->write($row, 82, $dataDaftarMhs[$i]['mhs_ijazah_smta'], $td);
         $this->mWorksheets['Data']->write($row, 83, ($dataDaftarMhs[$i]['mhs_tgl_ijazah_smta']=="0000-00-00")?'':ConvertDate($dataDaftarMhs[$i]['mhs_tgl_ijazah_smta'],"YYYY-MM-DD","DD-MM-YYYY"), $td);
         $this->mWorksheets['Data']->write($row, 84, $dataDaftarMhs[$i]['mhs_status_smta'], $td);
         $this->mWorksheets['Data']->write($row, 85, $dataDaftarMhs[$i]['mhs_akreditasi'], $td);
         $this->mWorksheets['Data']->write($row, 86, $dataDaftarMhs[$i]['mhs_nilai_uas_smta'], $td);
            $row++;
         }
      }
   }
}
?>