15Juli2014

parent 9fed96a5
......@@ -4,67 +4,9 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/IndexBeritaAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/update.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/SearcHDaftarHadir.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/CetakBeritaAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/mJadwal/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/update.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/_view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/_search.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/_view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/LaporanBeritaAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/themes/hebo/views/layouts/tpl_navigation.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/jadwal/_form2.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dJadwal/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/_formDaftarHadir.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/MJadwalController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/BeritaAcaraKuliahController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/jadwal/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/IndexDataSearch.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/IndexAdminByMonth.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/_search.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/_view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/update.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/update.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/_search.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_search.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/update.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/BeritaAcaraDaftarHadirController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/JadwalController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/IndexCalendar.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/models/MJadwal.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/_search.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/searchBeritaAcaraDaftarHadir.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/dim/_view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_form.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/pegawai/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_formAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/createBeritaAcaraKuliah.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/mJadwal/view.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/mJadwal/_form.php</file>
</group>
</open-files>
</project-private>
<?php
class DJadwalController extends Controller
{
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout='//layouts/column2';
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$this->render('view',array(
'model'=>$this->loadModel($id),
));
}
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model=new DJadwal;
class DJadwalController extends Controller {
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout = '//layouts/column1';
/**
* @return array action filters
*/
public function filters() {
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules() {
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions' => array('index', 'view'),
'users' => array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('create', 'update'),
'users' => array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions' => array('admin', 'delete'),
'users' => array('admin'),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id) {
//Berita Acara Daftar Hadir
$daftarhadir = new BeritaAcaraDaftarHadir('search');
$daftarhadir->unsetAttributes(); // clear any default values
if (isset($_GET['BeritaAcaraDaftarHadir']))
$daftarhadir->attributes = $_GET['BeritaAcaraDaftarHadir'];
$this->render('view', array(
'model' => $this->loadModel($id),
'daftarhadir' => $daftarhadir->searchByIdJadwal($id),
));
}
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate() {
$model = new DJadwal;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['DJadwal']))
{
$model->attributes=$_POST['DJadwal'];
if($model->save())
$this->redirect(array('view','id'=>$model->ID));
}
$this->render('create',array(
'model'=>$model,
));
}
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id)
{
$model=$this->loadModel($id);
if (isset($_POST['DJadwal'])) {
$model->attributes = $_POST['DJadwal'];
if ($model->save())
$this->redirect(array('view', 'id' => $model->ID));
}
$this->render('create', array(
'model' => $model,
));
}
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id) {
$model = $this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['DJadwal']))
{
$model->attributes=$_POST['DJadwal'];
if($model->save())
$this->redirect(array('view','id'=>$model->ID));
}
$this->render('update',array(
'model'=>$model,
));
}
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function actionDelete($id)
{
if(Yii::app()->request->isPostRequest)
{
if (isset($_POST['DJadwal'])) {
$model->attributes = $_POST['DJadwal'];
if ($model->save())
$this->redirect(array('view', 'id' => $model->ID));
}
$this->render('update', array(
'model' => $model,
));
}
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function actionDelete($id) {
if (Yii::app()->request->isPostRequest) {
// we only allow deletion via POST request
$this->loadModel($id)->delete();
$this->loadModel($id)->delete();
// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
}
else
throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
}
/**
* Lists all models.
*/
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('DJadwal');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
if (!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
} else
throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
}
/**
* Lists all models.
*/
public function actionIndex() {
$dataProvider = new CActiveDataProvider('DJadwal');
$this->render('index', array(
'dataProvider' => $dataProvider,
));
}
/**
* Manages all models.
*/
public function actionAdmin() {
$model = new DJadwal('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['DJadwal']))
$model->attributes = $_GET['DJadwal'];
$this->render('admin', array(
'model' => $model,
));
}
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer the ID of the model to be loaded
*/
public function loadModel($id) {
$model = DJadwal::model()->findByPk($id);
if ($model === null)
throw new CHttpException(404, 'The requested page does not exist.');
return $model;
}
/**
* Performs the AJAX validation.
* @param CModel the model to be validated
*/
protected function performAjaxValidation($model) {
if (isset($_POST['ajax']) && $_POST['ajax'] === 'djadwal-form') {
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
/**
* Manages all models.
*/
public function actionAdmin()
{
$model=new DJadwal('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['DJadwal']))
$model->attributes=$_GET['DJadwal'];
$this->render('admin',array(
'model'=>$model,
));
}
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer the ID of the model to be loaded
*/
public function loadModel($id)
{
$model=DJadwal::model()->findByPk($id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
return $model;
}
/**
* Performs the AJAX validation.
* @param CModel the model to be validated
*/
protected function performAjaxValidation($model)
{
if(isset($_POST['ajax']) && $_POST['ajax']==='djadwal-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
}
......@@ -47,14 +47,16 @@ class MJadwalController extends Controller {
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id) {
$daftarhadir = new BeritaAcaraDaftarHadir('search');
$daftarhadir->unsetAttributes(); // clear any default values
if (isset($_GET['BeritaAcaraDaftarHadir']))
$daftarhadir->attributes = $_GET['BeritaAcaraDaftarHadir'];
$detail = new DJadwal('search');
$detail->unsetAttributes(); // clear any default values
if (isset($_GET['DJadwal']))
$daftarhadir->attributes = $_GET['DJadwal'];
$model = $this->loadModel($id);
$this->render('view', array(
'model' => $this->loadModel($id),
'daftarhadir' => $daftarhadir
'model' => $model,
'detail' => $detail->searchByIDJadwal($model->ID),
));
}
......@@ -64,64 +66,44 @@ class MJadwalController extends Controller {
*/
public function actionCreate() {
$model = new MJadwal;
$djadwal = new DJadwal;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['MJadwal'])) {
$model->attributes = $_POST['MJadwal'];
if ($model->save()) {
if (isset($_POST['DJadwal'])) {
ECHO 'BANKAI';
$model->djadwal = $_POST['DJadwal'];
}
// if ($model->saveWithRelated('djadwal')) {
// //$this->redirect('index');
// } else {
// $model->addError('djadwal', 'Error');
// }
}
$this->render('create', array(
'model' => $model,
));
}
public function actionCreate2() {
$model = new MJadwal;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['MJadwal'])) {
$model->attributes = $_POST['MJadwal'];
//$sql = "SELECT nilai.NIM AS NIM,registrasi.SEM AS SEM FROM nilai JOIN registrasi ON nilai.`NIM` = registrasi.`NIM` WHERE KODE_MK LIKE '$model->KODE_MK' AND registrasi.`TA` = '$model->TA' AND registrasi.`KELAS` LIKE '$model->KELAS'";
$sql = "SELECT DISTINCT(nilai.NIM),nilai.`SEM` FROM nilai JOIN registrasi ON nilai.`NIM` = registrasi.`NIM` WHERE KODE_MK LIKE '$model->KODE_MK' AND registrasi.`TA` = $model->TA AND registrasi.`KELAS` LIKE '$model->KELAS'";
for ($i = 0; $i < 8; $i++) {
if (!isset($_POST['formsesi'][$i])) {
$detail = new DJadwal;
$detail->KODE_MK = $_POST['DJadwal'][$i]['KODE_MK'];
$detail->RUANGAN = $_POST['DJadwal'][$i]['RUANGAN'];
$detail->AKTIFITAS = $_POST['DJadwal'][$i]['AKTIFITAS'];
$detail->SESSION = $i + 1;
$detail->ID_JADWAL = $model->ID;
$detail->START_TIME = $this->start_time($i + 1);
$detail->END_TIME = $this->end_time($i + 1);
// MAHASISWA
$sql = "SELECT DISTINCT(nilai.NIM),nilai.`SEM` FROM nilai JOIN registrasi ON nilai.`NIM` = registrasi.`NIM` WHERE KODE_MK LIKE '$detail->KODE_MK' AND registrasi.`TA` = $model->TA AND registrasi.`KELAS` LIKE '$model->KELAS'";
$list = Yii::app()->db->createCommand($sql)->queryAll();
$sql_pengajar = "SELECT * FROM pengajar WHERE TA LIKE '$model->TA' AND ID_KUR LIKE '$model->ID_KUR' AND KODE_MK LIKE '$model->KODE_MK' ORDER BY ROLE ASC";
//PENGAJAR
$sql_pengajar = "SELECT * FROM pengajar WHERE TA LIKE '$model->TA' AND ID_KUR LIKE '$model->ID_KUR' AND KODE_MK LIKE '$detail->KODE_MK' ORDER BY ROLE ASC";
$list_pengajar = Yii::app()->db->createCommand($sql_pengajar)->queryAll();
$model->PIC = $list_pengajar[0]['DOSEN_ID'];
$detail->PIC = $list_pengajar[0]['DOSEN_ID'];
if ($detail->validate()) {
$detail->save();
foreach ($list as $s) {
$daftarhadir = new BeritaAcaraDaftarHadir;
$daftarhadir->ID_KUR = $model->ID_KUR;
$daftarhadir->KODE_MK = $model->KODE_MK;
$daftarhadir->ID_DETAIL_JADWAL = $detail->ID;
$daftarhadir->NIM = $s['NIM'];
$daftarhadir->SEM = $s['SEM'];
$daftarhadir->SESSION = $model->SESSION;
$daftarhadir->WEEK = $model->WEEK;
$daftarhadir->TA = $model->TA;
$daftarhadir->KELAS = $model->KELAS;
$daftarhadir->START_TIME = $this->start_time($daftarhadir->SESSION);
$daftarhadir->END_TIME = $this->end_time($daftarhadir->SESSION);
$daftarhadir->TANGGAL = $model->TANGGAL;
if ($daftarhadir->validate()) {
$daftarhadir->save();
......@@ -131,39 +113,29 @@ class MJadwalController extends Controller {
}
$kuliah = new BeritaAcaraKuliah;
$kuliah->WEEK = $model->WEEK;
$kuliah->SESSION = $model->SESSION;
$kuliah->TA = $model->TA;
$kuliah->ID_KUR = $model->ID_KUR;
$kuliah->KODE_MK = $model->KODE_MK;
$kuliah->KELAS = $model->KELAS;
$kuliah->TANGGAL = $model->TANGGAL;
$kuliah->START_TIME = $this->start_time($model->SESSION);
$kuliah->END_TIME = $this->end_time($model->SESSION);
$kuliah->TOPIK = $model->TOPIK;
$kuliah->RUANGAN = $model->RUANGAN;
$kuliah->AKTIFITAS = $model->AKTIFITAS;
$kuliah->PIC = $model->PIC;
$kuliah->SEM = $list[0]['SEM'];
$kuliah->ID_DETAIL_JADWAL = $detail->ID;
$kuliah->TIPE_KULIAH = 1;
$kuliah->METODE = $model->METODE;
$kuliah->ALAT_BANTU = $model->ALAT_BANTU;
if ($kuliah->validate()) {
$kuliah->save();
$this->redirect(array('view', 'id' => $model->ID));
} else {
echo CHtml::errorSummary($kuliah);
}
$model->START_TIME = $kuliah->START_TIME;
$model->END_TIME = $kuliah->END_TIME;
$model->save();
$this->redirect(array('view', 'id' => $model->ID));
} else {
echo CHtml::errorSummary($detail);
}
}
}
}
} else {
echo CHtml::errorSummary($model);
}
}
$this->render('create2', array(
$this->render('create', array(
'model' => $model,
'djadwal' => $djadwal
));
}
......@@ -174,6 +146,7 @@ class MJadwalController extends Controller {
*/
public function actionUpdate($id) {
$model = $this->loadModel($id);
$djadwal = DJadwal::model()->findAllByAttributes(array('ID_JADWAL' => $id));
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
......@@ -186,6 +159,7 @@ class MJadwalController extends Controller {
$this->render('update', array(
'model' => $model,
'djadwal' => $djadwal
));
}
......@@ -323,7 +297,7 @@ class MJadwalController extends Controller {
echo Chtml::tag('option', array('value' => $value), CHtml::encode($KODE_MK), true);
}
echo Chtml::tag('option', array('value' => 'Kosong1'), CHtml::encode('Free'));
echo Chtml::tag('option', array('value' => 'Kosong'), CHtml::encode('Free'));
}
public function actionDeskripsi() {
......
......@@ -18,52 +18,48 @@
* @property Dim $nIM
* @property DJadwal $iDDETAILJADWAL
*/
class BeritaAcaraDaftarHadir extends CActiveRecord
{
class BeritaAcaraDaftarHadir extends CActiveRecord {
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return BeritaAcaraDaftarHadir the static model class
*/
public static function model($className=__CLASS__)
{
public static function model($className = __CLASS__) {
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
public function tableName() {
return 'berita_acara_daftar_hadir';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
public function rules() {
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('ID_DETAIL_JADWAL', 'required'),
array('ID_DETAIL_JADWAL', 'numerical', 'integerOnly'=>true),
array('NIM', 'length', 'max'=>8),
array('STATUS', 'length', 'max'=>7),
array('LAST_UPDATE', 'length', 'max'=>20),
array('USER_ID, WS', 'length', 'max'=>15),
array('ID_DETAIL_JADWAL', 'numerical', 'integerOnly' => true),
array('NIM', 'length', 'max' => 8),
array('STATUS', 'length', 'max' => 7),
array('LAST_UPDATE', 'length', 'max' => 20),
array('USER_ID, WS', 'length', 'max' => 15),
array('KETERANGAN, WAKTU_ABSEN', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('ID, ID_DETAIL_JADWAL, NIM, STATUS, KETERANGAN, LAST_UPDATE, USER_ID, WS, WAKTU_ABSEN', 'safe', 'on'=>'search'),
array('ID, ID_DETAIL_JADWAL, NIM, STATUS, KETERANGAN, LAST_UPDATE, USER_ID, WS, WAKTU_ABSEN', 'safe', 'on' => 'search'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
public function relations() {
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
......@@ -75,8 +71,7 @@ class BeritaAcaraDaftarHadir extends CActiveRecord
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
public function attributeLabels() {
return array(
'ID' => 'ID',
'ID_DETAIL_JADWAL' => 'Id Detail Jadwal',
......@@ -94,25 +89,49 @@ class BeritaAcaraDaftarHadir extends CActiveRecord
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
public function search() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria = new CDbCriteria;
$criteria->compare('ID',$this->ID);
$criteria->compare('ID_DETAIL_JADWAL',$this->ID_DETAIL_JADWAL);
$criteria->compare('NIM',$this->NIM,true);
$criteria->compare('STATUS',$this->STATUS,true);
$criteria->compare('KETERANGAN',$this->KETERANGAN,true);
$criteria->compare('LAST_UPDATE',$this->LAST_UPDATE,true);
$criteria->compare('USER_ID',$this->USER_ID,true);
$criteria->compare('WS',$this->WS,true);
$criteria->compare('WAKTU_ABSEN',$this->WAKTU_ABSEN,true);
$criteria->compare('ID', $this->ID);
$criteria->compare('ID_DETAIL_JADWAL', $this->ID_DETAIL_JADWAL);
$criteria->compare('NIM', $this->NIM, true);
$criteria->compare('STATUS', $this->STATUS, true);
$criteria->compare('KETERANGAN', $this->KETERANGAN, true);
$criteria->compare('LAST_UPDATE', $this->LAST_UPDATE, true);
$criteria->compare('USER_ID', $this->USER_ID, true);
$criteria->compare('WS', $this->WS, true);
$criteria->compare('WAKTU_ABSEN', $this->WAKTU_ABSEN, true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'criteria' => $criteria,
));
}
public function searchByIdJadwal($id) {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->compare('ID', $this->ID);
$criteria->compare('ID_DETAIL_JADWAL', $id, true);
$criteria->compare('NIM', $this->NIM, true);
$criteria->compare('STATUS', $this->STATUS, true);
$criteria->compare('KETERANGAN', $this->KETERANGAN, true);
$criteria->compare('LAST_UPDATE', $this->LAST_UPDATE, true);
$criteria->compare('USER_ID', $this->USER_ID, true);
$criteria->compare('WS', $this->WS, true);
$criteria->compare('WAKTU_ABSEN', $this->WAKTU_ABSEN, true);
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
'pagination' => array(
'pagesize' => 50,
),
));
}
}
......@@ -54,14 +54,14 @@ class DJadwal extends CActiveRecord {
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('ID_JADWAL, SESSION, KODE_MK, PIC, USER_ID, WS', 'required'),
array('ID_JADWAL, SESSION, KODE_MK, PIC', 'required'),
array('ID_JADWAL, SESSION', 'numerical', 'integerOnly' => true),
array('KODE_MK', 'length', 'max' => 8),
array('RUANGAN, PIC, LAST_UPDATE', 'length', 'max' => 20),
array('TOPIK, KET', 'length', 'max' => 255),
array('AKTIFITAS', 'length', 'max' => 9),
array('USER_ID, WS', 'length', 'max' => 15),
array('START_TIME, END_TIME, SUB_TOPIK, OBJEKTIF, METODE, ALAT_BANTU', 'safe'),
array('START_TIME, END_TIME, SUB_TOPIK, OBJEKTIF, METODE, ALAT_BANTU, USER_ID, WS', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('ID, ID_JADWAL, SESSION, START_TIME, END_TIME, KODE_MK, RUANGAN, TOPIK, SUB_TOPIK, OBJEKTIF, AKTIFITAS, PIC, METODE, ALAT_BANTU, KET, LAST_UPDATE, USER_ID, WS', 'safe', 'on' => 'search'),
......@@ -89,16 +89,16 @@ class DJadwal extends CActiveRecord {
return array(
'ID' => 'ID',
'ID_JADWAL' => 'Id Jadwal',
'SESSION' => 'Session',
'START_TIME' => 'Start Time',
'END_TIME' => 'End Time',
'KODE_MK' => 'Kode Mk',
'SESSION' => 'Sesi',
'START_TIME' => 'Waktu Mulai',
'END_TIME' => 'Waktu Selesai',
'KODE_MK' => 'Kode Mata Kuliah',
'RUANGAN' => 'Ruangan',
'TOPIK' => 'Topik',
'SUB_TOPIK' => 'Sub Topik',
'OBJEKTIF' => 'Objektif',
'AKTIFITAS' => 'Aktifitas',
'PIC' => 'Pic',
'PIC' => 'Pengajar',
'METODE' => 'Metode',
'ALAT_BANTU' => 'Alat Bantu',
'KET' => 'Ket',
......@@ -134,17 +134,45 @@ class DJadwal extends CActiveRecord {
$criteria->compare('ALAT_BANTU', $this->ALAT_BANTU, true);
$criteria->compare('KET', $this->KET, true);
$criteria->compare('LAST_UPDATE', $this->LAST_UPDATE, true);
$criteria->compare('USER_ID', $this->USER_ID, true);
$criteria->compare('WS', $this->WS, true);
$criteria->compare('USER_ID', $this->USER_ID);
$criteria->compare('WS', $this->WS);
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
));
}
public function beforeSave() {
$this->TANGGAL = date('Y-m-d', strtotime($this->TANGGAL));
return parent::beforeSave();
public function searchByIDJadwal($id) {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$criteria->compare('ID', $this->ID);
$criteria->compare('ID_JADWAL', $id, true);
$criteria->compare('SESSION', $this->SESSION);
$criteria->compare('START_TIME', $this->START_TIME, true);
$criteria->compare('END_TIME', $this->END_TIME, true);
$criteria->compare('KODE_MK', $this->KODE_MK, true);
$criteria->compare('RUANGAN', $this->RUANGAN, true);
$criteria->compare('TOPIK', $this->TOPIK, true);
$criteria->compare('SUB_TOPIK', $this->SUB_TOPIK, true);
$criteria->compare('OBJEKTIF', $this->OBJEKTIF, true);
$criteria->compare('AKTIFITAS', $this->AKTIFITAS, true);
$criteria->compare('PIC', $this->PIC, true);
$criteria->compare('METODE', $this->METODE, true);
$criteria->compare('ALAT_BANTU', $this->ALAT_BANTU, true);
$criteria->compare('KET', $this->KET, true);
$criteria->compare('LAST_UPDATE', $this->LAST_UPDATE, true);
$criteria->compare('USER_ID', $this->USER_ID);
$criteria->compare('WS', $this->WS);
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
'pagination' => array(
'pageSize' => 50,
),
));
}
}
......@@ -67,10 +67,10 @@ class MJadwal extends CActiveRecord {
public function attributeLabels() {
return array(
'ID' => 'ID',
'WEEK' => 'Week',
'WEEK' => 'Minggu',
'TANGGAL' => 'Tanggal',
'TA' => 'Ta',
'ID_KUR' => 'Id Kur',
'TA' => 'Tahun Ajaran',
'ID_KUR' => 'Kurikulum',
'KELAS' => 'Kelas',
);
}
......
......@@ -188,7 +188,8 @@ $baseUrl = Yii::app()->assetManager->publish($imagePath);
$sesi = $itemCSBD['SESSION'];
$modelStatus = BeritaAcaraDaftarHadir::model()->findBySql(" SELECT * FROM berita_acara_daftar_hadir badh JOIN d_jadwal dj ON badh.`ID_DETAIL_JADWAL`=dj.`ID` JOIN m_jadwal mj ON dj.`ID_JADWAL`=mj.`ID`
WHERE mj.`TA`= '$TAjaran' AND dj.`KODE_MK` = '$mata_kuliah' AND mj.`KELAS` = '$kelas' AND badh.NIM = '$modelnim' AND mj.TANGGAL = '$tggl' AND dj.SESSION = '$sesi'");
echo $modelStatus->STATUS;
echo ($modelStatus->STATUS == "A" ? "-" : "Hadir");
?>
</td>
<?php
......
<?php
$this->breadcrumbs=array(
'Djadwals'=>array('index'),
$this->breadcrumbs = array(
'Djadwals' => array('index'),
'Create',
);
$this->menu=array(
array('label'=>'List DJadwal','url'=>array('index')),
array('label'=>'Manage DJadwal','url'=>array('admin')),
$this->menu = array(
array('label' => 'List DJadwal', 'url' => array('index')),
array('label' => 'Manage DJadwal', 'url' => array('admin')),
);
?>
<h1>Create DJadwal</h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file
<?php echo $this->renderPartial('_form', array('model' => $model)); ?>
\ No newline at end of file
<?php
$this->breadcrumbs=array(
'Djadwals'=>array('index'),
$model->ID,
);
<div class="page-header">
<h1>Lihat Detail Jadwal<small> &nbsp;&nbsp;&nbsp;<?php echo "Tanggal : " . $model->idjadwal->TANGGAL . " , Kelas : " . $model->idjadwal->KELAS ?></small></h1>
</div>
$this->menu=array(
array('label'=>'List DJadwal','url'=>array('index')),
array('label'=>'Create DJadwal','url'=>array('create')),
array('label'=>'Update DJadwal','url'=>array('update','id'=>$model->ID)),
array('label'=>'Delete DJadwal','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->ID),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage DJadwal','url'=>array('admin')),
);
<?php
$this->widget('booster.widgets.TbDetailView', array(
'data' => $model,
'attributes' => array(
array(
'header' => 'Sesi',
'name' => 'Sesi',
'value' => $model->SESSION,
),
array(
'header' => 'Waktu Mulai',
'name' => 'Waktu Mulai',
'value' => $model->START_TIME,
),
array(
'header' => 'Waktu Selesai',
'name' => 'Waktu Selesai',
'value' => $model->END_TIME,
),
array(
'header' => 'Kode Mata Kuliah',
'name' => 'Kode Mata Kuliah',
'value' => $model->KODE_MK,
),
array(
'header' => 'Ruangan',
'name' => 'Ruangan',
'value' => $model->RUANGAN,
),
array(
'header' => 'Aktifitas',
'name' => 'Aktifitas',
'value' => $model->AKTIFITAS,
),
array(
'header' => 'Pengajar',
'name' => 'Pengajar',
'value' => $model->pic->NAMA,
),
),
));
?>
<h1>View DJadwal #<?php echo $model->ID; ?></h1>
<BR>
<h3 class="header">Mahasiswa Yang Mengikuti Jadwal
<span class="header-line"></span> </h3>
<?php
$this->widget('booster.widgets.TbGridView', array(
'id' => 'berita-acara-daftar-hadir-grid',
'dataProvider' => $daftarhadir,
'columns' => array(
'NIM',
array(
'header' => 'Nama',
'name' => 'Nama',
'value' => '$data->nim->NAMA'
),
array(
'header' => 'Status',
'name' => 'Status',
'type' => 'raw',
'value' => '($data->STATUS) == "A"? "Absen":"Hadir"'
),
'WAKTU_ABSEN'
),
));
?>
<?php $this->widget('booster.widgets.TbDetailView',array(
'data'=>$model,
'attributes'=>array(
'ID',
'ID_JADWAL',
'SESSION',
'START_TIME',
'END_TIME',
'KODE_MK',
'RUANGAN',
'TOPIK',
'SUB_TOPIK',
'OBJEKTIF',
'AKTIFITAS',
'PIC',
'METODE',
'ALAT_BANTU',
'KET',
'LAST_UPDATE',
'USER_ID',
'WS',
),
)); ?>
<?php
$sql_id_kur = "SELECT ID_KUR FROM kurikulum ORDER BY ID_KUR DESC LIMIT 1";
$last_id_kur = Yii::app()->db->createCommand($sql_id_kur)->queryAll();
$last = $last_id_kur[0]['ID_KUR'];
$form = $this->beginWidget('booster.widgets.TbActiveForm', array(
'id' => 'mjadwal-form',
'enableAjaxValidation' => false,
));
?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<?php
echo $form->dropDownListGroup(
......@@ -16,7 +17,7 @@ echo $form->dropDownListGroup(
),
'widgetOptions' => array(
'data' => array(
'-- Pilih Week --', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'
'Pilih Minggu', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'
),
'htmlOptions' => array(),
)
......@@ -24,7 +25,7 @@ echo $form->dropDownListGroup(
);
?>
<?php echo $form->datePickerGroup($model, 'TANGGAL', array('widgetOptions' => array('options' => array(), 'htmlOptions' => array('class' => 'span5')), 'prepend' => '<i class="glyphicon glyphicon-calendar"></i>', 'append' => 'Click on Month/Year to select a different Month/Year.')); ?>
<?php echo $form->datePickerGroup($model, 'TANGGAL', array('widgetOptions' => array('options' => array(), 'htmlOptions' => array('class' => 'span5')), 'prepend' => '<i class="glyphicon glyphicon-calendar"></i>', 'append' => 'Pilih Tanggal Jadwal.')); ?>
<?php
$ta = CHtml::listData(Registrasi::model()->findAll(
......@@ -81,11 +82,10 @@ echo $form->dropDownListGroup(
'widgetOptions' => array(
'data' => $idkur,
'htmlOptions' => array(
'prompt' => '--Select ID Kurikulum--',
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('Jadwal/matkul'),
'update' => '#' . CHtml::activeID($model, 'KODE_MK'),
'url' => CController::createUrl('MJadwal/matkul'),
'update' => '#' . CHtml::activeID($djadwal, 'KODE_MK'),
),
),
)
......@@ -93,62 +93,68 @@ echo $form->dropDownListGroup(
);
?>
<?php
echo CHtml::link('Tambah Jadwal', '#', array('id' => 'loadChildByAjax'));
?>
<BR><BR>
<?php for ($i = 0; $i < 8; $i++) { ?>
<div class="well">
<fieldset>
<legend>Sesi <?php echo $i + 1 ?></legend>
<div id="children">
<?php // echo $form->textFieldGroup($djadwal, '[' . $i . ']SESSION', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'placeholder' => 'Sesi')))); ?>
Sesi Kosong ? <input type="checkbox" name="formsesi[]" value="Yes" />
<BR>
<BR>
<?php
$index = 0;
foreach ($model->djadwal as $id => $child):
$this->renderPartial('/dJadwal/_form', array(
'model' => $child,
'index' => $id,
'display' => 'block'
));
$index++;
endforeach;
$kuliah = CHtml::listData(Kurikulum::model()->findAll(array(
'condition' => "ID_KUR = '$last'",)), 'KODE_MK', 'KODE_MK');
echo $form->dropDownListGroup($djadwal, '[' . $i . ']KODE_MK', array(
'wrapperHtmlOptions' => array(
'class' => 'col-sm-5',
),
'widgetOptions' => array(
'data' => $kuliah,
'htmlOptions' => array(
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('Jadwal/deskripsi'),
'update' => '#agan'
)
),
)
)
);
?>
</div>
<?php
$data = CHtml::listData(Ruangan ::model()->findAll(), 'ID', 'SHORT_NAME');
echo $form->dropDownListGroup($djadwal, '[' . $i . ']RUANGAN', array('wrapperHtmlOptions' => array(
'class' => 'col-sm-5',
),
'widgetOptions' => array(
'data' => $data,
'htmlOptions' => array(
),
)
)
);
?>
<?php echo $form->dropDownListGroup($djadwal, '[' . $i . ']AKTIFITAS', array('widgetOptions' => array('data' => array("Teori" => "Teori", "Praktikum" => "Praktikum", "Mandiri" => "Mandiri",), 'htmlOptions' => array('class' => 'input-large', 'placeholder' => 'Aktifitas')))); ?>
<div style="clear:both;"></div>
</fieldset>
</div>
<?php } ?>
<BR><BR>
<div class="form-actions">
<?php
$this->widget('booster.widgets.TbButton', array(
'buttonType' => 'submit',
'context' => 'primary',
'label' => $model->isNewRecord ? 'Create' : 'Save',
'label' => $model->isNewRecord ? 'Buat Baru' : 'Save',
));
?>
</div>
<?php $this->endWidget(); ?>
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerScript('loadchild', '
var _index = ' . $index . ';
$("#loadChildByAjax").click(function(e){
e.preventDefault();
var _url = "' . Yii::app()->controller->createUrl("loadChildByAjax", array("load_for" => $this->action->id)) . '&index="+_index;
$.ajax({
url: _url,
success:function(response){
$("#children").append(response);
$("#children .crow").last().animate({
opacity : 1,
left: "+50",
height: "toggle"
});
}
});
_index++;
});
', CClientScript::POS_END);
?>
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel('ID')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->ID),array('view','id'=>$data->ID)); ?>
<?php echo CHtml::link(CHtml::encode($data->ID), array('view', 'id' => $data->ID)); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('WEEK')); ?>:</b>
......
<?php
$this->breadcrumbs=array(
'Mjadwals'=>array('index'),
'Create',
);
<div class="page-header">
<h1>Buat Jadwal Baru<small> &nbsp;&nbsp;&nbsp;<?php echo "Satu Kelas Satu Hari Delapan Sesi" ?></small></h1>
</div>
$this->menu=array(
array('label'=>'List MJadwal','url'=>array('index')),
array('label'=>'Manage MJadwal','url'=>array('admin')),
);
?>
<h1>Create MJadwal</h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file
<?php echo $this->renderPartial('_form', array('model' => $model, 'djadwal' => $djadwal)); ?>
\ No newline at end of file
<?php
$this->breadcrumbs=array(
'Mjadwals',
);
<div class="page-header">
<h1>Daftar Jadwal<small> &nbsp;&nbsp;&nbsp;<?php echo "" ?></small></h1>
</div>
$this->menu=array(
array('label'=>'Create MJadwal','url'=>array('create')),
array('label'=>'Manage MJadwal','url'=>array('admin')),
);
<?php
$this->widget('booster.widgets.TbListView', array(
'dataProvider' => $dataProvider,
'itemView' => '_view',
));
?>
<h1>Mjadwals</h1>
<?php $this->widget('booster.widgets.TbListView',array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
<?php
$this->breadcrumbs=array(
'Mjadwals'=>array('index'),
$model->ID,
);
$this->menu=array(
array('label'=>'List MJadwal','url'=>array('index')),
array('label'=>'Create MJadwal','url'=>array('create')),
array('label'=>'Update MJadwal','url'=>array('update','id'=>$model->ID)),
array('label'=>'Delete MJadwal','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->ID),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage MJadwal','url'=>array('admin')),
);
?>
<?php ?>
<h1>View MJadwal #<?php echo $model->ID; ?></h1>
<div class="page-header">
<h1>Lihat Jadwal</h1>
</div>
<?php $this->widget('booster.widgets.TbDetailView',array(
'data'=>$model,
'attributes'=>array(
'ID',
'WEEK',
<?php
$this->widget('booster.widgets.TbDetailView', array(
'data' => $model,
'attributes' => array(
array(
'header' => 'Minggu',
'name' => 'Minggu',
'value' => $model->WEEK,
),
'TANGGAL',
'TA',
'ID_KUR',
array(
'header' => 'Tahun Ajaran',
'name' => 'Tahun Ajaran',
'value' => $model->TA,
),
array(
'header' => 'Kurikulum',
'name' => 'Kurikulum',
'value' => $model->ID_KUR,
),
'KELAS',
),
)); ?>
),
));
?>
<div style="text-align:right;">
<?php echo CHtml::button('Perbaharui', array('submit' => array('update', 'id' => $model->ID), 'class' => 'btn btn-small btn-warning')) ?>
</div>
<BR>
<h3 class="header">Jadwal Yang Ada
<span class="header-line"></span> </h3>
<?php
$this->widget('booster.widgets.TbGridView', array(
'id' => 'berita-acara-daftar-hadir-grid',
'dataProvider' => $detail,
'columns' => array(
'SESSION',
'START_TIME',
'END_TIME',
'KODE_MK',
'RUANGAN',
'AKTIFITAS',
array(
'header' => 'Pengajar',
'value' => '$data->pic->NAMA'
),
array(
'header' => 'Aksi',
'class' => 'booster.widgets.TbButtonColumn',
'template' => '{view} {delete}',
'viewButtonUrl' => 'Yii::app()->createUrl(\'djadwal/view\',array(\'id\'=>\'\'.$data->ID.\'\'))',
// 'updateButtonUrl' => null,
'deleteButtonUrl' => 'Yii::app()->createUrl(\'djadwal/view\',array(\'id\'=>\'\'.$data->ID.\'\'))',
// 'buttons' => array(
// 'delete' => array(
// 'click' => 'function(){return false;}'
// )
// )
),
),
));
?>
\ No newline at end of file
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