Created
May 28, 2013 08:21
-
-
Save zofe/5661280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old style autocompleter | |
$acvetrina = new autocompleter_field(array('name'=>'acvetrina','status'=>'modify')); | |
$acvetrina->ajax_source = site_url('admin/feedback/js_vetrine'); | |
$acvetrina->min_chars = '2'; | |
$acvetrina->record_label = 'vetrina'; | |
$acvetrina->record_id = 'ID'; | |
$acvetrina->hidden_field_id = 'id_vetrina'; | |
$acvetrina->extra_params = "category: function() { return $('#id_categoria').val() } , prov: function() { return $('#id_provincia').val() }"; | |
$acvetrina->build(); | |
function js_vetrine() | |
{ | |
$this->db->select(....); | |
$this->db->from(....); | |
if (isset($_GET, $_GET['q'])) | |
{ | |
if ($_GET['q'] == '***') | |
{ | |
//non vincolo al like | |
} else { | |
$this->db->like("va.`NOME`", $_GET['q']); | |
} | |
} | |
$this->db->limit(10); | |
$query = $this->db->get(); | |
echo json_encode($query->result_array()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment