function ObtenerPrestamos($id) { $tab_docprestamo = new Tab_docprestamo(); $sql = "select* from tab_docprestamo where spr_id={$id}"; $dato = $tab_docprestamo->dbSelectBySQL($sql); return $dato; }
function obtenerMaximo($field) { $maximo = new Tab_docprestamo(); $verificar = $maximo->dbselectAll(); $t = 0; foreach ($verificar as $count) { $t++; } if ($t > 0) { $max = $maximo->dbSelectBySQL("SELECT* from tab_docprestamo\r\n where {$field} = (select max({$field}) from tab_docprestamo)"); $mx = $max[0]; $incre = $mx->dpr_orden + 1; return $incre; } else { return 1; } }