<?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,'extension'); ?>
		<?php echo $form->textField($model,'extension',array('size'=>5,'maxlength'=>5)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'requested'); ?>
		<?php echo $form->textField($model,'requested',array('value'=>isset($_GET["Extension"]["requested"])?$_GET["Extension"]["requested"]:'')); ?>
	</div>
	
	<div class="row">
        <?php 
        echo $form->label($model,'ultimaSolicitacaoA');
        echo $form->textField($model,'ultimaSolicitacaoA',array('value'=>isset($_GET["Extension"]["ultimaSolicitacaoA"])?$_GET["Extension"]["ultimaSolicitacaoA"]:''));
		echo " até ";
        echo $form->textField($model,'ultimaSolicitacaoB',array('value'=>isset($_GET["Extension"]["ultimaSolicitacaoB"])?$_GET["Extension"]["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 = $(\'#Extension_ultimaSolicitacaoA, #Extension_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 == "Extension_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,'cache_static'); ?>
		<?php echo $form->textField($model,'cache_static',array('value'=>isset($_GET["Extension"]["cache_static"])?$_GET["Extension"]["cache_static"]:'')); ?> em bytes
	</div>

	<div class="row">
		<?php echo $form->label($model,'cache_dynamic'); ?>
		<?php echo $form->textField($model,'cache_dynamic',array('value'=>isset($_GET["Extension"]["cache_dynamic"])?$_GET["Extension"]["cache_dynamic"]:'')); ?> em bytes
	</div>

	<div class="row">
		<?php echo $form->label($model,'traffic_static'); ?>
		<?php echo $form->textField($model,'traffic_static',array('value'=>isset($_GET["Extension"]["traffic_static"])?$_GET["Extension"]["traffic_static"]:'')); ?> em bytes
	</div>

	<div class="row">
		<?php echo $form->label($model,'traffic_dynamic'); ?>
		<?php echo $form->textField($model,'traffic_dynamic',array('value'=>isset($_GET["Extension"]["traffic_dynamic"])?$_GET["Extension"]["traffic_dynamic"]:'')); ?> em bytes
	</div>

	<div class="row">
		<?php echo $form->label($model,'hit_static'); ?>
		<?php echo $form->textField($model,'hit_static',array('value'=>isset($_GET["Extension"]["hit_static"])?$_GET["Extension"]["hit_static"]:'')); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'hit_dynamic'); ?>
		<?php echo $form->textField($model,'hit_dynamic',array('value'=>isset($_GET["Extension"]["hit_dynamic"])?$_GET["Extension"]["hit_dynamic"]:'')); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'miss_static'); ?>
		<?php echo $form->textField($model,'miss_static',array('value'=>isset($_GET["Extension"]["miss_static"])?$_GET["Extension"]["miss_static"]:'')); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'miss_dynamic'); ?>
		<?php echo $form->textField($model,'miss_dynamic',array('value'=>isset($_GET["Extension"]["miss_dynamic"])?$_GET["Extension"]["miss_dynamic"]:'')); ?>
	</div>

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

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

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