$conexion = new Conexion(); $operation = Item::buscar($get->parametro, $get->tipo, $conexion); if (count($operation['result']) == 1) { $operation['message'] = "Se encontro " . count($operation['result']) . " registro."; } elseif (count($operation['result']) > 1) { $operation['message'] = "Se encontraron " . count($operation['result']) . " registros."; } else { $operation['message'] = "No se encuentran registros con los parametros ingresados."; } echo json_encode($operation); } if ($get->instanciar) { $get->id = base64_decode($get->id); $conexion = new Conexion(); $item = new Item($get->id, $conexion); $item->instanciarMateriaprima($conexion); $_SESSION['item'] = serialize($item); $operation['message'] = "Se cargo correctamente la informaciĆ³n."; $operation["ejecution"] = true; $operation['result'] = true; echo json_encode($operation); } if ($get->entity == "item") { $conexion = new Conexion(); $operation = Item::buscar('', 'materia_prima', $conexion); if ($operation['result']) { $i = 0; foreach ($operation['result'] as $fila) { $result[$i]['id'] = $fila['itm_id']; $result[$i]['nombre'] = $fila['mp_nombre']; $i++;