/**
  * Method to get experiments of a particular time range
  * @param $inputs
  * @return array
  */
 public static function get_experiments_of_time_range($inputs)
 {
     $experimentStatistics = AdminUtilities::get_experiment_execution_statistics(strtotime($inputs["from-date"]) * 1000, strtotime($inputs["to-date"]) * 1000);
     $experiments = array();
     if ($inputs["status-type"] == "ALL") {
         $experiments = $experimentStatistics->allExperiments;
     } else {
         if ($inputs["status-type"] == "COMPLETED") {
             $experiments = $experimentStatistics->completedExperiments;
         } else {
             if ($inputs["status-type"] == "CREATED") {
                 $experiments = $experimentStatistics->createdExperiments;
             } else {
                 if ($inputs["status-type"] == "RUNNING") {
                     $experiments = $experimentStatistics->runningExperiments;
                 } elseif ($inputs["status-type"] == "FAILED") {
                     $experiments = $experimentStatistics->failedExperiments;
                 } else {
                     if ($inputs["status-type"] == "CANCELED") {
                         $experiments = $experimentStatistics->cancelledExperiments;
                     }
                 }
             }
         }
     }
     $expContainer = array();
     $expNum = 0;
     foreach ($experiments as $experiment) {
         $expValue = ExperimentUtilities::get_experiment_summary_values($experiment, true);
         $expContainer[$expNum]['experiment'] = $experiment;
         $expValue["editable"] = false;
         $expContainer[$expNum]['expValue'] = $expValue;
         $expNum++;
     }
     return $expContainer;
 }
 /**
  * Get results of the user's all experiments with pagination.
  * Results are ordered creation time DESC
  * @return array|null
  */
 public static function get_all_user_experiments_with_pagination($limit, $offset)
 {
     $experiments = array();
     try {
         $experiments = Airavata::getUserExperiments(Session::get('authz-token'), Session::get('gateway_id'), Session::get('username'), $limit, $offset);
     } catch (InvalidRequestException $ire) {
         CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
     } catch (AiravataClientException $ace) {
         CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
     } catch (AiravataSystemException $ase) {
         if ($ase->airavataErrorType == 2) {
             CommonUtilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
                             <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
                             <a href="create_project.php">here</a> to create a new project.</p>');
         } else {
             CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
             //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
         }
     } catch (TTransportException $tte) {
         CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
     }
     //get values of all experiments
     $expContainer = array();
     $expNum = 0;
     foreach ($experiments as $experiment) {
         $expValue = ExperimentUtilities::get_experiment_summary_values($experiment, true);
         $expContainer[$expNum]['experiment'] = $experiment;
         if ($expValue["experimentStatusString"] == "FAILED") {
             $expValue["editable"] = false;
         }
         $expContainer[$expNum]['expValue'] = $expValue;
         $expNum++;
     }
     return $expContainer;
 }