public static function getAllLocationsMultiDropDown($selectName, $onChangeMethod, $selectedValuel) { $LDS = LocationDataStore::getInstance(); $locations = $LDS->FindAll(); $str = "<select multiple class='chosen-select' name='" . $selectName . "' id='" . $selectName . "' onchange='" . $onChangeMethod . "'>"; $str .= "<option value='0'>Select Location</option>"; if ($locations != null && $locations != "") { foreach ($locations as $location) { $select = $selectedValue == $location->getSeq() ? 'selected' : null; $str .= "<option value='" . $location->getSeq() . "'" . $select . ">" . $location->getLocationName() . "</option>"; } } $str .= "</select>"; return $str; }
<html> <head> <?php include "_jsAdminInclude.php"; ?> <?php include "../_InspiniaInclude.php"; ?> </head> <body> <div id="wrapper"> <?php include "leftButtons.php"; $seq = $managerSession['seq']; $LDS = LocationDataStore::getInstance(); $location = $LDS->FindBySeq($managerSession['locSeq']); // finding location from the current sessio ?> <div class="wrapper wrapper-content animated fadeInRight"> <?php echo $div; ?> <div class="row"> <div class="col-lg-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>User Form</h5> </div> <div class="ibox-content">
public function getRecentReport($GET) { $DataArr = array(); $folSeqArray = array(); //holds all folderseqs foreach ($GET as $key => $value) { if (strpos($key, "channelNos_") !== false) { $folSeq = (double) substr($key, 11); array_push($folSeqArray, $folSeq); } } $folStationsArr = array(); foreach ($folSeqArray as $folderSeq) { $folStation = array(); $FDS = FolderDataStore::getInstance(); $folder = $FDS->FindBySeq($folderSeq); $LDS = LocationDataStore::getInstance(); $location = $LDS->FindBySeq($folder->getLocationSeq()); $WQDDataDS = WQDDataDataStore::getInstance(); $WQDInfo = $WQDDataDS->getChannelsLatestInfo($folderSeq); $folStation['station'] = $folder->getFolderName(); $folStation['location'] = $location->getLocationName(); //dates calcualted to get avg info $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"); if ($folder->getStationType() == "stack" || $folder->getStationType() == "effluent") { $WQDStackDataDS = WQDStackDataStore::getInstance(); $WQDAvgInfo = $WQDStackDataDS->getChannelsAverageInfo($folderSeq, $fromDateStr, $toDateStr); } else { $WQDAvgInfo = $WQDDataDS->getChannelsAverageInfo($folderSeq, $fromDateStr, $toDateStr); } $CCDS = ChannelConfigurationDataStore::getInstance(); $channelsDetails = $CCDS->FindByFolder($folderSeq); $channelsData = $WQDInfo['channelsInfo']; //channel details is arrray of chNo and chValue $unitName = new ArrayObject(); foreach ($channelsDetails as $channel) { $unitName[$channel->getChannelName()] = $channel->getChannelUnit(); } $channelsDataArr = array(); foreach ($channelsDetails as $channel) { try { $channelData = array(); $chNo = $channel->getChannelNumber(); $chName = $channel->getChannelName(); $chUnit = $channel->getChannelUnit(); $chData = $channelsData['ch' . $chNo . 'value']; $chConvertedUnitVal = ConvertorUtils::getPrescribedUnit($chName); if ($chConvertedUnitVal != "") { $chUnit = $chConvertedUnitVal; } $chUnit = ConvertorUtils::getUTF8Encoded($chUnit); $chAvg = $WQDAvgInfo['ch' . $channel->getChannelNumber() . 'avg']; $chMin = $WQDAvgInfo['ch' . $channel->getChannelNumber() . 'min']; $chMax = $WQDAvgInfo['ch' . $channel->getChannelNumber() . 'max']; $channelData["ch" . $chNo . "value"] = ConvertorUtils::getPrescribedValue($chName, $chData); $channelData["ch" . $chNo . "unit"] = $chUnit; $channelData["ch" . $chNo . "avg"] = $chAvg; $channelData["ch" . $chNo . "min"] = $chMin; $channelData["ch" . $chNo . "max"] = $chMax; $channelData["ch" . $chNo . "name"] = $chName; array_push($channelsDataArr, $channelData); } catch (Exception $e) { } } $folStation['channelsData'] = $channelsDataArr; $dat = new DateTime($WQDInfo['dated']); $datStr = $dat->format("d-m-Y H:i"); $folStation['dated'] = $datStr; array_push($folStationsArr, $folStation); } return $folStationsArr; }
<?php ob_start(); session_start(); require_once 'IConstants.inc'; require_once $ConstantsArray['dbServerUrl'] . "/Utils/FileSystemUtils.php"; require_once $ConstantsArray['dbServerUrl'] . "/Parsers/ParserWQD.php"; require_once $ConstantsArray['dbServerUrl'] . "/DataStoreMgr/WQDFileDataStore.php"; require_once $ConstantsArray['dbServerUrl'] . "/DataStoreMgr/FolderDataStore.php"; require_once $ConstantsArray['dbServerUrl'] . "/DataStoreMgr/LocationDataStore.php"; require_once $ConstantsArray['dbServerUrl'] . "DataStoreMgr/UserDataStore.php"; require_once $ConstantsArray['dbServerUrl'] . "FormValidator//validator.php"; require_once $ConstantsArray['dbServerUrl'] . "Utils//StringUtils.php"; $locationSeq = 6; //$locationSeq = 3; $location = LocationDataStore::getInstance()->FindBySeq($locationSeq); $div = ""; $message = ""; if ($_POST["submit"] != "") { $username = $_POST['username']; $password = $_POST['userpassword']; $message = validator::validateform("User Name", $username, 56, false); if ($messageText != null && $messageText != "") { $messageText = $messageText . "<br/>" . validator::validateform("Password", $password, 56, false); } else { $messageText = validator::validateform("Password", $password, 56, false); } if ($messageText == "") { $UDS = UserDataStore::getInstance(); $user = $UDS->FindByUserName($username); if ($user != null && $user != "") {