可以在上传图片后添加ajax获取值吗?

I try build ajax for take value from db like id & name, In Opencart Version 1.5.5.1.

  1. Upload Image (example images = bag.jpg)(It's possible select images from data , not must upload images)

http://s1064.photobucket.com/user/blackarch01/media/Untitled3_zpsfpu9cui8.png.html?sort=3&o=0

  1. Ajax(select * from product where images = 'bag.jpg')
  2. Return value like(id & name).

First I build in ajax autocomplete but the suggestion not appear.

http://s1064.photobucket.com/user/blackarch01/media/Untitled_zpssnufsz0b.png.html?sort=3&o=1

The suggestion is working if I change from upload images to text.

http://s1064.photobucket.com/user/blackarch01/media/Untitled2_zpstpzvdjt2.png.html?sort=3&o=2

This For View :

// This For Upload Images
<td><span class="required">* </span><?php echo $entry_image; ?></td>
<td><div class="image"><img src="<?php echo $thumb; ?>" alt="" id="thumb" /><br />
<input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
<a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a></div></td>

// This For Return Value
<td><input type="text" name="idp" value="" id="idp"></td>
<td><input type="text" name="namep" value="" id="namep"></td>

This Ajax :

$('input[name=\'image\']').autocomplete({  // IF i change this to alt(text) it's working(suggestion appear).
    delay: 100,
    source: function(request, response) {
        $.ajax({
            url: 'index.php?route=bannerr/add_bannerr/autocomplete&token=<?php echo $token; ?>&filter_img=' +  encodeURIComponent(request.term),
            dataType: 'json',
            success: function(json) {       
                response($.map(json, function(item) {
                    return {
                        label: item.name,
                        value: item.product_id
                    }
                }));
            }
        });
    }, 
    select: function(event, ui) {
        $('input[name=\'namep\']').val(ui.item.label);
        $('input[name=\'idp\']').val(ui.item.value);
        return false;
    },

    focus: function(event, ui) {
        return false;
    }
});

This Controller:

public function autocomplete() {
    $json = array();
    $this->load->model('bannerr/add_bannerr');

    if (isset($this->request->get['filter_img'])) {

        if (isset($this->request->get['filter_img']))
            $filter_img = $this->request->get['filter_img'];
        else
            $filter_img = null; 

        $data = array(
            'filter_img'  => $filter_img,
        );

        $results = $this->model_bannerr_add_bannerr->getProducts($data);

        foreach ($results as $result) {

            $json[] = array(
                'product_id' => $result['product_id'],
                'name'       => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')),
            );  
        }
    }
    $this->response->setOutput(json_encode($json));
}

This Model :

public function getProducts($data) {
    $sql = "SELECT * FROM product WHERE product_image = '" . $this->db->escape($data['filter_img']) . "'";
    $query = $this->db->query($sql);
    return $query->rows;
}

Is it possible to make ajax to return value based on the images ?