Fungsi Terbaru Lagi

parent 80881c26
......@@ -4,7 +4,23 @@
<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/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/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>
</open-files>
</project-private>
......@@ -6,7 +6,7 @@ class BeritaAcaraDaftarHadirController 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';
public $layout = '//layouts/column1';
/**
* @return array action filters
......@@ -89,7 +89,7 @@ class BeritaAcaraDaftarHadirController extends Controller {
'users' => array('*'),
),
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('@'),
),
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
));
}
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 {
* @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';
public $layout = '//layouts/column1';
/**
* @return array action filters
......@@ -29,16 +29,16 @@ class BeritaAcaraKuliahController extends Controller {
'users' => array('*'),
),
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('@'),
),
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('*'),
),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
......
<?php
class RuanganController 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 Ruangan;
class RuanganController 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 Ruangan;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Ruangan']))
{
$model->attributes=$_POST['Ruangan'];
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['Ruangan'])) {
$model->attributes = $_POST['Ruangan'];
$model->SHORT_NAME = $model->ID;
if ($model->save())
$this->redirect(array('index'));
}
$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['Ruangan']))
{
$model->attributes=$_POST['Ruangan'];
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['Ruangan'])) {
$model->attributes = $_POST['Ruangan'];
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('Ruangan');
$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() {
$model = new Ruangan('search');
$model->unsetAttributes(); // clear any default values
if (isset($_GET['Ruangan']))
$model->attributes = $_GET['Ruangan'];
$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 {
$this->redirect(array('Jadwalxlsx', 'path' => Yii::app()->basePath . '/../jadwal/' . $fileName));
}
}
Yii::app()->user->setFlash('success', 'Upload Daftar Perkuliahan');
$this->render('upload', array('model' => $model));
}
......@@ -261,4 +262,8 @@ class SiteController extends Controller {
$this->render('excelpath', array('path' => $path));
}
public function jadwal() {
$this->redirect(array('MJadwal/index'));
}
}
......@@ -8,7 +8,7 @@ class Excel extends CFormModel {
public function rules() {
return array(
array('excelfile', 'file', 'types' => 'xlsx'),
array('excelfile', 'file', 'types' => 'xlsx,xls'),
);
}
......
......@@ -19,103 +19,98 @@
* @property BeritaAcaraKuliah[] $beritaAcaraKuliahs
* @property Jadwal[] $jadwals
*/
class Ruangan extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Ruangan the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
class Ruangan extends CActiveRecord {
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'ruangan';
}
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Ruangan the static model class
*/
public static function model($className = __CLASS__) {
return parent::model($className);
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('KAPASITAS', 'numerical', 'integerOnly'=>true),
array('ID, SHORT_NAME, LAST_UPDATE, RFID', 'length', 'max'=>20),
array('NAME', 'length', 'max'=>200),
array('STATUS', 'length', 'max'=>1),
array('USER_ID', 'length', 'max'=>50),
array('WS', 'length', 'max'=>15),
array('KET', 'safe'),
// The following rule is used by search().
// 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'),
);
}
/**
* @return string the associated database table name
*/
public function tableName() {
return 'ruangan';
}
/**
* @return array relational rules.
*/
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(
'beritaAcaraKuliahs' => array(self::HAS_MANY, 'BeritaAcaraKuliah', 'RUANGAN'),
'jadwals' => array(self::HAS_MANY, 'Jadwal', 'RUANGAN'),
);
}
/**
* @return array validation rules for model attributes.
*/
public function rules() {
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('KAPASITAS', 'numerical', 'integerOnly' => true),
array('ID, SHORT_NAME, LAST_UPDATE, RFID', 'length', 'max' => 20),
array('NAME', 'length', 'max' => 200),
array('STATUS', 'length', 'max' => 1),
array('USER_ID', 'length', 'max' => 50),
array('WS', 'length', 'max' => 15),
array('KET', 'safe'),
// The following rule is used by search().
// 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'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'ID' => 'ID',
'SHORT_NAME' => 'Short Name',
'NAME' => 'Name',
'KAPASITAS' => 'Kapasitas',
'KET' => 'Ket',
'STATUS' => 'Status',
'LAST_UPDATE' => 'Last Update',
'USER_ID' => 'User',
'WS' => 'Ws',
'RFID' => 'Rfid',
);
}
/**
* @return array relational rules.
*/
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(
'beritaAcaraKuliahs' => array(self::HAS_MANY, 'BeritaAcaraKuliah', 'RUANGAN'),
'jadwals' => array(self::HAS_MANY, 'Jadwal', 'RUANGAN'),
);
}
/**
* 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()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels() {
return array(
'ID' => 'ID Ruangan (Cth: GD521)',
'SHORT_NAME' => 'Singkatan ',
'NAME' => 'Nama (Cth: Gedung 521)',
'KAPASITAS' => 'Kapasitas',
'KET' => 'Ket',
'STATUS' => 'Status',
'LAST_UPDATE' => 'Last Update',
'USER_ID' => 'User',
'WS' => 'Ws',
'RFID' => 'ID RFID',
);
}
$criteria=new CDbCriteria;
/**
* 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() {
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria->compare('ID',$this->ID,true);
$criteria->compare('SHORT_NAME',$this->SHORT_NAME,true);
$criteria->compare('NAME',$this->NAME,true);
$criteria->compare('KAPASITAS',$this->KAPASITAS);
$criteria->compare('KET',$this->KET,true);
$criteria->compare('STATUS',$this->STATUS,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('RFID',$this->RFID,true);
$criteria = new CDbCriteria;
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
}
\ No newline at end of file
$criteria->compare('ID', $this->ID, true);
$criteria->compare('SHORT_NAME', $this->SHORT_NAME, true);
$criteria->compare('NAME', $this->NAME, true);
$criteria->compare('KAPASITAS', $this->KAPASITAS);
$criteria->compare('KET', $this->KET, true);
$criteria->compare('STATUS', $this->STATUS, 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('RFID', $this->RFID, true);
return new CActiveDataProvider($this, array(
'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 @@
<table style="border-collapse:collapse;background:white">
<tr>
<td style="background:#cccccc;width:50%;">
<td style="background:#cccccc;width:5%;">
<h2>Choose the Date!</h2><hr>
</td>
<td style="background:#e4e4e4;width:50%;">
<td style="background:#e4e4e4;width:25%;">
<center><?php $this->widget('ext.simple-calendar.SimpleCalendarWidget'); ?></center>
</td>
<td>&nbsp;</td>
<td align="right" valign="middle" border="4">
<td style="width:75%;" align="right" valign="middle" border="4" >
<h2>
<center>Laporan Berita Acara tanggal <?php echo $wew ?></center>
<center>Laporan Berita Acara tanggal <BR><?php echo $wew ?></center>
</h2>
<hr>
<?php
......
......@@ -3,6 +3,18 @@
</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 ?>
<?php
// Script
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
......
<?php $form=$this->beginWidget('booster.widgets.TbActiveForm',array(
'id'=>'ruangan-form',
'enableAjaxValidation'=>false,
)); ?>
<?php
$form = $this->beginWidget('booster.widgets.TbActiveForm', array(
'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,'WS',array('class'=>'span5','maxlength'=>15)); ?>
<?php echo $form->textFieldGroup($model,'RFID',array('class'=>'span5','maxlength'=>20)); ?>
<?php echo $form->textFieldGroup($model, 'RFID', array('class' => 'span5', 'maxlength' => 20)); ?>
<div class="form-actions">
<?php $this->widget('booster.widgets.TbButton', array(
'buttonType'=>'submit',
'context'=>'primary',
'label'=>$model->isNewRecord ? 'Create' : 'Save',
)); ?>
<?php
$this->widget('booster.widgets.TbButton', array(
'buttonType' => 'submit',
'context' => 'primary',
'label' => $model->isNewRecord ? 'Create' : 'Save',
));
?>
</div>
<?php $this->endWidget(); ?>
<?php
$this->breadcrumbs=array(
'Ruangans'=>array('index'),
'Manage',
$this->breadcrumbs = array(
'Ruangans' => array('index'),
'Manage',
);
$this->menu=array(
array('label'=>'List Ruangan','url'=>array('index')),
array('label'=>'Create Ruangan','url'=>array('create')),
$this->menu = array(
array('label' => 'List Ruangan', 'url' => array('index')),
array('label' => 'Create Ruangan', 'url' => array('create')),
);
Yii::app()->clientScript->registerScript('search', "
......@@ -26,37 +26,41 @@ return false;
<h1>Manage Ruangans</h1>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>
&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>
&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</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">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
<?php
$this->renderPartial('_search', array(
'model' => $model,
));
?>
</div><!-- search-form -->
<?php $this->widget('booster.widgets.TbGridView',array(
'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',
),
),
)); ?>
<?php
$this->widget('booster.widgets.TbGridView', array(
'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',
),
),
));
?>
<?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>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file
<h1>Tambah Ruangan</h1>
<BR>
<?php echo $this->renderPartial('_form', array('model' => $model)); ?>
\ No newline at end of file
<?php
$this->breadcrumbs=array(
'Ruangans',
);
$this->menu=array(
array('label'=>'Create Ruangan','url'=>array('create')),
array('label'=>'Manage Ruangan','url'=>array('admin')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('ruangan-grid', {
data: $(this).serialize()
});
return false;
});
");
?>
<h1>Ruangans</h1>
<h1>Daftar Ruangan</h1>
<?php $this->widget('booster.widgets.TbListView',array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
<?php
$this->widget('booster.widgets.TbGridView', array(
'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;
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$worksheetTitle = $worksheet->getTitle();
if ($worksheetTitle == "33MI") {
break;
}
// if ($worksheetTitle == "31B") {
// break;
// }
//
//
//
......@@ -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">
<center>
<?php
......
......@@ -22,6 +22,7 @@
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' => '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"),
'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