<?php
/* @var $this QuestionnaireController */
/* @var $model Questionnaire */

$this->breadcrumbs = array(
    'Questionnaires' => array('admin'),
    Yii::t('admin', 'Manage'),
);
?>
<div class="page-header">
    <h1>
        <?php echo Yii::t("admin", "Manage Questionnaires"); ?>        
        <?php echo CHtml::link(Yii::t("admin", "Create Questionnaire"), array("create"), array("class" => "btn btn-sm btn-primary pull-right")); ?>    
    </h1>
</div>


<?php
$this->widget('ext.widgets.FGridView', array(
    'id' => 'questionnaire-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'id',
        array(
            'class' => 'editable.EditableColumn',
            'name' => 'title',
            'headerHtmlOptions' => array('style' => 'width: 110px'),
            'editable' => array(//editable section
                'url' => $this->createUrl('quickUpdate'),
                'placement' => 'right',
                'inputclass' => 'col-md-12',
            ),
            'htmlOptions' => array('width' => '50%', 'class' => 'editable-fullwidth-input'),
        ),
//        'intro',
//        'create_datetime',
//        'update_datetime',
        'publish_datetime:date',
        'end_datetime',
        array(
            'header' => '',
            'value' => 'CHtml::link(Yii::t("admin", "Add Questions"), array("questionnaireQuestion/create", "questionnaire_id" => $data->id,), array("class" => "btn btn-xs btn-info"))." ".'
            . 'CHtml::link(Yii::t("admin", "Manage Questions"), array("questionnaireQuestion/admin", "questionnaire_id" => $data->id,), array("class" => "btn btn-xs"))." ".'
            . 'CHtml::link(Yii::t("admin", "View Answers"), array("questionnaireAnswer/admin", "questionnaire_id" => $data->id,), array("class" => "btn btn-xs"))',
           
            'type' => 'html',
        ),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
