Fungsi Terbaru Lagi

parent 80881c26
...@@ -4,7 +4,23 @@ ...@@ -4,7 +4,23 @@
<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/views/beritaAcaraDaftarHadir/kehadiran.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/models/Ruangan.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/admin.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/RuanganController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/ruangan/create.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraDaftarHadir/upload.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_form.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/views/site/upload.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/adminByMonth.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/adminyDate.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_formAcaraKuliah.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/controllers/BeritaAcaraDaftarHadirController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/controllers/BeritaAcaraKuliahController.php</file>
<file>file:/C:/xampp/htdocs/Test/smartcard/protected/views/beritaAcaraKuliah/_formAcaraKuliah_1.php</file>
</group> </group>
</open-files> </open-files>
</project-private> </project-private>
...@@ -6,7 +6,7 @@ class BeritaAcaraDaftarHadirController extends Controller { ...@@ -6,7 +6,7 @@ class BeritaAcaraDaftarHadirController 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/column1';
/** /**
* @return array action filters * @return array action filters
...@@ -89,7 +89,7 @@ class BeritaAcaraDaftarHadirController extends Controller { ...@@ -89,7 +89,7 @@ class BeritaAcaraDaftarHadirController extends Controller {
'users' => array('*'), 'users' => array('*'),
), ),
array('allow', // allow authenticated user to perform 'create' and 'update' actions array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('create', 'update', 'searchBeritaAcaraDaftarHadir', 'IndexData', 'CetakLaporan', 'searchGrafikBeritaAcaraDaftarHadir', 'IndexGrafikData', 'searchGrafikDaftarHadirMahasiswa', 'IndexGrafikDataMahasiswa'), 'actions' => array('create', 'update', 'searchBeritaAcaraDaftarHadir', 'IndexData', 'CetakLaporan', 'searchGrafikBeritaAcaraDaftarHadir', 'IndexGrafikData', 'searchGrafikDaftarHadirMahasiswa', 'IndexGrafikDataMahasiswa', 'absen', 'daftarhadir'),
'users' => array('@'), 'users' => array('@'),
), ),
array('allow', // allow admin user to perform 'admin' and 'delete' actions array('allow', // allow admin user to perform 'admin' and 'delete' actions
...@@ -433,4 +433,69 @@ AND mj.KELAS IN (SELECT KELAS FROM registrasi WHERE registrasi.`NIM`='$nim' ORDE ...@@ -433,4 +433,69 @@ AND mj.KELAS IN (SELECT KELAS FROM registrasi WHERE registrasi.`NIM`='$nim' ORDE
)); ));
} }
public function actionAbsen() {
$model = new Excel;
if (isset($_POST['Excel'])) {
$model->attributes = $_POST['Excel'];
$fileName = CUploadedFile::getInstance($model, 'excelfile');
if ($model->validate()) {
$fileName->saveAs(Yii::app()->basePath . '/../absensi/' . $fileName);
$this->redirect(array('daftarhadir', 'path' => Yii::app()->basePath . '/../absensi/' . $fileName));
}
}
$this->render('upload', array('model' => $model));
}
public function actionDaftarhadir($path) {
$this->render('kehadiran', array('path' => $path));
}
public function kehadiran() {
$this->redirect(array('MJadwal/index'));
}
public function cekDaftarhadir($kehadiran) {
$tanggal = $kehadiran[3];
$waktu = $kehadiran[4];
$ruangan = Ruangan::model()->find(array('condition' => "RFID LIKE '%$kehadiran[5]%'"));
// echo $ruangan->SHORT_NAME;
$sql = "SELECT * FROM m_jadwal mj INNER JOIN d_jadwal dj ON mj.`ID`=dj.`ID_JADWAL`
WHERE ((dj.RUANGAN='$ruangan->SHORT_NAME' 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`='$kehadiran[1]' ORDER BY SEM DESC))";
// echo $sql . "<BR>";
$list = Yii::app()->db->createCommand($sql)->queryAll();
if ($list) {
foreach ($list as $l) {
$kehadiran = BeritaAcaraDaftarHadir::model()->findByAttributes(
array(
'ID_DETAIL_JADWAL' => $l['ID'],
'NIM' => $kehadiran[1],
)
);
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,
// ));
}
} }
...@@ -6,7 +6,7 @@ class BeritaAcaraKuliahController extends Controller { ...@@ -6,7 +6,7 @@ class BeritaAcaraKuliahController 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/column1';
/** /**
* @return array action filters * @return array action filters
...@@ -29,7 +29,7 @@ class BeritaAcaraKuliahController extends Controller { ...@@ -29,7 +29,7 @@ class BeritaAcaraKuliahController extends Controller {
'users' => array('*'), 'users' => array('*'),
), ),
array('allow', // allow authenticated user to perform 'create' and 'update' actions array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions' => array('create', 'update','AdminByDate','CetakBeritaAcaraKuliah','IndexData','CetakBeritaAcaraKuliahPdf'), 'actions' => array('create', 'update', 'AdminByDate', 'CetakBeritaAcaraKuliah', 'IndexData', 'CetakBeritaAcaraKuliahPdf'),
'users' => array('@'), 'users' => array('@'),
), ),
array('allow', // allow admin user to perform 'admin' and 'delete' actions array('allow', // allow admin user to perform 'admin' and 'delete' actions
...@@ -37,7 +37,7 @@ class BeritaAcaraKuliahController extends Controller { ...@@ -37,7 +37,7 @@ class BeritaAcaraKuliahController extends Controller {
'users' => array('admin'), 'users' => array('admin'),
), ),
array('deny', // deny all users array('deny', // deny all users
'users'=>array('*'), 'users' => array('*'),
), ),
); );
} }
......
<?php <?php
class RuanganController extends Controller class RuanganController 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 Ruangan;
*/
public function actionCreate()
{
$model=new Ruangan;
// 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['Ruangan'])) if (isset($_POST['Ruangan'])) {
{ $model->attributes = $_POST['Ruangan'];
$model->attributes=$_POST['Ruangan']; $model->SHORT_NAME = $model->ID;
if($model->save()) if ($model->save())
$this->redirect(array('view','id'=>$model->ID)); $this->redirect(array('index'));
} }
$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['Ruangan'])) if (isset($_POST['Ruangan'])) {
{ $model->attributes = $_POST['Ruangan'];
$model->attributes=$_POST['Ruangan']; if ($model->save())
if($model->save()) $this->redirect(array('view', 'id' => $model->ID));
$this->redirect(array('view','id'=>$model->ID)); }
}
$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() $model = new Ruangan('search');
{ $model->unsetAttributes(); // clear any default values
$dataProvider=new CActiveDataProvider('Ruangan'); if (isset($_GET['Ruangan']))
$this->render('index',array( $model->attributes = $_GET['Ruangan'];
'dataProvider'=>$dataProvider,
)); $this->render('index', array(
} 'model' => $model,
));
}
/**
* Manages all models.
*/
public function actionAdmin() {
$model = new Ruangan('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Ruangan']))
$model->attributes = $_GET['Ruangan'];
$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 = Ruangan::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'] === 'ruangan-form') {
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
/**
* Manages all models.
*/
public function actionAdmin()
{
$model=new Ruangan('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Ruangan']))
$model->attributes=$_GET['Ruangan'];
$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=Ruangan::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']==='ruangan-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
} }
...@@ -254,6 +254,7 @@ class SiteController extends Controller { ...@@ -254,6 +254,7 @@ class SiteController extends Controller {
$this->redirect(array('Jadwalxlsx', 'path' => Yii::app()->basePath . '/../jadwal/' . $fileName)); $this->redirect(array('Jadwalxlsx', 'path' => Yii::app()->basePath . '/../jadwal/' . $fileName));
} }
} }
Yii::app()->user->setFlash('success', 'Upload Daftar Perkuliahan');
$this->render('upload', array('model' => $model)); $this->render('upload', array('model' => $model));
} }
...@@ -261,4 +262,8 @@ class SiteController extends Controller { ...@@ -261,4 +262,8 @@ class SiteController extends Controller {
$this->render('excelpath', array('path' => $path)); $this->render('excelpath', array('path' => $path));
} }
public function jadwal() {
$this->redirect(array('MJadwal/index'));
}
} }
...@@ -8,7 +8,7 @@ class Excel extends CFormModel { ...@@ -8,7 +8,7 @@ class Excel extends CFormModel {
public function rules() { public function rules() {
return array( return array(
array('excelfile', 'file', 'types' => 'xlsx'), array('excelfile', 'file', 'types' => 'xlsx,xls'),
); );
} }
......
...@@ -19,52 +19,48 @@ ...@@ -19,52 +19,48 @@
* @property BeritaAcaraKuliah[] $beritaAcaraKuliahs * @property BeritaAcaraKuliah[] $beritaAcaraKuliahs
* @property Jadwal[] $jadwals * @property Jadwal[] $jadwals
*/ */
class Ruangan extends CActiveRecord class Ruangan extends CActiveRecord {
{
/** /**
* Returns the static model of the specified AR class. * Returns the static model of the specified AR class.
* @param string $className active record class name. * @param string $className active record class name.
* @return Ruangan the static model class * @return Ruangan the static model class
*/ */
public static function model($className=__CLASS__) public static function model($className = __CLASS__) {
{
return parent::model($className); return parent::model($className);
} }
/** /**
* @return string the associated database table name * @return string the associated database table name
*/ */
public function tableName() public function tableName() {
{
return 'ruangan'; return 'ruangan';
} }
/** /**
* @return array validation rules for model attributes. * @return array validation rules for model attributes.
*/ */
public function rules() public function rules() {
{
// NOTE: you should only define rules for those attributes that // NOTE: you should only define rules for those attributes that
// will receive user inputs. // will receive user inputs.
return array( return array(
array('KAPASITAS', 'numerical', 'integerOnly'=>true), array('KAPASITAS', 'numerical', 'integerOnly' => true),
array('ID, SHORT_NAME, LAST_UPDATE, RFID', 'length', 'max'=>20), array('ID, SHORT_NAME, LAST_UPDATE, RFID', 'length', 'max' => 20),
array('NAME', 'length', 'max'=>200), array('NAME', 'length', 'max' => 200),
array('STATUS', 'length', 'max'=>1), array('STATUS', 'length', 'max' => 1),
array('USER_ID', 'length', 'max'=>50), array('USER_ID', 'length', 'max' => 50),
array('WS', 'length', 'max'=>15), array('WS', 'length', 'max' => 15),
array('KET', 'safe'), array('KET', 'safe'),
// The following rule is used by search(). // The following rule is used by search().
// Please remove those attributes that should not be searched. // Please remove those attributes that should not be searched.
array('ID, SHORT_NAME, NAME, KAPASITAS, KET, STATUS, LAST_UPDATE, USER_ID, WS, RFID', 'safe', 'on'=>'search'), array('ID, SHORT_NAME, NAME, KAPASITAS, KET, STATUS, LAST_UPDATE, USER_ID, WS, RFID', 'safe', 'on' => 'search'),
); );
} }
/** /**
* @return array relational rules. * @return array relational rules.
*/ */
public function relations() public function relations() {
{
// NOTE: you may need to adjust the relation name and the related // NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below. // class name for the relations automatically generated below.
return array( return array(
...@@ -76,19 +72,18 @@ class Ruangan extends CActiveRecord ...@@ -76,19 +72,18 @@ class Ruangan extends CActiveRecord
/** /**
* @return array customized attribute labels (name=>label) * @return array customized attribute labels (name=>label)
*/ */
public function attributeLabels() public function attributeLabels() {
{
return array( return array(
'ID' => 'ID', 'ID' => 'ID Ruangan (Cth: GD521)',
'SHORT_NAME' => 'Short Name', 'SHORT_NAME' => 'Singkatan ',
'NAME' => 'Name', 'NAME' => 'Nama (Cth: Gedung 521)',
'KAPASITAS' => 'Kapasitas', 'KAPASITAS' => 'Kapasitas',
'KET' => 'Ket', 'KET' => 'Ket',
'STATUS' => 'Status', 'STATUS' => 'Status',
'LAST_UPDATE' => 'Last Update', 'LAST_UPDATE' => 'Last Update',
'USER_ID' => 'User', 'USER_ID' => 'User',
'WS' => 'Ws', 'WS' => 'Ws',
'RFID' => 'Rfid', 'RFID' => 'ID RFID',
); );
} }
...@@ -96,26 +91,26 @@ class Ruangan extends CActiveRecord ...@@ -96,26 +91,26 @@ class Ruangan extends CActiveRecord
* Retrieves a list of models based on the current search/filter conditions. * 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. * @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 // Warning: Please modify the following code to remove attributes that
// should not be searched. // should not be searched.
$criteria=new CDbCriteria; $criteria = new CDbCriteria;
$criteria->compare('ID',$this->ID,true); $criteria->compare('ID', $this->ID, true);
$criteria->compare('SHORT_NAME',$this->SHORT_NAME,true); $criteria->compare('SHORT_NAME', $this->SHORT_NAME, true);
$criteria->compare('NAME',$this->NAME,true); $criteria->compare('NAME', $this->NAME, true);
$criteria->compare('KAPASITAS',$this->KAPASITAS); $criteria->compare('KAPASITAS', $this->KAPASITAS);
$criteria->compare('KET',$this->KET,true); $criteria->compare('KET', $this->KET, true);
$criteria->compare('STATUS',$this->STATUS,true); $criteria->compare('STATUS', $this->STATUS, true);
$criteria->compare('LAST_UPDATE',$this->LAST_UPDATE,true); $criteria->compare('LAST_UPDATE', $this->LAST_UPDATE, true);
$criteria->compare('USER_ID',$this->USER_ID,true); $criteria->compare('USER_ID', $this->USER_ID, true);
$criteria->compare('WS',$this->WS,true); $criteria->compare('WS', $this->WS, true);
$criteria->compare('RFID',$this->RFID,true); $criteria->compare('RFID', $this->RFID, true);
return new CActiveDataProvider($this, array( return new CActiveDataProvider($this, array(
'criteria'=>$criteria, 'criteria' => $criteria,
)); ));
} }
} }
<?php
set_time_limit(0);
//
//$file_path = dirname(__FILE__) . '\Jadual.xlsx';
//
//$sheet_array = Yii::app()->yexcel->readActiveSheet($file_path);
//
//echo "<table>";
//
//foreach ($sheet_array as $row) {
// echo "<tr>";
// foreach ($row as $column)
// echo "<td>$column.'BOS</td>";
// echo "</tr>";
//}
//
//echo "</table>";
//or
//echo first cell of excel file
$file = $path;
Yii::import('application.vendors.phpexcel.PHPExcel', true);
$objReader = PHPExcel_IOFactory::createReader('Excel5');
//$objReader->setReadDataOnly('true');
$objPHPExcel = $objReader->load($file); //$file --> your filepath and filename
//$objWorksheet = $objPHPExcel->getActiveSheet();
//$highestRow = $objWorksheet->getHighestRow(); // e.g. 10
//$highestColumn = $objWorksheet->getHighestColumn(); // e.g 'F'
//$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); // e.g. 5
//echo '<table>' . "\n";
//for ($row = 1; $row <= $highestRow; ++$row) {
// echo '<tr>' . "\n";
// for ($col = 0; $col <= $highestColumnIndex; ++$col) {
// echo '<td>' . $objWorksheet->getCellByColumnAndRow($col, $row)->getValue() . '</td>' . "\n";
// }
// echo '</tr>' . "\n";
//}
//echo '</table>' . "\n";
$counter = 0;
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$worksheetTitle = $worksheet->getTitle();
// if ($worksheetTitle == "31B") {
// break;
// }
$highestColumn = $worksheet->getHighestColumn(); // e.g 'F'
$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
$highestRow = $worksheet->getHighestRow(); // e.g. 10
$kehadiran;
for ($i = 2; $i <= $highestRow; $i++) {
echo "<BR/>";
// echo "Tanggal : " . PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow(1, $i)->getValue(), "YYYY-MM-DD");
//echo $masterjadwal->KELAS . "<BR>";
// $masterjadwal->TANGGAL = PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow(1, $i)->getValue(), "YYYY-MM-DD");
//echo $masterjadwal->TANGGAL;
for ($col = 0; $col < $highestColumnIndex; ++$col) {
// $detail_jadwal[$col] = $worksheet->getCellByColumnAndRow($col, $j)->getValue();
if ($col == 3) {
echo PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow($col, $i)->getValue(), 'YYYY-MM-DD');
$kehadiran[$col] = PHPExcel_Style_NumberFormat::ToFormattedString($worksheet->getCellByColumnAndRow($col, $i)->getValue(), 'YYYY-MM-DD');
} else
if ($col == 4) {
echo PHPExcel_Style_NumberFormat::toFormattedString($worksheet->getCellByColumnAndRow($col, $i)->getCalculatedValue(), 'hh:mm:ss');
$kehadiran[$col] = PHPExcel_Style_NumberFormat::toFormattedString($worksheet->getCellByColumnAndRow($col, $i)->getCalculatedValue(), 'hh:mm:ss');
} else if ($col == 1 || $col == 5) {
echo $worksheet->getCellByColumnAndRow($col, $i)->getValue();
$kehadiran[$col] = $worksheet->getCellByColumnAndRow($col, $i)->getValue();
}
// echo "<BR>";
}
// $this->cekMaster($masterjadwal);
$this->cekDaftarhadir($kehadiran);
}
$this->kehadiran();
}
//$this->jadwal();
?>
<?php ?>
<div class="page-header">
<h1>Upload Data Kehadiran<small> &nbsp;&nbsp;&nbsp;<?php echo "Yg didapatkan dari RFID" ?></small></h1>
</div>
<div class="well">
<center>
<?php
$form = $this->beginWidget('booster.widgets.TbActiveForm', array(
'id' => 'mjadwal-form',
'enableAjaxValidation' => false,
'htmlOptions' => array('enctype' => 'multipart/form-data'),
));
// ...
//echo $form->labelEx($model, 'excelfile');
//echo $form->fileField($model, 'excelfile');
//echo $form->error($model, 'excelfile');
echo $form->fileFieldGroup($model, 'excelfile', array(
'wrapperHtmlOptions' => array(
'class' => 'col-sm-5',
),
)
);
// ...
$this->widget('booster.widgets.TbButton', array(
'buttonType' => 'submit',
'context' => 'primary',
'label' => 'Submit',
));
$this->endWidget();
?>
</center>
</div>
\ No newline at end of file
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<table style="border-collapse:collapse;background:white"> <table style="border-collapse:collapse;background:white">
<tr> <tr>
<td style="background:#cccccc;width:50%;"> <td style="background:#cccccc;width:5%;">
<h2>Choose the Date!</h2><hr> <h2>Choose the Date!</h2><hr>
</td> </td>
<td style="background:#e4e4e4;width:50%;"> <td style="background:#e4e4e4;width:25%;">
<center><?php $this->widget('ext.simple-calendar.SimpleCalendarWidget'); ?></center> <center><?php $this->widget('ext.simple-calendar.SimpleCalendarWidget'); ?></center>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td align="right" valign="middle" border="4"> <td style="width:75%;" align="right" valign="middle" border="4" >
<h2> <h2>
<center>Laporan Berita Acara tanggal <?php echo $wew ?></center> <center>Laporan Berita Acara tanggal <BR><?php echo $wew ?></center>
</h2> </h2>
<hr> <hr>
<?php <?php
......
...@@ -3,6 +3,18 @@ ...@@ -3,6 +3,18 @@
</div> </div>
<?php <?php
Yii::app()->clientScript->registerScript(
'myHideEffect', '$("#test").animate({opacity: 1.0}, 3000).fadeOut("slow");', CClientScript::POS_READY
);
?>
<?php if (Yii::app()->user->hasFlash('success')): ?>
<div class="alert alert-success" id="test">
<?php echo Yii::app()->user->getFlash('success'); ?>
</div>
<?php endif; ?><?php ?>
<?php
// Script // Script
Yii::app()->clientScript->registerScript('search', " Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){ $('.search-button').click(function(){
......
<?php $form=$this->beginWidget('booster.widgets.TbActiveForm',array( <?php
'id'=>'ruangan-form', $form = $this->beginWidget('booster.widgets.TbActiveForm', array(
'enableAjaxValidation'=>false, 'id' => 'ruangan-form',
)); ?> 'enableAjaxValidation' => false,
));
?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p> <?php echo $form->textFieldGroup($model, 'ID', array('class' => 'span5', 'maxlength' => 20)); ?>
<?php echo $form->errorSummary($model); ?> <?php // echo $form->textFieldGroup($model, 'SHORT_NAME', array('class' => 'span5', 'maxlength' => 20)); ?>
<?php echo $form->textFieldGroup($model,'ID',array('class'=>'span5','maxlength'=>20)); ?> <?php echo $form->textFieldGroup($model, 'NAME', array('class' => 'span5', 'maxlength' => 200)); ?>
<?php echo $form->textFieldGroup($model,'SHORT_NAME',array('class'=>'span5','maxlength'=>20)); ?> <?php // echo $form->textFieldGroup($model, 'KAPASITAS', array('class' => 'span5')); ?>
<?php echo $form->textFieldGroup($model,'NAME',array('class'=>'span5','maxlength'=>200)); ?> <?php // echo $form->textAreaGroup($model, 'KET', array('rows' => 6, 'cols' => 50, 'class' => 'span8')); ?>
<?php echo $form->textFieldGroup($model,'KAPASITAS',array('class'=>'span5')); ?> <?php // echo $form->textFieldGroup($model, 'STATUS', array('class' => 'span5', 'maxlength' => 1)); ?>
<?php echo $form->textAreaGroup($model,'KET',array('rows'=>6, 'cols'=>50, 'class'=>'span8')); ?> <?php // echo $form->textFieldGroup($model, 'LAST_UPDATE', array('class' => 'span5', 'maxlength' => 20)); ?>
<?php echo $form->textFieldGroup($model,'STATUS',array('class'=>'span5','maxlength'=>1)); ?> <?php // echo $form->textFieldGroup($model, 'USER_ID', array('class' => 'span5', 'maxlength' => 50)); ?>
<?php echo $form->textFieldGroup($model,'LAST_UPDATE',array('class'=>'span5','maxlength'=>20)); ?> <?php // echo $form->textFieldGroup($model, 'WS', array('class' => 'span5', 'maxlength' => 15)); ?>
<?php echo $form->textFieldGroup($model,'USER_ID',array('class'=>'span5','maxlength'=>50)); ?> <?php echo $form->textFieldGroup($model, 'RFID', array('class' => 'span5', 'maxlength' => 20)); ?>
<?php echo $form->textFieldGroup($model,'WS',array('class'=>'span5','maxlength'=>15)); ?>
<?php echo $form->textFieldGroup($model,'RFID',array('class'=>'span5','maxlength'=>20)); ?>
<div class="form-actions"> <div class="form-actions">
<?php $this->widget('booster.widgets.TbButton', array( <?php
'buttonType'=>'submit', $this->widget('booster.widgets.TbButton', array(
'context'=>'primary', 'buttonType' => 'submit',
'label'=>$model->isNewRecord ? 'Create' : 'Save', 'context' => 'primary',
)); ?> 'label' => $model->isNewRecord ? 'Create' : 'Save',
));
?>
</div> </div>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
<?php <?php
$this->breadcrumbs=array( $this->breadcrumbs = array(
'Ruangans'=>array('index'), 'Ruangans' => array('index'),
'Manage', 'Manage',
); );
$this->menu=array( $this->menu = array(
array('label'=>'List Ruangan','url'=>array('index')), array('label' => 'List Ruangan', 'url' => array('index')),
array('label'=>'Create Ruangan','url'=>array('create')), array('label' => 'Create Ruangan', 'url' => array('create')),
); );
Yii::app()->clientScript->registerScript('search', " Yii::app()->clientScript->registerScript('search', "
...@@ -31,18 +31,21 @@ return false; ...@@ -31,18 +31,21 @@ return false;
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p> </p>
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn')); ?> <?php echo CHtml::link('Advanced Search', '#', array('class' => 'search-button btn')); ?>
<div class="search-form" style="display:none"> <div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array( <?php
'model'=>$model, $this->renderPartial('_search', array(
)); ?> 'model' => $model,
));
?>
</div><!-- search-form --> </div><!-- search-form -->
<?php $this->widget('booster.widgets.TbGridView',array( <?php
'id'=>'ruangan-grid', $this->widget('booster.widgets.TbGridView', array(
'dataProvider'=>$model->search(), 'id' => 'ruangan-grid',
'filter'=>$model, 'dataProvider' => $model->search(),
'columns'=>array( 'filter' => $model,
'columns' => array(
'ID', 'ID',
'SHORT_NAME', 'SHORT_NAME',
'NAME', 'NAME',
...@@ -55,8 +58,9 @@ return false; ...@@ -55,8 +58,9 @@ return false;
'WS', 'WS',
'RFID', 'RFID',
*/ */
array( array(
'class'=>'booster.widgets.TbButtonColumn', 'class' => 'booster.widgets.TbButtonColumn',
), ),
), ),
)); ?> ));
?>
<?php <?php
$this->breadcrumbs=array(
'Ruangans'=>array('index'),
'Create',
);
$this->menu=array(
array('label'=>'List Ruangan','url'=>array('index')),
array('label'=>'Manage Ruangan','url'=>array('admin')),
);
?> ?>
<h1>Create Ruangan</h1> <h1>Tambah Ruangan</h1>
<BR>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> <?php echo $this->renderPartial('_form', array('model' => $model)); ?>
\ No newline at end of file \ No newline at end of file
<?php <?php
$this->breadcrumbs=array( Yii::app()->clientScript->registerScript('search', "
'Ruangans', $('.search-button').click(function(){
); $('.search-form').toggle();
return false;
$this->menu=array( });
array('label'=>'Create Ruangan','url'=>array('create')), $('.search-form form').submit(function(){
array('label'=>'Manage Ruangan','url'=>array('admin')), $.fn.yiiGridView.update('ruangan-grid', {
); data: $(this).serialize()
});
return false;
});
");
?> ?>
<h1>Ruangans</h1> <h1>Daftar Ruangan</h1>
<?php $this->widget('booster.widgets.TbListView',array( <?php
'dataProvider'=>$dataProvider, $this->widget('booster.widgets.TbGridView', array(
'itemView'=>'_view', 'id' => 'ruangan-grid',
)); ?> 'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
'ID',
'SHORT_NAME',
'NAME',
'KAPASITAS',
'KET',
'STATUS',
/*
'LAST_UPDATE',
'USER_ID',
'WS',
'RFID',
*/
array(
'class' => 'booster.widgets.TbButtonColumn',
),
),
));
?>
...@@ -43,9 +43,9 @@ $counter = 0; ...@@ -43,9 +43,9 @@ $counter = 0;
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$worksheetTitle = $worksheet->getTitle(); $worksheetTitle = $worksheet->getTitle();
if ($worksheetTitle == "33MI") { // if ($worksheetTitle == "31B") {
break; // break;
} // }
// //
// //
// //
...@@ -138,9 +138,9 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { ...@@ -138,9 +138,9 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
} }
} }
} }
$this->jadwal();
?> ?>
<?php <?php ?>
?>
<?php
echo "Berhasil Membuat Jadwal";
?>
\ No newline at end of file
<div class="page-header">
<h1>Upload Jadwal Perkuliahan<small> &nbsp;&nbsp;&nbsp;<?php echo "Untuk 1 Minggu" ?></small></h1>
</div>
<?php
Yii::app()->clientScript->registerScript(
'myHideEffect', '$("#test").animate({opacity: 1.0}, 3000).fadeOut("slow");', CClientScript::POS_READY
);
?>
<?php if (Yii::app()->user->hasFlash('success')): ?>
<div class="alert alert-success" id="test">
<?php echo Yii::app()->user->getFlash('success'); ?>
</div>
<?php endif; ?><?php ?>
<div class="well"> <div class="well">
<center> <center>
<?php <?php
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
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' => 'Upload Jadwal', 'url' => array('/site/upload')),
array('label' => 'Daftar Jadwal', 'url' => array('MJadwal/index')), array('label' => 'Daftar Jadwal', 'url' => array('MJadwal/index')),
array('label' => 'Upload Daftar Kehadiran', 'url' => array('BeritaAcaraDaftarHadir/absen')),
)), )),
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"),
'items' => array( 'items' => array(
......
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