* Copyright (c) 2014 Renaissance Computing Institute. All rights reserved. * * This software is open source. See the bottom of this file for the license. * * Renaissance Computing Institute, * (A Joint Institute between the University of North Carolina at Chapel Hill, * North Carolina State University, and Duke University) * http://www.renci.org * * For questions, comments please contact software@renci.org * */ // get the user session helper object include_once 'UserHelper.php'; // get the user info object from the session $userObj = getUserSessionObj(); // is the user logged in if (!isset($userObj)) { header('Location: ../Login/Login.php'); } /** * * Creates HTML for a pulldown from a general php array * The optional javascript $onChangeJS may contain single quotes, but not double * quotes. * * @param $name * @param $id * @param $display * @param $selectedVal * @param $onChangeJS
* North Carolina State University, and Duke University) * http://www.renci.org * * For questions, comments please contact software@renci.org * */ // include the site constants include_once "Constants.php"; // include the for parameter helper include_once "GetFormParams.php"; // include the form element helpers include_once "FormsUtil.php"; // get the user session helper object include_once 'UserHelper.php'; // get the user info object from the session $userInfo = getUserSessionObj(); // init the validation variables $validationMessage = 'Functionality not implemented yet'; $validated = true; // get whether they clicked proceed or other possible info getExtraParams(array("Update")); // set the title name to be displayed in the header $title = "Note details"; // output the basic header HTML include "../Includes/header.php"; // message for the user on post operations if (isset($validationMessage) && !empty($validationMessage)) { echo '<div class="' . ($validated == true ? 'info' : 'err') . '">' . $validationMessage . '</div>'; } // create a new form echo '<form action="NoteDetails.php" method="post">';
/** * Sets the evidence data for the passed in loc var ID * */ function doSetEvidence($geneName, $name, $type, $value) { // init a evidence data element $evidence = null; // init a index $i = 0; // get the user info object from the session $userObj = getUserSessionObj(); // do we have a evidence object if (isset($userObj->Evidence)) { // find the evidence if it exists foreach ($userObj->Evidence as $item) { // is this the one we are looking for if ($item->geneName == $geneName) { // save the evidence $evidence = $item; // no need to continue break; } //increment the index counter $i++; } } // does the evidence already exist if (isset($evidence)) { // overwrite the current value $userObj->Evidence[$i]->value = $value; echo '{"error": "doSetEvidence(' . $geneName . ') - Data overwritten"}'; } else { // create a new evidence object $evidence = new Evidence(); // save the data in the object $evidence->setData($geneName, $name, $value, $type); // and save it to the user object $userObj->Evidence[] = $evidence; // encode and send the data echo '{"data":' . json_encode($evidence) . '}'; } // terminate the data stream die; }