/** * @ajax * @conn vfs */ public function POST($conn) { $rows = null; $rs = $conn->vfs_sap()->orderBy("AREA, AREA_SUB")->select(); if ($rs->getRecordCount() > 0) { $rs->setMap("AREA_SUB", vfs_DS::subAreaAll()); } while ($rs->next()) { $rows[] = array($rs->getCell("AREA", null, "center", "vfs/parameters/SAP/GET", $rs->httpQuery("AREA", "AREA_SUB")), $rs->withMap("AREA_SUB"), $rs->getCell("BUS_AREA", null, "center"), $rs->getCell("COST_CTR", null, "center"), $rs->getCell("PRFT_CTR", null, "center")); } return array("rows" => $rows); }
/** * @ajax * @ignore */ public function dt1($_raw = false) { if (!is_null(self::$_dt1)) { return self::$_dt1; } $ky = "vfs_DS_dt1"; $ds = apc_fetch($ky); if ($ds !== false) { return self::$_dt1 = $ds; } $ds = $_raw ? null : array("" => array("value" => "PILIH", "selected" => true)); $conn = DB::lookup("vfs"); $rs = $conn->executeQuery("SELECT * FROM vfs_dt1 WHERE BEGDA<=CURRENT_DATE AND BEGDA IS NOT NULL AND (ENDDA>=CURRENT_DATE OR ENDDA IS NULL)"); while ($rs->next()) { $ds[$rs->get("ID_DT1")] = $_raw ? $rs->get("DT1_NAME") : sprintf("%s. %s", $rs->get("ID_DT1"), strtoupper($rs->get("DT1_NAME"))); } apc_store($ky, $ds); return $ds; }