function initPorTabla($tabla) { $res = array(); $xTa = new cSAFETabla($tabla); if ($xTa->obj() != null) { $this->mValorEtiqueta = $xTa->getCampoDescripcion(); $this->mClavePrimaria = $xTa->getClaveUnica(); $this->mTabla = $tabla; if ($this->mValorEtiqueta != "") { $res = $this->get($this->mClavePrimaria, $this->mValorEtiqueta, $this->mTabla); } } return $res; }
function getClavePorNombre($nombre) { $nombre = strtoupper($nombre); $xDT = new cSAFETabla(TCATALOGOS_COLONIAS); $xDT->setWhere(" UCASE(nombre_colonia) LIKE '{$nombre}%' "); $D = obten_filas($xDT->getSelect(1)); $this->mCodigo = $D[$xDT->getClaveUnica()]; //$this->mMessages .= $xDT->getSelect(1); return $this->mCodigo; }