2016-08-18 02:34:53 +00:00
|
|
|
<!-- field = field name -->
|
|
|
|
<!-- text = field text -->
|
|
|
|
<!-- value = array of values -->
|
|
|
|
<!-- name = account name -->
|
|
|
|
<!-- ajaxurl = ajax URL -->
|
|
|
|
<div class="form-group">
|
2016-08-25 13:24:44 +00:00
|
|
|
<label for="<?php echo Arr::get($data,'field'); ?>_label" class="col-md-<?php echo Arr::get($data,'classlabelnum',2); ?> control-label"><?php echo Arr::get($data,'text'); ?></label>
|
|
|
|
<div class="input-group <?php echo Arr::get($data,'class','col-md-5'); ?>">
|
|
|
|
<input type="text" id="<?php echo Arr::get($data,'field'); ?>_label" value="<?php echo Arr::get($data,'name'); ?>" class="form-control" placeholder="<?php echo Arr::get($data,'text'); ?>" autocomplete="off" <?php echo Arr::convert(Arr::get($data,'attr',[])); ?>>
|
2016-08-18 02:34:53 +00:00
|
|
|
<span class="input-group-addon"><i class="fa fa-refresh" name="account_lookup"></i></span>
|
|
|
|
</div>
|
2016-08-25 13:24:44 +00:00
|
|
|
<span class="col-md-offset-<?php echo Arr::get($data,'classlabelnum',2); ?> help-block with-errors"></span>
|
|
|
|
<input type="hidden" name="<?php echo Arr::get($data,'field'); ?>" value="<?php echo Arr::get($data,'value'); ?>">
|
2016-08-18 02:34:53 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
Script::factory()
|
|
|
|
->type('stdin')
|
|
|
|
->data('
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("input[id=account_id_label]").typeahead({
|
|
|
|
minLength: 2,
|
|
|
|
source: function (query,process) {
|
2016-08-25 13:24:44 +00:00
|
|
|
search("'.Arr::get($data,'ajaxurl').'",query,process,"account_lookup");
|
2016-08-18 02:34:53 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
matcher: function () { return true; },
|
|
|
|
|
|
|
|
updater: function (item) {
|
|
|
|
$("input[name=account_id]").val(users[item]).trigger("change");
|
|
|
|
|
|
|
|
return item;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});');
|
|
|
|
?>
|