<?php
/* @var $this SuggestionsController */
/* @var $model Suggestions */

$this->breadcrumbs=array(
	'Suggestions'=>array('admin'),
	Yii::t('admin', 'Manage'),
);

$this->menu=array(
array('label'=>'Manage Suggestions', 'url'=>array('admin')),
array('label'=>'Create Suggestions', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$('#suggestions-grid').yiiGridView('update', {
data: $(this).serialize()
});
return false;
});
");
?>
<div class="page-header">
    <h1>
        <?php echo Yii::t("admin", "Manage Suggestions"); ?>        
		<?php //echo CHtml::link(Yii::t("admin", "Create Suggestions"), array("create"), array("class" => "btn btn-sm btn-primary pull-right")); ?>    </h1>



</div>

<!--<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>-->

<div class="col-xs-12">
	<h3>Export Suggestion</h3>
	<p>You can export an excel file filtered by enter time duration </p>
	<br>
</div>

<div class="col-xs-12">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'action'=>Yii::app()->createUrl('admin/suggestions/suggestions/export'),
	'method'=>'get',
)); ?>

	<!--<div class="row">
		<?php //echo $form->textFieldControlGroup($model,'id'); ?>
	</div>-->

	<div class="row">
		
			<?php echo $form->labelEx($model, 'startDate', array('class' => 'col-md-3 control-label')); ?>
					<div class="col-md-5 controls">
						<?php
					
						$this->widget('zii.widgets.jui.CJuiDatePicker', array(
							'model' => $model,
							'attribute' => 'startDate',
							'options' => array(
								'dateFormat' => 'yy-mm-dd',
							),
							'htmlOptions' => array(
								'size' => '10', // textField size
								'maxlength' => '10', // textField maxlength
								'class' => 'form-control',
							),
						));
						?>
					</div>
					<?php echo $form->error($model, 'startDate'); ?>

	</div>
	<br>
	<div class="row">
		

			<?php echo $form->labelEx($model, 'endDate', array('class' => 'col-md-3 control-label')); ?>
					<div class="col-md-5 controls">
						<?php
						
						$this->widget('zii.widgets.jui.CJuiDatePicker', array(
							'model' => $model,
							'attribute' => 'endDate',
							'options' => array(
								'dateFormat' => 'yy-mm-dd',
							),
							'htmlOptions' => array(
								'size' => '10', // textField size
								'maxlength' => '10', // textField maxlength
								'class' => 'form-control',
							),
						));
						?>
					</div>
					<?php echo $form->error($model, 'endtDate'); ?>
	</div>
	<?php
                            echo TbHtml::formActions(array(
                         TbHtml::submitButton(Yii::t('admin', 'export') , array('color' => TbHtml::BUTTON_COLOR_PRIMARY)),
            		    )
								);
                            ?>

		
<?php $this->endWidget(); ?>

</div>
<?php $this->widget('ext.widgets.FGridView', array(
'id'=>'suggestions-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
		'id',
		'name',
		'mobile',
		'type',
		'mail',
		'phone',
		
		'call_time',
		'note_date',
		'place',
		array(
		'name'=>'relat',
		'value'=>'isset($data->related)?($data->related->id!=5?$data->related->name_ar:$data->other_operation_name):$data->relat',
		),
		//'relat',
		'message',
		
array(
'class'=>'CButtonColumn',
'template'=>'{delete}',
),
),
)); ?>
