Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Machine::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'TerminalID', $this->TerminalID])->andFilterWhere(['like', 'MESIN_NM', $this->MESIN_NM])->andFilterWhere(['like', 'MESIN_SN', $this->MESIN_SN])->andFilterWhere(['like', 'CAB_ID', $this->CAB_ID]);
     return $dataProvider;
 }
Example #2
0
 * === REKAP =========================
 * Key-FIND : AttDinamik-Clalender
 * @author ptrnov [piter@lukison.com]
 * @since 1.2
 * ===================================
 */
$attDinamik = [];
$hdrLabel1 = [];
//$hdrLabel2=[];
$getHeaderLabelWrap = [];
/*
 * Terminal ID | Mashine
 * Colomn 1
 */
$attDinamik[] = ['attribute' => 'TerminalID', 'label' => 'Source Machine', 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => $aryMachine, 'filterOptions' => ['style' => 'background-color:rgba(240, 195, 59, 0.4); align:center;', 'vAlign' => 'middle'], 'value' => function ($model) {
    $nmMachine = Machine::find()->where(['TerminalID' => $model['TerminalID']])->one();
    return $nmMachine != '' ? $nmMachine['MESIN_NM'] : 'Unknown';
}, 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '20px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(240, 195, 59, 0.4)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '20px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '20px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'text-decoration' => 'underline', 'font-weight' => 'bold', 'border-left-color' => 'transparant', 'border-left' => '0px']]];
$hdrLabel1[] = ['content' => 'Employee Data', 'options' => ['noWrap' => true, 'colspan' => 2, 'class' => 'text-center info', 'style' => ['text-align' => 'center', 'width' => '20px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']]];
/*
 * Employe name
 * Colomn 2
 */
$attDinamik[] = ['attribute' => 'EMP_NM', 'label' => 'Employee', 'hAlign' => 'right', 'vAlign' => 'middle', 'filterOptions' => ['style' => 'background-color:rgba(240, 195, 59, 0.4); align:center;', 'vAlign' => 'middle'], 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(240, 195, 59, 0.4)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'text-decoration' => 'underline', 'font-weight' => 'bold', 'border-left-color' => 'transparant', 'border-left' => '0px']]];
foreach ($dataProviderField as $key => $value) {
    $i = 2;
    $kd = explode('.', $key);
    if ($key != 'EMP_NM' and $key != 'TerminalID' and $kd[0] != 'OTIN' and $kd[0] != 'OTOUT') {
        if ($kd[0] == 'IN') {
            $lbl = 'IN';
        } elseif ($kd[0] == 'OUT') {
Example #3
0
use kartik\grid\GridView;
use yii\helpers\Url;
use yii\widgets\Pjax;
use yii\bootstrap\Modal;
use yii\bootstrap\ActiveForm;
use kartik\tabs\TabsX;
use yii\helpers\Json;
use yii\web\Response;
use yii\helpers\ArrayHelper;
use yii\web\Request;
use kartik\daterange\DateRangePicker;
use yii\db\ActiveRecord;
use yii\data\ArrayDataProvider;
use kartik\date\DatePicker;
use lukisongroup\hrd\models\Machine;
$aryMachine = ArrayHelper::map(Machine::find()->all(), 'TerminalID', 'MESIN_NM');
//print_r($dataProvider->getModels());
//print_r($searchModelRo);
$gvTest1 = '';
/* $gvTest1= GridView::widget([
		'id'=>'gv-test1',
        'dataProvider' => $dataProvider1,
		'pjax'=>true,
		'pjaxSettings'=>[
		'options'=>[
			'enablePushState'=>false,
			'id'=>'gv-test1',
		   ],
		],
		'summary'=>false,
		'hover'=>true, //cursor select
Example #4
0
 public function getMachines()
 {
     return $this->hasOne(Machine::className(), ['TerminalID' => 'TerminalID']);
 }