public function cloneExperiment()
 {
     if (isset($_GET['expId'])) {
         $cloneId = ExperimentUtilities::clone_experiment($_GET['expId']);
         $experiment = ExperimentUtilities::get_experiment($cloneId);
         $project = ProjectUtilities::get_project($experiment->projectId);
         $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
         $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
         return Redirect::to('experiment/edit?expId=' . $cloneId);
     }
 }
 public function expChange()
 {
     //var_dump( Input::all() ); exit;
     $experiment = ExperimentUtilities::get_experiment(Input::get('expId'));
     $project = ProjectUtilities::get_project($experiment->projectId);
     $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
     $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
     /*if (isset($_POST['save']))
             {
                 $updatedExperiment = CommonUtilities::apply_changes_to_experiment($experiment);
     
                 CommonUtilities::update_experiment($experiment->experimentId, $updatedExperiment);
             }*/
     if (isset($_POST['launch'])) {
         ExperimentUtilities::launch_experiment($experiment->experimentId);
         return Redirect::to('experiment/summary?expId=' . $experiment->experimentId);
     } elseif (isset($_POST['clone'])) {
         $cloneId = ExperimentUtilities::clone_experiment($experiment->experimentId);
         $experiment = ExperimentUtilities::get_experiment($cloneId);
         $project = ProjectUtilities::get_project($experiment->projectId);
         $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
         $expVal["jobState"] = ExperimentUtilities::get_job_status($experiment);
         return Redirect::to('experiment/edit?expId=' . $experiment->experimentId);
     } elseif (isset($_POST['cancel'])) {
         ExperimentUtilities::cancel_experiment($experiment->experimentId);
         return Redirect::to('experiment/summary?expId=' . $experiment->experimentId);
     }
 }