This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
/
search.php
67 lines (58 loc) · 1.87 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<h2><?php Yii::t('core', 'search'); ?></h2>
<div class="form">
<?php echo CHtml::form('', 'post', array('id' => 'searchForm')); ?>
<table class="list">
<colgroup>
<col style="width: 100px; font-weight: bold;" />
<col class="type" />
<col class="operator" />
<col />
</colgroup>
<thead>
<tr>
<th><?php echo Yii::t('core', 'field'); ?></th>
<th><?php echo Yii::t('core', 'type'); ?></th>
<th><?php echo Yii::t('core', 'operator'); ?></th>
<th><?php echo Yii::t('core', 'value'); ?></th>
</tr>
</thead>
<tbody>
<?php $tabIndex = 10; ?>
<?php foreach($row->getMetaData()->tableSchema->columns AS $column) { ?>
<tr>
<td><?php echo CHtml::encode($column->name); ?></td>
<td><?php echo strlen($column->dbType) > 50 ? substr($column->dbType, 0, 50) . "..." : $column->dbType ?></td>
<td><?php echo CHtml::dropDownList('operator['.$column->name.']','', $operators); ?></td>
<td>
<?php #echo CHtml::activeTextField($row, $column->name, array('class'=>'text', 'tabIndex'=>$tabIndex)); ?>
<?php echo CHtml::textField('Row[' . $column->name . ']', '', array('class'=>'text', 'tabIndex'=>$tabIndex)); ?>
</td>
</tr>
<?php $tabIndex++; ?>
<?php } ?>
</tbody>
</table>
<div class="buttons">
<a href="javascript:void(0);" onclick="$('form').submit();" class="icon button">
<?php echo Html::icon('search', 16, false, 'core.insert'); ?>
<span><?php echo Yii::t('core', 'search'); ?></span>
</a>
</div>
<script type="text/javascript">
$('#searchForm').ajaxForm({
success: function(responseText, statusText) {
AjaxResponse.handle(responseText);
$('div.ui-layout-center').html(responseText);
init();
}
});
$('#searchForm').keydown(function(e) {
if(e.which == 13)
{
$(this).submit();
}
});
$('table.list input:first').focus();
</script>
<input type="submit" name="submit" style="display: none;" />
<?php echo CHtml::endForm(); ?>