$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 {
*/
publicfunctionactionCreate(){
$model=newMJadwal;
$djadwal=newDJadwal;
// 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,
));
}
publicfunctionactionCreate2(){
$model=newMJadwal;
// 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'";
$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'";
$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";
$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'");
array('label'=>'Delete DJadwal','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->ID),'confirm'=>'Are you sure you want to delete this item?')),
<?phpecho$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.'));?>
<?phpecho$form->datePickerGroup($model,'TANGGAL',array('widgetOptions'=>array('options'=>array(),'htmlOptions'=>array('class'=>'span5')),'prepend'=>'<i class="glyphicon glyphicon-calendar"></i>','append'=>'Pilih Tanggal Jadwal.'));?>
array('label'=>'Delete MJadwal','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->ID),'confirm'=>'Are you sure you want to delete this item?')),