Exemple #1
0
?>
	
	<?php 
$gridColumns = [['class' => 'kartik\\grid\\ExpandRowColumn', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    $searchModel = new LogsSearch();
    $searchModel->project_id = $model->projectcode;
    $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
    return Yii::$app->controller->renderPartial('_logsView', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
}], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectcode', 'value' => 'projectcode', 'filterInputOptions' => ['style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'account_id', 'value' => 'account.acct_name', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Account::find()->asArray()->all(), 'acct_name', 'acct_name'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Account', 'style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'sitename_id', 'value' => 'sitename.fullSiteName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Sitename::find()->asArray()->all(), 'sitename', 'sitename'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Sitename', 'style' => 'width:140px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectname', 'value' => 'projectname', 'filterInputOptions' => ['style' => 'width:140px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center; '], 'attribute' => 'pic_id', 'value' => 'pic.pic_fullName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Pic::find()->asArray()->all(), 'pic_fullName', 'pic_fullName'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Person', 'style' => 'width:150px;'], 'editableOptions' => ['inputType' => '\\kartik\\select2\\Select2', 'options' => ['data' => ArrayHelper::map(Pic::find()->all(), 'id', 'pic_fullName')]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'status', 'value' => 'status', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['FOR SITE SURVEY' => 'FOR SITE SURVEY', 'FOR DESIGNING' => 'FOR DESIGNING', 'FOR REVISION' => 'FOR REVISION', 'FOR REVIEW' => 'FOR REVIEW', 'FOR COSTING' => 'FOR COSTING', 'FOR NEGOTATION' => 'FOR NEGOTATION', 'CANCELED' => 'CANCELED', 'FOR PHILCOM PROPOSAL' => 'FOR PHILCOM PROPOSAL', 'PROPOSAL SENT/WAITING P.O' => 'PROPOSAL SENT/WAITING P.O', 'FOR MOBILAZATION' => 'FOR MOBILAZATION', 'ON-GOING' => 'ON-GOING', 'PHYSICALLY COMPLETED' => 'PHYSICALLY COMPLETED', 'ACCEPTED' => 'ACCEPTED'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Status', 'style' => 'width:180px;'], 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DROPDOWN_LIST, 'data' => ['FOR SITE SURVEY' => 'FOR SITE SURVEY', 'FOR DESIGNING' => 'FOR DESIGNING', 'FOR REVISION' => 'FOR REVISION', 'FOR REVIEW' => 'FOR REVIEW', 'FOR COSTING' => 'FOR COSTING', 'FOR NEGOTATION' => 'FOR NEGOTATION', 'CANCELED' => 'CANCELED', 'FOR PHILCOM PROPOSAL' => 'FOR PHILCOM PROPOSAL', 'PROPOSAL SENT/WAITING P.O' => 'PROPOSAL SENT/WAITING P.O', 'FOR MOBILAZATION' => 'FOR MOBILAZATION', 'ON-GOING' => 'ON-GOING', 'PHYSICALLY COMPLETED' => 'PHYSICALLY COMPLETED', 'ACCEPTED' => 'ACCEPTED']]], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'logs0.milestone', 'value' => 'logs0.milestoneFull'], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'contractor', 'value' => 'contractor', 'filterInputOptions' => ['style' => 'width:120px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_flob', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_flob', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_completion', 'value' => 'date_of_completion', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_completion', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'label' => '% of Completion', 'attribute' => 'percentage_of_completion', 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_RANGE, 'options' => ['pluginOptions' => ['min' => 0, 'max' => 100]]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'remarks', 'filterInputOptions' => ['style' => 'width:140px;'], 'editableOptions' => ['size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA, 'placement' => PopoverX::ALIGN_LEFT]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']];
$gridColumns3 = [['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectcode', 'value' => 'projectcode', 'filterInputOptions' => ['style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'account_id', 'value' => 'account.acct_name', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Account::find()->asArray()->all(), 'acct_name', 'acct_name'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Account', 'style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'sitename_id', 'value' => 'sitename.fullSiteName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Sitename::find()->asArray()->all(), 'sitename', 'sitename'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Sitename', 'style' => 'width:140px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectname', 'value' => 'projectname', 'filterInputOptions' => ['style' => 'width:140px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center; '], 'attribute' => 'pic_id', 'value' => 'pic.pic_fullName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Pic::find()->asArray()->all(), 'pic_fullName', 'pic_fullName'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Person', 'style' => 'width:150px;'], 'editableOptions' => ['inputType' => '\\kartik\\select2\\Select2', 'options' => ['data' => ArrayHelper::map(Pic::find()->all(), 'id', 'pic_fullName')]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'status', 'value' => 'status', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['FOR SITE SURVEY' => 'FOR SITE SURVEY', 'FOR DESIGNING' => 'FOR DESIGNING', 'FOR REVISION' => 'FOR REVISION', 'FOR REVIEW' => 'FOR REVIEW', 'FOR COSTING' => 'FOR COSTING', 'FOR NEGOTATION' => 'FOR NEGOTATION', 'CANCELED' => 'CANCELED', 'FOR PHILCOM PROPOSAL' => 'FOR PHILCOM PROPOSAL', 'PROPOSAL SENT/WAITING P.O' => 'PROPOSAL SENT/WAITING P.O', 'FOR MOBILAZATION' => 'FOR MOBILAZATION', 'ON-GOING' => 'ON-GOING', 'PHYSICALLY COMPLETED' => 'PHYSICALLY COMPLETED', 'ACCEPTED' => 'ACCEPTED'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Status', 'style' => 'width:180px;'], 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DROPDOWN_LIST, 'data' => ['FOR SITE SURVEY' => 'FOR SITE SURVEY', 'FOR DESIGNING' => 'FOR DESIGNING', 'FOR REVISION' => 'FOR REVISION', 'FOR REVIEW' => 'FOR REVIEW', 'FOR COSTING' => 'FOR COSTING', 'FOR NEGOTATION' => 'FOR NEGOTATION', 'CANCELED' => 'CANCELED', 'FOR PHILCOM PROPOSAL' => 'FOR PHILCOM PROPOSAL', 'PROPOSAL SENT/WAITING P.O' => 'PROPOSAL SENT/WAITING P.O', 'FOR MOBILAZATION' => 'FOR MOBILAZATION', 'ON-GOING' => 'ON-GOING', 'PHYSICALLY COMPLETED' => 'PHYSICALLY COMPLETED', 'ACCEPTED' => 'ACCEPTED']]], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'logs0.milestone', 'value' => 'logs0.milestoneFull'], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'contractor', 'value' => 'contractor', 'filterInputOptions' => ['style' => 'width:120px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_flob', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_flob', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_completion', 'value' => 'date_of_completion', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_completion', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'label' => '% of Completion', 'attribute' => 'percentage_of_completion', 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_RANGE, 'options' => ['pluginOptions' => ['min' => 0, 'max' => 100]]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'remarks', 'filterInputOptions' => ['style' => 'width:140px;'], 'editableOptions' => ['size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA, 'placement' => PopoverX::ALIGN_LEFT]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']];
$gridColums2 = [['class' => 'kartik\\grid\\ExpandRowColumn', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    $searchModel = new LogsSearch();
    $searchModel->project_id = $model->projectcode;
    $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
    return Yii::$app->controller->renderPartial('_logsView', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
}], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'class' => 'kartik\\grid\\SerialColumn'], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectcode', 'value' => 'projectcode', 'filterInputOptions' => ['style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'account_id', 'value' => 'account.acct_name', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Account::find()->asArray()->all(), 'acct_name', 'acct_name'), 'filterInputOptions' => ['placeholder' => 'Choose Account', 'style' => 'width:140px;'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]]], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'sitename_id', 'value' => 'sitename.fullSiteName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Sitename::find()->asArray()->all(), 'sitename', 'sitename'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Sitename', 'style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectname', 'value' => 'projectname', 'filterInputOptions' => ['style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'pic_id', 'value' => 'pic.pic_fullName', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(Pic::find()->asArray()->all(), 'pic_fullName', 'pic_fullName'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Person', 'style' => 'width:140px;']], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'status', 'value' => 'status', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ['FOR SITE SURVEY' => 'FOR SITE SURVEY', 'FOR DESIGNING' => 'FOR DESIGNING', 'FOR REVISION' => 'FOR REVISION', 'FOR REVIEW' => 'FOR REVIEW', 'FOR COSTING' => 'FOR COSTING', 'FOR NEGOTATION' => 'FOR NEGOTATION', 'CANCELED' => 'CANCELED', 'FOR PHILCOM PROPOSAL' => 'FOR PHILCOM PROPOSAL', 'PROPOSAL SENT/WAITING P.O' => 'PROPOSAL SENT/WAITING P.O', 'FOR MOBILAZATION' => 'FOR MOBILAZATION', 'ON-GOING' => 'ON-GOING', 'PHYSICALLY COMPLETED' => 'PHYSICALLY COMPLETED', 'ACCEPTED' => 'ACCEPTED'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Choose Status', 'style' => 'width:180px;']], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'logs0.milestone', 'value' => 'logs0.milestoneFull'], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'contractor', 'value' => 'contractor', 'filterInputOptions' => ['style' => 'width:120px;']], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_flob', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_flob', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_completion', 'value' => 'date_of_completion', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_completion', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_DATE, 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'label' => '% of Completion', 'attribute' => 'percentage_of_completion', 'readonly' => function ($model, $key, $index, $widget) {
    return $model->percentage_of_completion > 89;
    // do not allow editing
}, 'editableOptions' => ['size' => 'sm', 'inputType' => \kartik\editable\Editable::INPUT_RANGE, 'options' => ['pluginOptions' => ['min' => 0, 'max' => 100]]]], ['class' => 'kartik\\grid\\EditableColumn', 'contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'remarks', 'filterInputOptions' => ['style' => 'width:140px;'], 'editableOptions' => ['size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA, 'placement' => PopoverX::ALIGN_LEFT]]];
?>
	
	
	
    
     
	<br>
	<br>
 /**
  * Lists all Logs models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new LogsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }