Baru

parent 6705458d
......@@ -7,9 +7,12 @@
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/SiteController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/JadwalController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/site/login.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/mJadwal/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/LaporanBeritaAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/models/Excel.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/searchBeritaAcaraDaftarHadir.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/SearcHDaftarHadir.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dJadwal/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/site/upload.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/site/excelpath.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/DJadwalController.php</file>
......
......@@ -275,50 +275,54 @@ class BeritaAcaraDaftarHadirController extends Controller {
}
}
public function actionValidate(/* $rfid, $nim ,$datetime*/) {
// $tanggal = date('Y-m-d H:m:s');
// echo $tanggal->format('Y-m-d');
//
$dt = new DateTime();
echo $dt->format('Y-m-d H:i:s');
// $waktu = date('H:i:s');
// $sql = "SELECT * FROM jadwal WHERE ((RUANGAN='$rfid' AND TANGGAL ='$tanggal') AND ('$waktu' BETWEEN jadwal.`START_TIME` AND jadwal.`END_TIME`))
//AND KELAS IN (SELECT KELAS FROM registrasi WHERE registrasi.`NIM`='$nim' ORDER BY SEM DESC)";
//
// $list = Yii::app()->db->createCommand($sql)->queryAll();
// if ($list) {
// $kehadiran = BeritaAcaraDaftarHadir::model()->findByAttributes(
// array(
// 'WEEK' => $list[0]['WEEK'],
// 'TANGGAL' => $list[0]['TANGGAL'],
// 'SESSION' => $list[0]['SESSION'],
// 'START_TIME' => $list[0]['START_TIME'],
// 'END_TIME' => $list[0]['END_TIME'],
// 'KODE_MK' => $list[0]['KODE_MK'],
// 'NIM' => $nim,
// )
// );
//
// if ($this->cekKehadiran($kehadiran->STATUS)) {
// $kehadiran->STATUS = 'H';
// $kehadiran->WAKTU_ABSEN = $waktu;
// $kehadiran->save();
// echo "Berhasil";
// } else {
// echo "Gagal";
// }
//
//// $this->render('index', array(
//// 'dataProvider' => $dataProvider,
//// ));
// } else {
//// var_dump($list);
//// $this->render('admin', array(
//// 'model' => $model,
//// ));
// echo "Gagal";
// }
public function actionValidate($rfid, $nim, $datetime) {
$temp = explode(" ", $datetime);
$tanggal = $temp[0];
$waktu = $temp[1];
$sql = "SELECT * FROM m_jadwal mj INNER JOIN d_jadwal dj ON mj.`ID`=dj.`ID_JADWAL`
WHERE ((dj.RUANGAN='$rfid' AND mj.TANGGAL ='$tanggal')
AND ('$waktu' BETWEEN (SUBTIME(dj.`START_TIME`,'0:15:00')) AND (ADDTIME(dj.`END_TIME`,'0:15:00')))
AND mj.KELAS IN (SELECT KELAS FROM registrasi WHERE registrasi.`NIM`='$nim' ORDER BY SEM DESC))";
$list = Yii::app()->db->createCommand($sql)->queryAll();
if ($list) {
foreach ($list as $l) {
$kehadiran = BeritaAcaraDaftarHadir::model()->findByAttributes(
array(
'ID_DETAIL_JADWAL' => $l['ID'],
'NIM' => $nim,
)
);
if ($this->cekKehadiran($kehadiran->STATUS)) {
$kehadiran->STATUS = 'H';
$kehadiran->WAKTU_ABSEN = $waktu;
$kehadiran->save();
echo "Berhasil";
} else {
echo "Sudah Ter Absen" . "<BR>";
}
}
} else {
// var_dump($list);
// $this->render('admin', array(
// 'model' => $model,
// ));
echo "Gagal";
}
// $this->render('index', array(
// 'dataProvider' => $dataProvider,
// ));
}
protected function cekKehadiran($status) {
return ($status == 'A' ? true : false);
}
}
......@@ -38,10 +38,16 @@ $this->widget('booster.widgets.TbGridView', array(
'header' => 'Minggu',
'name' => 'WEEK',
'value' => '$data->WEEK',
'htmlOptions' => array(
'width' => '20', // menentukan ukuran column
),
),
array(
'header' => 'Tanggal',
'name' => 'TANGGAL',
'htmlOptions' => array(
'width' => '100', // menentukan ukuran column
),
'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model,
'attribute' => 'TANGGAL',
......@@ -65,16 +71,25 @@ $this->widget('booster.widgets.TbGridView', array(
array(
'header' => 'Kelas',
'name' => 'KELAS',
'htmlOptions' => array(
'width' => '100', // menentukan ukuran column
),
'value' => '$data->KELAS',
),
array(
'header' => 'Tahun Ajaran',
'name' => 'TA',
'htmlOptions' => array(
'width' => '100', // menentukan ukuran column
),
'value' => '$data->TA',
),
array(
'header' => 'Kurikulum',
'name' => 'ID_KUR',
'htmlOptions' => array(
'width' => '100', // menentukan ukuran column
),
'value' => '$data->ID_KUR',
),
array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment