Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Lookup::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, 'code' => $this->code, 'position' => $this->position]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'type', $this->type]);
     return $dataProvider;
 }
Exemplo n.º 2
0
use common\models\Lookup;
/* @var $this yii\web\View */
/* @var $searchModel common\models\EntrepreneurSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Entrepreneurs');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="entrepreneur-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
//= Html::a(Yii::t('app', 'Create Entrepreneur'), ['create'], ['class' => 'btn btn-success'])
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'email', ['attribute' => 'plkn', 'filter' => Html::activeDropDownList($searchModel, 'plkn', Lookup::items('Plkn-Name'), ['class' => 'form-control', 'prompt' => 'Please select PLKN']), 'format' => 'raw', 'value' => function ($model) {
    return $model->NamePlkn();
}, 'headerOptions' => ['width' => '280px']], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 3
0
 public function getPusatName()
 {
     return Lookup::item('Plkn-Name', $this->plkn);
 }
Exemplo n.º 4
0
                                    <?php 
echo $form->field($model, 'ic')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '999999-99-9999']);
?>
                                </div>
                            </div>
                            <?php 
echo $form->field($model, 'state')->dropDownList(Lookup::items('State-Name'), ['prompt' => 'Please select State']);
?>
                            <?php 
echo $form->field($model, 'mobile');
?>
                            <?php 
if ($model->role == 'ENT') {
    ?>
                                <?php 
    echo $form->field($model, 'plkn')->dropDownList(Lookup::items('Plkn-Name'), ['prompt' => 'Required to select PLKN']);
    ?>
                            <?php 
}
?>
                            <hr>

                        </div>

                    </div>
                    <div class="form-group">
                                <?php 
echo Html::submitButton('Sign-up Now', ['class' => 'btn btn-primary', 'name' => 'signup-button']);
?>
                            </div>
Exemplo n.º 5
0
?>

    <?php 
echo $form->field($model, 'address')->textInput();
?>

    <?php 
echo $form->field($model, 'postcode')->textInput();
?>

    <?php 
echo $form->field($model, 'district')->textInput();
?>

    <?php 
echo $form->field($model, 'state')->dropDownList(Lookup::items('State-Name'), ['prompt' => 'Required to select State']);
?>

    <?php 
echo $form->field($model, 'telephone')->textInput();
?>

    <?php 
echo $form->field($model, 'fax')->textInput();
?>

    <?php 
echo $form->field($model, 'email')->textInput();
?>

    <?php 
Exemplo n.º 6
0
 public function getStatusName()
 {
     return Lookup::item('User-Status', $this->status);
 }
Exemplo n.º 7
0
 public function StateName()
 {
     $plknLookup = Lookup::items('State-Name');
     return $plknLookup[$this->supplier->state];
 }
Exemplo n.º 8
0
use common\models\Lookup;
/* @var $this yii\web\View */
/* @var $searchModel common\models\EntpSupplierSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'My Suppliers';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="entp-supplier-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('New Supplier', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'name', 'value' => 'supplier.name'], ['attribute' => 'address', 'value' => 'supplier.address'], ['attribute' => 'supplier.state', 'filter' => Html::activeDropDownList($searchModel, 'state', Lookup::items('State-Name'), ['class' => 'form-control', 'prompt' => 'Please select State']), 'format' => 'raw', 'value' => function ($model) {
    return $model->StateName();
}], ['attribute' => 'created at', 'value' => 'supplier.created_at', 'format' => 'date'], ['attribute' => 'updated at', 'value' => 'supplier.updated_at', 'format' => 'date'], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 9
0
<div class="user-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'name')->textInput();
?>

    <?php 
echo $form->field($model, 'email')->textInput();
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(Lookup::items('User-Status'), ['prompt' => 'Select Status']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Exemplo n.º 10
0
        <?php 
echo Html::a(Yii::t('app', 'Create User'), ['create'], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Activate User'), '#', ['class' => 'btn btn-success', 'id' => 'activateUser']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Deactivate User'), '#', ['class' => 'btn btn-danger', 'id' => 'deactivateUser']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Assign as Mentor'), '#', ['class' => 'btn btn-warning', 'id' => 'assignedMentor']);
?>
    </p>

    <?php 
echo GridView::widget(['id' => 'userList', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => 'yii\\grid\\CheckboxColumn'], 'name', 'email', ['label' => 'Status', 'attribute' => 'statusName', 'filter' => Html::activeDropDownList($searchModel, 'status', Lookup::items('User-Status'), ['class' => 'form-control', 'prompt' => 'Please select status'])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>

<?php 
echo Html::beginForm(['activate'], 'post', ['class' => 'hidden', 'id' => 'user-activate-form']);
?>

    <?php 
echo Html::hiddenInput('selected', '', ['id' => 'selected-value']);
?>
    <?php 
echo Html::hiddenInput('action', '', ['id' => 'action-value']);
?>
Exemplo n.º 11
0
 /**
  * Finds the Lookup model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Lookup the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Lookup::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 12
0
 public function getTypeText()
 {
     return Lookup::item('AuthItem', $this->type);
 }