Update Baru

parent 02ff3c17
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
<<<<<<< HEAD
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <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"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/SiteController.php</file> <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/views/site/excelpath.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/DJadwalController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/DimController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/site/index.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/site/excel.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/BeritaAcaraDaftarHadirController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/KelasController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/BeritaAcaraKuliahController.php</file>
</group> </group>
</open-files> </open-files>
=======
>>>>>>> b42a32f429c96e698c247f20cdba2c19e6013c5c
</project-private> </project-private>
<?php <?php
class DimController extends Controller class DimController extends Controller {
{
/** /**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'. * using two-column layout. See 'protected/views/layouts/column2.php'.
*/ */
public $layout='//layouts/column2'; public $layout = '//layouts/column2';
/** /**
* @return array action filters * @return array action filters
*/ */
public function filters() public function filters() {
{ return array(
return array( 'accessControl', // perform access control for CRUD operations
'accessControl', // perform access control for CRUD operations );
); }
}
/**
/** * Specifies the access control rules.
* Specifies the access control rules. * This method is used by the 'accessControl' filter.
* This method is used by the 'accessControl' filter. * @return array access control rules
* @return array access control rules */
*/ public function accessRules() {
public function accessRules() return array(
{ array('allow', // allow all users to perform 'index' and 'view' actions
return array( 'actions' => array('index', 'view'),
array('allow', // allow all users to perform 'index' and 'view' actions 'users' => array('*'),
'actions'=>array('index','view'), ),
'users'=>array('*'), array('allow', // allow authenticated user to perform 'create' and 'update' actions
), 'actions' => array('create', 'update'),
array('allow', // allow authenticated user to perform 'create' and 'update' actions 'users' => array('@'),
'actions'=>array('create','update'), ),
'users'=>array('@'), array('allow', // allow admin user to perform 'admin' and 'delete' actions
), 'actions' => array('admin', 'delete'),
array('allow', // allow admin user to perform 'admin' and 'delete' actions 'users' => array('admin'),
'actions'=>array('admin','delete'), ),
'users'=>array('admin'), array('deny', // deny all users
), 'users' => array('*'),
array('deny', // deny all users ),
'users'=>array('*'), );
), }
);
} /**
* Displays a particular model.
/** * @param integer $id the ID of the model to be displayed
* Displays a particular model. */
* @param integer $id the ID of the model to be displayed public function actionView($id) {
*/ $this->render('view', array(
public function actionView($id) 'model' => $this->loadModel($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.
/** */
* Creates a new model. public function actionCreate() {
* If creation is successful, the browser will be redirected to the 'view' page. $model = new Dim;
*/
public function actionCreate()
{
$model=new Dim;
// Uncomment the following line if AJAX validation is needed // Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model); // $this->performAjaxValidation($model);
if(isset($_POST['Dim'])) if (isset($_POST['Dim'])) {
{ $model->attributes = $_POST['Dim'];
$model->attributes=$_POST['Dim']; if ($model->save())
if($model->save()) $this->redirect(array('view', 'id' => $model->NIM));
$this->redirect(array('view','id'=>$model->NIM)); }
}
$this->render('create', array(
$this->render('create',array( 'model' => $model,
'model'=>$model, ));
)); }
}
/**
/** * Updates a particular model.
* Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page.
* If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated
* @param integer $id the ID of the model to be updated */
*/ public function actionUpdate($id) {
public function actionUpdate($id) $model = $this->loadModel($id);
{
$model=$this->loadModel($id);
// Uncomment the following line if AJAX validation is needed // Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model); // $this->performAjaxValidation($model);
if(isset($_POST['Dim'])) if (isset($_POST['Dim'])) {
{ $model->attributes = $_POST['Dim'];
$model->attributes=$_POST['Dim']; if ($model->save())
if($model->save()) $this->redirect(array('view', 'id' => $model->NIM));
$this->redirect(array('view','id'=>$model->NIM)); }
}
$this->render('update', array(
$this->render('update',array( 'model' => $model,
'model'=>$model, ));
)); }
}
/**
/** * Deletes a particular model.
* Deletes a particular model. * If deletion is successful, the browser will be redirected to the 'admin' page.
* If deletion is successful, the browser will be redirected to the 'admin' page. * @param integer $id the ID of the model to be deleted
* @param integer $id the ID of the model to be deleted */
*/ public function actionDelete($id) {
public function actionDelete($id) if (Yii::app()->request->isPostRequest) {
{
if(Yii::app()->request->isPostRequest)
{
// we only allow deletion via POST request // 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 AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax'])) if (!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
} } else
else throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); }
}
/**
/** * Lists all models.
* Lists all models. */
*/ public function actionIndex() {
public function actionIndex() $dataProvider = new CActiveDataProvider('Dim');
{ $this->render('index', array(
$dataProvider=new CActiveDataProvider('Dim'); 'dataProvider' => $dataProvider,
$this->render('index',array( ));
'dataProvider'=>$dataProvider, }
));
} /**
* Manages all models.
*/
public function actionAdmin() {
$model = new Dim('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Dim']))
$model->attributes = $_GET['Dim'];
$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 = Dim::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'] === 'dim-form') {
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
/**
* Manages all models.
*/
public function actionAdmin()
{
$model=new Dim('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Dim']))
$model->attributes=$_GET['Dim'];
$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=Dim::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']==='dim-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
} }
...@@ -140,7 +140,7 @@ class SiteController extends Controller { ...@@ -140,7 +140,7 @@ class SiteController extends Controller {
//PENGAJAR //PENGAJAR
$sql_pengajar = "SELECT * FROM pengajar WHERE TA LIKE '$masterjadwal->TA' AND ID_KUR LIKE '$masterjadwal->ID_KUR' AND KODE_MK LIKE '$detail->KODE_MK' ORDER BY ROLE ASC"; $sql_pengajar = "SELECT * FROM pengajar WHERE TA LIKE '$masterjadwal->TA' AND ID_KUR LIKE '$masterjadwal->ID_KUR' AND KODE_MK LIKE '$detail->KODE_MK' ORDER BY ROLE ASC";
$list_pengajar = Yii::app()->db->createCommand($sql_pengajar)->queryAll(); $list_pengajar = Yii::app()->db->createCommand($sql_pengajar)->queryAll();
echo "<BR>" . $sql_pengajar . "<BR>"; // echo "<BR>" . $sql_pengajar . "<BR>";
$detail->PIC = $list_pengajar[0]['DOSEN_ID']; $detail->PIC = $list_pengajar[0]['DOSEN_ID'];
if ($detail->validate()) { if ($detail->validate()) {
$detail->save(); $detail->save();
......
...@@ -122,9 +122,9 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { ...@@ -122,9 +122,9 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$masterjadwal->WEEK = $worksheet->getCellByColumnAndRow(1, 1)->getValue(); $masterjadwal->WEEK = $worksheet->getCellByColumnAndRow(1, 1)->getValue();
$masterjadwal->TA = $worksheet->getCellByColumnAndRow(1, 2)->getValue(); $masterjadwal->TA = $worksheet->getCellByColumnAndRow(1, 2)->getValue();
$masterjadwal->ID_KUR = $worksheet->getCellByColumnAndRow(1, 3)->getValue(); $masterjadwal->ID_KUR = $worksheet->getCellByColumnAndRow(1, 3)->getValue();
echo $masterjadwal->KELAS . "<BR>"; //echo $masterjadwal->KELAS . "<BR>";
$masterjadwal->TANGGAL = PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow(1, $i)->getValue(), "YYYY-MM-DD"); $masterjadwal->TANGGAL = PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow(1, $i)->getValue(), "YYYY-MM-DD");
echo $masterjadwal->TANGGAL; //echo $masterjadwal->TANGGAL;
$masterjadwal->save(); $masterjadwal->save();
for ($j = $i + 2; $j < $i + 10; $j++) { for ($j = $i + 2; $j < $i + 10; $j++) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
array('label' => 'Manage Jadwal <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Manage Jadwal disini!"), array('label' => 'Manage Jadwal <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Manage Jadwal disini!"),
'items' => array( 'items' => array(
array('label' => 'Create Jadwal', 'url' => array('/MJadwal/create')), array('label' => 'Create Jadwal', 'url' => array('/MJadwal/create')),
array('label' => 'Upload Jadwal', 'url' => array('/site/upload')),
array('label' => 'Daftar Jadwal', 'url' => array('MJadwal/index')), array('label' => 'Daftar Jadwal', 'url' => array('MJadwal/index')),
)), )),
array('label' => 'Laporan <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Absensi"), array('label' => 'Laporan <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Absensi"),
...@@ -36,12 +37,12 @@ ...@@ -36,12 +37,12 @@
// array('label'=>'<span class="style" style="background-color:#c80681;"></span> Purple', 'url'=>"javascript:chooseStyle('style3', 60)"), // array('label'=>'<span class="style" style="background-color:#c80681;"></span> Purple', 'url'=>"javascript:chooseStyle('style3', 60)"),
// //
// )), // )),
array('label' => 'Grafik Daftar Kehadiran <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Grafik Kehadiran"), array('label' => 'Grafik Daftar Kehadiran <span class="caret"></span>', 'url' => '#', 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Grafik Kehadiran"),
'items' => array( 'items' => array(
array('label' => 'Grafik Daftar Kehadiran', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikBeritaAcaraDaftarHadir')), array('label' => 'Grafik Daftar Kehadiran', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikBeritaAcaraDaftarHadir')),
array('label' => 'Search by NIM', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikDaftarHadirMahasiswa')), array('label' => 'Search by NIM', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikDaftarHadirMahasiswa')),
//array('label' => 'Daftar Hadir', 'url' => array('BeritaAcaraDaftarHadir/searchBeritaAcaraDaftarHadir')), //array('label' => 'Daftar Hadir', 'url' => array('BeritaAcaraDaftarHadir/searchBeritaAcaraDaftarHadir')),
)), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest, 'linkOptions' => array("data-description" => "member area")), )), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest, 'linkOptions' => array("data-description" => "member area")),
array('label' => 'Logout (' . Yii::app()->user->name . ')<span class="caret"></span>', 'url' => '#', 'itemOptions', 'visible' => !Yii::app()->user->isGuest, 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Change Password & Logout"), array('label' => 'Logout (' . Yii::app()->user->name . ')<span class="caret"></span>', 'url' => '#', 'itemOptions', 'visible' => !Yii::app()->user->isGuest, 'itemOptions' => array('class' => 'dropdown', 'tabindex' => "-1"), 'linkOptions' => array('class' => 'dropdown-toggle', 'data-toggle' => "dropdown", "data-description" => "Change Password & Logout"),
'items' => array( 'items' => array(
array('label' => 'Change Password', 'url' => array('/Account/Update2', 'id' => Yii::app()->user->id)), array('label' => 'Change Password', 'url' => array('/Account/Update2', 'id' => Yii::app()->user->id)),
......
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