$type = $params['type']; $query = $params['query']; $page = $params['page']; $limit = $params['limit']; $sort = $params['sort']; if ($action == "search") { $data = searchVisualizations($query, $page, $limit, $sort); } else { $data = browseVisualizationsByTimeCreated($page, $limit); } $status = 200; break; case "getSessions": if (isset($_REQUEST['experiment'])) { $id = safeString($_REQUEST['experiment']); $dataset = getSessionsForExperiment($id); if ($dataset) { $data = $dataset; $status = 200; } } break; case "getExperimentFields": if (isset($_REQUEST['experiment'])) { $id = safeString($_REQUEST['experiment']); $dataset = getFields($id); if ($dataset) { $data = $dataset; $status = 200; } }
case "passreset": $uids = explode(":", $_GET['uids']); foreach ($uids as $uid) { resetPass($uid); } break; case "migratetime": $exp = getAllExperiments(); $eresults = array(); $counts = array("total" => 0, "Human Readable" => 0, "Human Readable - Unparsable" => 0, "Can not find time field" => 0, "Not Human Readable" => 0, "Unknown" => 0, "No Sessions Found" => 0, "Experiment Does Not Use Time" => 0); foreach ($exp as $e) { $eid = $e['experiment_id']; // echo $eid . "<br/>"; if (($field_name = experimentHasTime($eid)) !== FALSE) { $session_types = array(); $sessions = getSessionsForExperiment($eid); if ($sessions != FALSE) { //foreach($sessions as $session) { for ($i = 0; $i < count($sessions); $i++) { $session = $sessions[$i]; $field_name = strtolower($field_name); $results = $mdb->find("e{$eid}", array("session" => (int) $session['session_id']), array($field_name => 1)); $time_fail = false; $type = "Unknown"; foreach ($results as $result) { if (isset($result[$field_name])) { $val = $result[$field_name]; } else { if (isset($result[ucwords($field_name)])) { $val = $result[ucwords($field_name)]; } else {
* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ require_once '../includes/config.php'; header('Content-Type: application/x-javascript'); $data = array(); if (isset($_GET['id'])) { $eid = (int) safeString($_GET['id']); $data = getSessionsForExperiment($eid); } $data = json_encode($data); ?> var DATA = <?php echo $data; ?> ; var STATE = <?php echo '""'; ?> ;