Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SmartCard
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
itd-x
SmartCard
Commits
eaf34284
Commit
eaf34284
authored
Aug 08, 2014
by
Pintor Jonathan Silitonga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Baru
parent
6705458d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
44 deletions
+66
-44
private.xml
nbproject/private/private.xml
+3
-0
BeritaAcaraDaftarHadirController.php
protected/controllers/BeritaAcaraDaftarHadirController.php
+48
-44
index.php
protected/views/mJadwal/index.php
+15
-0
No files found.
nbproject/private/private.xml
View file @
eaf34284
...
...
@@ -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>
...
...
protected/controllers/BeritaAcaraDaftarHadirController.php
View file @
eaf34284
...
...
@@ -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
);
}
}
protected/views/mJadwal/index.php
View file @
eaf34284
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment