Example #1
0
 public static function getInstance()
 {
     if (!self::$cpcbMgr) {
         self::$cpcbMgr = new CPCBMgr();
         return self::$cpcbMgr;
     }
     return self::$cpcbMgr;
 }
Example #2
0
        $stationRepMgr = StationReportMgr::getInstance();
        $rep = $stationRepMgr->getStationReport($_GET);
    }
    echo json_encode($rep);
}
if ($method == $REQUEST_WIND_ROSE_JSON) {
    $windRoseReportMgr = WindRoseReportMgr::getInstance();
    $windRosePlot = $windRoseReportMgr->getWindRoseReport($_GET);
    echo json_encode($windRosePlot);
}
if ($method == $REQUEST_MAP_LOCATIONS_JSON) {
    session_start();
    $userLogged = new User();
    $userLogged = $_SESSION["userlogged"];
    $isLoggedIn = $_GET['isLoggedIn'];
    $cpcbMgr = CPCBMgr::getInstance();
    $UDS = UserDataStore::getInstance();
    $folderSeqs = $UDS->getAllFolderSeqs($userLogged->getSeq());
    $mapJSON = $cpcbMgr->getCPCBMapsJson($isLoggedIn, $folderSeqs);
    echo json_encode($mapJSON);
}
if ($method == $REQUEST_STATIONS_RECENT) {
    $stationRepMgr = MultiStationReportMgr::getInstance();
    $recentJSON = $stationRepMgr->getRecentReport($_GET);
    echo json_encode($recentJSON);
}
if ($method == $SAVE_COMMENTS_MASTER) {
    $commentsMgr = CommentsMgr::getInstance();
    $res = $commentsMgr->saveCommentsMaster($_GET);
    echo json_encode($res);
}
$toDate = new DateTime($WQDInfo['dated']);
//current date as todate
$fromDateClone = clone $toDate;
$fromDate = $fromDateClone->sub(new DateInterval('P1D'));
$toDateStr = $toDate->format("Y/m/d  H:i:s");
$fromDateStr = $fromDate->format("Y/m/d  H:i:s");
$CCDS = ChannelConfigurationDataStore::getInstance();
$channelsDetails = $CCDS->FindByFolder($folderSeq);
$WQDAvgInfo;
if ($folderObj->getStationType() == "stack" || $folderObj->getStationType() == "effluent") {
    $WQDAvgInfo = $WQDStackDataDS->getChannelsAverageInfo($folderSeq, $fromDateStr, $toDateStr, $channelsDetails);
} else {
    $WQDAvgInfo = $WQDDataDS->getChannelsAverageInfo($folderSeq, $fromDateStr, $toDateStr, $channelsDetails);
}
$isLoggedIn = $_GET['$isLoggedIn'];
$mapsJSON = CPCBMgr::getCPCBMapsJson($isLoggedIn);
$folder = $FDS->FindBySeq($folderSeq);
$folderMapInfo = $mapsJSON[$folderSeq];
$channelsData = $WQDInfo['channelsInfo'];
//channel details is arrray of chNo and chValue
//we need chNo to chName
$unitName = new ArrayObject();
foreach ($channelsDetails as $channel) {
    $unitName[$channel->getChannelName()] = $channel->getChannelUnit();
}
foreach ($channelsDetails as $channel) {
    $chNo = $channel->getChannelNumber();
    $chName = $channel->getChannelName();
    $chUnit = $channel->getChannelUnit();
    $chData = $channelsData['ch' . $chNo . 'value'];
    if ((double) $chData <= 0 && $chName != 'Vertical Wind Speed') {