<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$temp = explode("-",$message);
$Kode = $temp[0];
$Sem = $temp[1];
$Kelas = $temp[2];
$TA = $temp[3];
?>
<h2><center><u>BERITA ACARA KULIAH</u></center></h2>
<table>
    <tr>
        <td width="180">Mata Kuliah</td>
        <td> : </td>
        <td>
            <?php
            $mk = Kurikulum::model()->findByAttributes(array('KODE_MK' => $Kode));
            echo $mk->NAMA_KUL_IND;
            ?>
        </td>
    </tr>
    <tr>
        <td>Nama Dosen</td>
        <td> : </td>
        <td>
            <?php
            $pengajar = Pengajar::model()->findByAttributes(array('KODE_MK' => $Kode));
            $pegawai = Pegawai::model()->findByAttributes(array('ID' => $pengajar->DOSEN_ID));
            echo $pegawai->NAMA;
            ?>
        </td>
    </tr>
    <tr>
        <td>Semester</td>
        <td> : </td>
        <td>
            <?php
            echo $Sem;
            ?>
        </td>
    </tr>
    <tr>
        <td>Angkatan / Kelas</td>
        <td>: </td>
        <td><?php echo $TA ." / " . $Kelas; ?></td>
    </tr>
</table>

<?php
$dataProvider = BeritaAcaraKuliah::model()->findAllByAttributes(array('TA'=>$TA, 'KODE_MK'=>$Kode, 'KELAS'=>$Kode));
$criteria = new CDbCriteria;
$criteria->condition = 'KODE_MK = "' . $Kode . '" and KELAS = "' . $Kelas . '"and SEM = "' . $Sem . '"and TA = "' . $TA . '"';
$dataProvider = new CActiveDataProvider('BeritaAcaraDaftarHadir', array('pagination'=>array('pageSize'=>10,),'criteria' => $criteria));

//echo $count = BeritaAcaraDaftarHadir::model()->countByAttributes(array('KODE_MK'=>$Kode));
?>

<?php
//$dataProvider = BeritaAcaraKuliah::model()->findAllByAttributes(array('TA'=>$TA, 'KODE_MK'=>$Kode, 'KELAS'=>$Kode));
//$criteria = new CDbCriteria;
//$criteria->condition = 'TA = "' . $TA . '" and KODE_MK = "' . $Kode . '" and KELAS = "' . $Kelas . '"and SEM = "' . $Sem . '"';
//$dataProvider = new CActiveDataProvider('BeritaAcaraKuliah', array('criteria' => $criteria));
$this->widget(
        'booster.widgets.TbGridView', array(
    'type' => 'striped',
    'dataProvider' => $dataProvider,
    'enablePagination' => false,
    'template' => "{items}",
    'columns' => array('NIM','WEEK', 'TANGGAL','SESSION', 'KELAS', 'TA', 'SEM', 'ID_KUR', 'KODE_MK','STATUS' 
    ),)
);
?><br/>
<H3>Summary : </H3>
<table BORDER='2' WIDTH="250">
    <tr>
        <td>
            
            <?php echo "Total Mahasiswa Hadir : ".$wew;?><br>
            <?php echo "Total Mahasiswa Absen : ".$wow;?>
        </td>
    </tr>
</table>
<br><br>
<?php
echo CHtml::Button('Cetak Berta Laporan Ini (.pdf)', array('submit' => array('/BeritaAcaraDaftarHadir/CetakLaporan', 'id'=>$message)));
echo "  -  ";
echo CHtml::Button('Cetak Berta Laporan Ini (.xls)');
?>