protected function example()
 {
     global $db;
     $params = array();
     if ($this->method == "GET") {
         if (sizeof($this->args) == 2) {
             if ($this->args[0] == "data") {
                 $main_arg = $this->args[1];
                 if (is_numeric($main_arg)) {
                     $params["eid"] = $main_arg;
                     return get_example_data($db, $params);
                 } else {
                     return "The eid you passed in is not a number!";
                 }
             } else {
                 $this->args[0] == "id" ? $type = "id" : ($type = "name");
                 $main_arg = $this->args[1];
                 if ($type == "id") {
                     $params["eid"] = $main_arg;
                 } else {
                     if ($type == "name") {
                         $params["ename"] = $main_arg;
                     } else {
                         return "The type of parameter you are passing in is not valid!";
                     }
                 }
                 return get_examples($db, $params);
             }
         } else {
             return "The number of parameters is not correct!";
         }
     } else {
         return "This only accepts GET requests!";
     }
 }
Example #2
0
    }
    $ts = strtotime($dateStr);
    if ($ts === false) {
        return '';
    }
    return date($format, $ts);
}
####### Following section under development 1/20/13, to allow user to load example files. ######
$get_example = isset($_GET['example']) ? $_GET['example'] : "";
if ($get_example != "") {
    $Xmple = mysql_real_escape_string($_GET['example']);
    $Xmple = strval($Xmple);
    //convert to string for safety
    if ($Xmple > 0 && $Xmple < 10) {
        $filename = "/xGDBvm/examples/example" . $Xmple . "/GenomesExample" . $Xmple . ".txt";
        $data = get_example_data($filename);
        #get array of example data (conf_functions.inc.php)
    }
    ####### Preceding section under development 1/20/13 ######
} else {
    # read values from GDB table
    while ($data = mysql_fetch_array($check_get_data)) {
        $current_class = "";
        //assigned below
        ####### Defaults ######
        $Update_Data_Default = "/xGDBvm/data/";
        $CpGAT_Data_Default = "/xGDBvm/data/";
        ####### General Info #######
        $ID = $id;
        #post or get result.
        $DBid = 'GDB' . substr('00' . $id, -3);