$class_jcs = new jng_sp_customers_special();
$type = isset($_GET['type']) ? tep_db_prepare_input($_GET['type']) : '';
if ($type == '') {
    exit;
}
$typename = $class_jcs->getTypeName($type);
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SEARCHCUSTOMER') {
        $keywords = tep_db_prepare_input(utf8_decode($_POST['keywords']));
        $keywords = strtolower(trim($keywords));
        $result = '';
        if ($keywords == '') {
            $result .= '<h3 class="red">Please enter keywords</h3>';
        } else {
            $customers = $class_jcs->getCustomersToAdd($keywords);
            if (count($customers) == 0) {
                $result .= '<h3 class="red">No Customers found for this keywords</h3>';
            } else {
                $table = array();
                $t = array();
                $t['r'] = 'Partner';
                $t['d'] = 'J&G ID';
                $t['c'] = 'Name';
                $t['a'] = 'Action';
                $table[] = $t;
                $keywords_array = explode(' ', $keywords);
                foreach ($customers as $c) {
                    $cname = strtolower($c['customers_name']);
                    foreach ($keywords_array as $key) {
                        $cname = str_replace($key, "<strong>{$key}</strong>", $cname);