<div class="project-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<div class="block">
	    <?php 
if ($dataProvider2) {
    if ($dataProvider2->getTotalCount() !== 0) {
        echo '<h2>Nieuwe projectaanvragen</h2>';
        echo GridView::widget(['dataProvider' => $dataProvider2, 'filterModel' => $searchModel2, 'columns' => ['description', ['attribute' => 'client_id', 'value' => 'client.name'], ['attribute' => 'projectmanager_id', 'value' => 'projectmanager.username'], ['attribute' => 'status', 'value' => 'statusName', 'filter' => Html::activeDropDownList($searchModel2, 'status', Project::statusses(), ['prompt' => 'Alles', 'class' => 'form-control'])], ['class' => 'yii\\grid\\ActionColumn']]]);
    }
}
?>
	
		<h2>Projecten</h2>
		
		<p>
	        <?php 
echo \Yii::$app->user->can('createProject') ? Html::a(Yii::t('project', 'Create Project'), ['create'], ['class' => 'btn btn-success']) : Html::a(Yii::t('project', 'Request Project'), ['/request-project'], ['class' => 'btn btn-success']);
?>
	    </p>
	    
	    <?php 
echo GridView::widget(['dataProvider' => $dataProvider1, 'filterModel' => $searchModel1, 'columns' => ['description', ['attribute' => 'client_id', 'value' => 'client.name'], ['attribute' => 'projectmanager_id', 'value' => 'projectmanager.username'], ['attribute' => 'status', 'value' => 'statusName', 'filter' => Html::activeDropDownList($searchModel2, 'status', Project::statusses(), ['prompt' => 'Alles', 'class' => 'form-control'])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
	</div>
</div>
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="project-create">
	<div class="block">
    
    <?php 
$form = ActiveForm::begin();
$projectmanagers = User::getProjectManagers();
$customers = Customer::find()->all();
?>

    <?php 
echo $form->field($model, 'description')->textInput();
?>
    <?php 
echo $form->field($model, 'status')->dropDownList(Project::statusses());
?>
    <?php 
echo $form->field($model, 'projectmanager_id')->dropDownList(ArrayHelper::map($projectmanagers, 'id', 'username'), ['prompt' => Yii::t('project', 'Select a projectmanager')]);
?>
	    
    <div id="existing-user" style="display:none;">
    	<fieldset>
    		<legend><?php 
echo Yii::t('project', 'Existing user');
?>
</legend>
	    		<?php 
echo Html::button(Yii::t('user', 'New User'), ['onClick' => 'js:newContact()', 'class' => 'btn btn-default']);
?>