/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Account::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(['id' => $this->id]);
     $query->andFilterWhere(['like', 'acct_name', $this->acct_name]);
     return $dataProvider;
 }
Exemple #2
0
echo $form->field($model, 'user_id')->hiddenInput(['value' => Yii::$app->user->identity->id])->label($username);
?>
	</td> </tr>
	   <!-- <?php 
echo $form->field($model, 'projectcode')->textInput(['maxlength' => true]);
?>
 -->
	<tr><td style="width:800px">
	
	<!--<?php 
echo $form->field($model, 'account')->dropDownList(['prompt' => 'Select Account', 'SM Prime' => 'SM Prime', 'SMIC' => 'SMIC', 'SM ICT' => 'SM ICT']);
?>
 -->
	
            <?php 
echo $form->field($model, 'account_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Account::find()->all(), 'id', 'acct_name'), 'language' => 'en', 'options' => ['placeholder' => 'Select a Sitename ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
		
	</td></tr>
	
	<tr>
	<td> 
			
		<?php 
echo $form->field($model, 'sitename_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Sitename::find()->all(), 'id', 'fullSiteName'), 'language' => 'en', 'options' => ['placeholder' => 'Select a Sitename ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
			
			
	
	</td></tr>
	
Exemple #3
0
    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>
	<br>
	
	<?php 
if ($roles == 10) {