<?php
/**
 * ThunderSnarf
 *
 * @author Ricardo H.F. Sette P. <ricardohfsp@gmail.com>
 * @link http://www.freebsdbrasil.com.br/
 * @copyright Copyright &copy; 2010 - FreeBSD Brasil LTDA
 * @license licença GNU/GPL v2.0 http://www.gnu.org/licenses/gpl-2.0.html
 */
?>
<div class="wide form">

<p>
Você pode, opcionalmente, digitar um operador de comparação (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) no início de cada valor para especificar como a comparação deve ser feita.
</p>
<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

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

	<div class="row">
		<?php echo $form->label($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>128)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'profile'); ?>
		<?php echo $form->textArea($model,'profile',array('rows'=>6, 'cols'=>50)); ?>
	</div>
	
	
	
	<div class="row">
        <?php 
        echo $form->label($model,'ultimaSolicitacaoA');
        echo $form->textField($model,'ultimaSolicitacaoA',array('value'=>isset($_GET["User"]["ultimaSolicitacaoA"])?$_GET["User"]["ultimaSolicitacaoA"]:''));
		echo " até ";
        echo $form->textField($model,'ultimaSolicitacaoB',array('value'=>isset($_GET["User"]["ultimaSolicitacaoB"])?$_GET["User"]["ultimaSolicitacaoB"]:''));
		$basePath=Yii::getPathOfAlias('zii.vendors.jui');
		$baseUrl=Yii::app()->getAssetManager()->publish($basePath);
		$scriptUrl=$baseUrl.'/js';
		$themeUrl=$baseUrl.'/css';
		$cs=Yii::app()->getClientScript();
		$cs->registerCssFile($themeUrl.'/base/jquery-ui.css');
		$cs->registerCoreScript('jquery');
		Yii::app()->getClientScript()->registerScriptFile($scriptUrl.'/'.'jquery-ui.min.js',CClientScript::POS_END);
		Yii::app()->clientScript->registerScript('datas','
		    $(function() {
				var dates = $(\'#User_ultimaSolicitacaoA, #User_ultimaSolicitacaoB\').datepicker(jQuery.extend(jQuery.datepicker.regional[\'pt-BR\'],{
					defaultDate: "+1w",
					dateFormat: "dd-mm-yy",
					changeMonth: true,
					changeYear: true,
					numberOfMonths: 3,
					maxDate: "+0D",
					showAnim: "",
					showOn: "both",
					buttonImage: "'.Yii::app()->request->baseUrl.'/images/calendar.gif",
					buttonImageOnly: "true",
					onSelect: function(selectedDate) {
						var option = this.id == "User_ultimaSolicitacaoA" ? "minDate" : "maxDate";
						var instance = $(this).data("datepicker");
						var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
						dates.not(this).datepicker("option", option, date);
					}
				}));
			});
		'
		,CClientScript::POS_READY);
		?>
    </div>

	<div class="row">
		<?php echo $form->label($model,'last_ip'); ?>
		<?php echo $form->textField($model,'last_ip'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Filtrar'); ?>
	</div>

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

</div><!-- search-form -->