Update Baru

parent 02ff3c17
<?xml version="1.0" encoding="UTF-8"?>
<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"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<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>
<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>
</open-files>
=======
>>>>>>> b42a32f429c96e698c247f20cdba2c19e6013c5c
</project-private>
<?php
class DimController 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 Dim;
class DimController 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 Dim;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Dim']))
{
$model->attributes=$_POST['Dim'];
if($model->save())
$this->redirect(array('view','id'=>$model->NIM));
}
$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['Dim'])) {
$model->attributes = $_POST['Dim'];
if ($model->save())
$this->redirect(array('view', 'id' => $model->NIM));
}
$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['Dim']))
{
$model->attributes=$_POST['Dim'];
if($model->save())
$this->redirect(array('view','id'=>$model->NIM));
}
$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['Dim'])) {
$model->attributes = $_POST['Dim'];
if ($model->save())
$this->redirect(array('view', 'id' => $model->NIM));
}
$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('Dim');
$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('Dim');
$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 {
//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";
$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'];
if ($detail->validate()) {
$detail->save();
......
......@@ -122,9 +122,9 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$masterjadwal->WEEK = $worksheet->getCellByColumnAndRow(1, 1)->getValue();
$masterjadwal->TA = $worksheet->getCellByColumnAndRow(1, 2)->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");
echo $masterjadwal->TANGGAL;
//echo $masterjadwal->TANGGAL;
$masterjadwal->save();
for ($j = $i + 2; $j < $i + 10; $j++) {
......
......@@ -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!"),
'items' => array(
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' => '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 @@
// 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(
array('label' => 'Grafik Daftar Kehadiran', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikBeritaAcaraDaftarHadir')),
array('label' => 'Search by NIM', 'url' => array('BeritaAcaraDaftarHadir/searchGrafikDaftarHadirMahasiswa')),
//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' => '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' => '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(
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