/** * @remotable */ public function isLoggedIn($isDesktop = false) { $user = $this->getCurrentUser(); $success = is_object($user); $permissions = false; $pageRef = $this->getPageInfo(); $setupOrder = 0; $contactValue = array(); $login = null; $contactID = null; $orgID = null; $CI = get_instance(); //loading all the data $rec->ID = $orgID; $locationAPI = new LocationAPI(); $activityAPI = new ActivityAPI(); $siteSpecificAPI = new SiteConfigurationAPI(); $contactAPI = new ContactAPI(); $dimensionAPI = new DimensionValueAPI(); $incidentActivityAPI = new IncidentActivityAPI(); $incidentCauseAPI = new IncidentCauseAPI(); $bodyPartAPI = new BodyPartAPI(); $footwearAPI = new FootwearAPI(); $noiseAPI = new NoiseAPI(); $weatherAPI = new WeatherAPI(); $animalAPI = new AnimalAPI(); $clientAPI = new ClientAPI(); $contactAPI = new ContactAPI(); $incidentAPI = new IncidentAPI(); $activityDetailAPI = new ActivityDetailAPI(); $observationAPI = new ObservationAPI(); $allergyAPI = new AllergyDetailAPI(); $conditionAPI = new ClientSpecialcondDetailAPI(); $residentAidAPI = new AidDetailAPI(); $residentInjuryAPI = new IncidentBodypartAPI(); $qolScores = new QolScoreValueAPI(); $aidAPI = new AidAPI(); $returnValue = array(); if ($success) { $contactValue = $this->getContactValue($user->contactID); $contactID = $user->contactID; $role = $this->getSessionValue("userRole"); $setupOrder = $role == 1 ? $user->lastSetupOrder : 999; $permissions = $this->getPermissions($role); $orgID = $user->orgID; $login = $user->login; } $returnValue = array("success" => $success, "permissions" => $permissions, "orgID" => $orgID, "pageRef" => $pageRef, "setupOrder" => $setupOrder, "contactValue" => $contactValue, "login" => $login, "contactID" => $contactID, "loggedUID" => $this->getUserID(), "sessionTimeOut" => $CI->session->sess_expiration); if ($success && !$isDesktop) { $returnValue["LocationList"] = $locationAPI->listAll($rec); $returnValue["ActivityValueList"] = $activityAPI->listAll($rec); $returnValue["SiteSpecific"] = $siteSpecificAPI->listAll($rec); $returnValue["UserList"] = $contactAPI->listAll($rec); $returnValue["DimensionList"] = $dimensionAPI->listAll($rec); $returnValue["IncidentActivityList"] = $incidentActivityAPI->listAll($rec); $returnValue["IncidentCauseList"] = $incidentCauseAPI->listAll($rec); $returnValue["FootwearList"] = $footwearAPI->listAll($rec); $returnValue["NoiseList"] = $noiseAPI->listAll($rec); $returnValue["WeatherList"] = $weatherAPI->listAll($rec); $returnValue["AnimalList"] = $animalAPI->listAll($rec); $returnValue["ResidentList"] = $clientAPI->listAll($rec); $returnValue["StaffList"] = $contactAPI->listAll($rec); $returnValue["IncidentList"] = $incidentAPI->listAll($rec); $returnValue["ActivityList"] = $activityDetailAPI->listAll($rec); $returnValue["ObservationList"] = $observationAPI->listAll($rec); $returnValue["AllergyList"] = $allergyAPI->listAll($rec); $returnValue["ConditionList"] = $conditionAPI->listAll($rec); $returnValue["ResidentAidList"] = $residentAidAPI->listAll($rec); $returnValue["ResidentInjuryList"] = $residentInjuryAPI->listAll($rec); $returnValue["BodyPartList"] = $bodyPartAPI->listAll($rec); $returnValue["QOLScoreList"] = $qolScores->listAll($rec); $rec->type = "aid"; $returnValue["AidList"] = $aidAPI->listAll($rec); } return $returnValue; }
<?php //Run defaultNoiseSetup $noise = new NoiseAPI(); echo $noise->defaultNoiseSetup(); //Run defaultLocationSetup $location = new LocationAPI(); echo $location->defaultLocationSetup(); //Run defaultActivitySetup $activity = new ActivityAPI(); echo $activity->defaultActivitySetup(); //Run defaultWeatherSetup $weather = new WeatherAPI(); echo $weather->defaultWeatherSetup(); //Run defaultAnimalSetup $animal = new AnimalAPI(); echo $animal->defaultAnimalSetup(); //Run dimensionDimensionSetup $dimension = new DimensionValueAPI(); echo $dimension->defaultDimensionSetup(); //Run dimensionQolScoreValue include "QolScoreValueAPI.php"; $qolScore = new QolScoreValueAPI(); echo $qolScore->defaultQolScoreValue();
<?php /* * ====================================== * PROJECT: SSL - LAB 0 PREP * FILE: controllers/Action_Controller.php * AUTHOR: Jana Nash-Siegle * CREATED: 12/8/2015 * ====================================== */ session_start(); include "models/Views.Class.php"; include "models/WeatherAPI.Class.php"; $views = new Views(); $api = new WeatherAPI(); // If action is *NOT* empty keep going.... if (!empty($_GET["action"])) { // if action is specified as home: if ($_GET["action"] == "home") { //Display only the default layout $views->getView("views/header.php"); $views->getView("views/form.php"); $views->getView("views/footer.php"); } //if action is specified as lookup: if ($_GET["action"] == "lookup") { // if the zip code has a value AND is not set = to empty: if (isset($_POST['tf_zip']) && !empty($_POST['tf_zip'])) { $zipcode = $_POST['tf_zip']; // then, store the zipcode in a variable } else {
//$this->my_pre($patterns);$this->my_pre($rep);exit; $html_content = str_replace($patterns, $rep, $html_content); return $html_content; } function addbraces(&$it) { return $it = "{{" . $it . "}}"; } function generate_xhtml($html) { $xhtml = <<<XHTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <meta charset="utf-8" /> <html xmlns="http://www.w3.org/1999/xhtml"> {myhtml} XHTML; $retxhtml = str_replace("{myhtml}", $html, $xhtml); return $retxhtml; } function my_pre($var) { echo "<pre>" . print_r($var, true); } } $weatherApi = new WeatherAPI(); $wobject = $weatherApi->parse_xml($question1->url); $parse_array = $weatherApi->get_key_array($wobject); $html = $weatherApi->get_weather_html_from_template($parse_array); echo $final_xhtml = $weatherApi->generate_xhtml($html);
<?php require_once '../core/initialize_application.php'; $carHotel = new CarAndHotelAPI($hotwireAPIKey); $carHotel->update_rates(); $weather = new WeatherAPI($weatherAPIKey); $weather->update_forecasts(); //$images = new ImageAPI($microsoftAPIKey); //$images->update_activity_images();