$objacople = new acople(); $acos = $objacople->consulta_matriz("Select a.placa,ta.nombre from acoples_configuracion ac, acople a, tipo_acople ta where ac.id_configuracion_vehiculo = '" . $res[0]["id"] . "' AND ac.id_acople = a.id AND a.id_tipo_acople = ta.id"); $txt_acoples = ""; if (is_array($acos)) { foreach ($acos as $ac) { $txt_acoples .= "" . $ac["placa"] . "(" . $ac["nombre"] . "), "; } } $res[0]["acoples"] = $txt_acoples; echo json_encode($res[0]); } else { echo json_encode(0); } break; case 'list': $res = $objconfiguracion_vehiculo->listDB(); if (is_array($res)) { foreach ($res as &$act) { $act['id_unidad'] = $objunidad->searchDB($act['id_unidad'], 'id', 1); $act['id_unidad'] = $act['id_unidad'][0]; $r1 = $objunidad->consulta_arreglo("Select * from tipo_unidad where id = '" . $act["id_unidad"]["id_tipo_unidad"] . "'"); $act['tipo'] = $r1; $objacople = new acople(); $acos = $objacople->consulta_matriz("Select a.placa,ta.nombre from acoples_configuracion ac, acople a, tipo_acople ta where ac.id_configuracion_vehiculo = '" . $act["id"] . "' AND ac.id_acople = a.id AND a.id_tipo_acople = ta.id"); $txt_acoples = ""; if (is_array($acos)) { foreach ($acos as $ac) { $txt_acoples .= "" . $ac["placa"] . "(" . $ac["nombre"] . "), "; } } $act["acoples"] = $txt_acoples;