Exemplo n.º 1
0
 /**
  * Lists all Pic models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PicSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     if (Yii::$app->request->post('hasEditable')) {
         $picId = Yii::$app->request->post('editableKey');
         $model = Pic::findOne($picId);
         $post = [];
         $posted = current($_POST['Pic']);
         $post['Pic'] = $posted;
         if ($model->load($post)) {
             $output = '';
             $model->save();
             $out = Json::encode(['output' => $output, 'message' => '']);
         }
         echo $out;
         return $this->refresh();
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 2
0
 public function actionPicView()
 {
     $searchModel = new PicSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Exemplo n.º 3
0
} else {
    $this->title = 'Projects';
    ?>


<div class="project-index">

    <h1><?php 
    echo Html::encode($this->title);
    ?>
</h1>
    <?php 
    $gridColums = [['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'class' => 'kartik\\grid\\SerialColumn'], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'projectname', 'value' => 'projectname', 'filterInputOptions' => ['style' => 'width:140px;']], ['class' => 'kartik\\grid\\ExpandRowColumn', 'value' => function ($model, $key, $index, $column) {
        return GridView::ROW_COLLAPSED;
    }, 'detail' => function ($model, $key, $index, $column) {
        $searchModel = new PicSearch();
        $searchModel->id = $model->pic_id;
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        return Yii::$app->controller->renderPartial('_picView', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
    }], ['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:140px;']], ['contentOptions' => ['style' => 'font-size:13px; 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:13px; text-align:center;'], 'attribute' => 'contractor', 'value' => 'contractor', 'filterInputOptions' => ['style' => 'width:140px;']], ['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']])], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'date_of_completion', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_of_completion', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'label' => '% of Completion', 'attribute' => 'percentage_of_completion', 'value' => 'percentage_of_completion', 'filterInputOptions' => ['style' => 'width:100px;']], ['contentOptions' => ['style' => 'font-size:13px; text-align:center;'], 'attribute' => 'remarks', 'value' => 'remarks', 'filterInputOptions' => ['style' => 'width:150px;']], ['contentOptions' => ['style' => 'font-size:12px; text-align:center;'], 'attribute' => 'logs0.milestone', 'value' => 'logs0.milestoneFull'], ['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('_logsView2', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
    }]];
    ?>