protected function print_experiment_information($exp, $descr, $res) { ?> <div id="exp-info-header"> <?php echo $this->get_experiment_icon($exp); ?> <span class="exp-title"><?php echo $exp->get_name(); ?> </span> </div> <?php $startDate = NelioABFormatter::format_date($exp->get_start_date()); $end = $exp->get_end_date(); if (empty($end)) { $running = __('Started on', 'nelioab') . ' ' . $startDate; } else { $endDate = NelioABFormatter::format_date($end); $running = $startDate . '—' . $endDate; } if ($res == null && $exp->get_status() == NelioABExperiment::STATUS_FINISHED) { $duration = NelioABFormatter::get_timelapse($exp->get_start_date(), $exp->get_end_date()); } else { if ($res == null) { $duration = __('Not available', 'nelioab'); } else { $duration = NelioABFormatter::get_timelapse($exp->get_start_date(), $res->get_last_update()); } } ?> <div id="exp-info-running-time"> <span class="exp-info-header"><?php _e('Duration', 'nelioab'); ?> </span> <span class="exp-info-duration"><?php echo $duration; ?> </span> <span class="exp-info-running-values"><?php echo $running; ?> </span> </div> <?php $end_mode = __('The experiment can only be stopped manually', 'nelioab'); if ($exp->get_status() == NelioABExperiment::STATUS_RUNNING && NelioABAccountSettings::get_subscription_plan() >= NelioABAccountSettings::ENTERPRISE_SUBSCRIPTION_PLAN) { switch ($exp->get_finalization_mode()) { case NelioABExperiment::FINALIZATION_MANUAL: $end_mode = __('The experiment can only be stopped manually', 'nelioab'); break; case NelioABExperiment::FINALIZATION_AFTER_DATE: $raw_fin_value = $exp->get_finalization_value(); $fin_value = __('24 hours', 'nelioab'); if ($raw_fin_value >= 2) { $fin_value = __('48 hours', 'nelioab'); } if ($raw_fin_value >= 5) { $fin_value = __('5 days', 'nelioab'); } if ($raw_fin_value >= 7) { $fin_value = __('1 week', 'nelioab'); } if ($raw_fin_value >= 14) { $fin_value = __('2 weeks', 'nelioab'); } if ($raw_fin_value >= 30) { $fin_value = __('1 month', 'nelioab'); } if ($raw_fin_value >= 60) { $fin_value = __('2 months', 'nelioab'); } $end_mode = sprintf(__('The experiment will be automatically stopped %s after it was started.', 'nelioab'), $fin_value); break; case NelioABExperiment::FINALIZATION_AFTER_VIEWS: $end_mode = sprintf(__('The experiment will be automatically stopped when the tested page (along with its alternatives) has been seen over %s times.', 'nelioab'), $exp->get_finalization_value()); break; case NelioABExperiment::FINALIZATION_AFTER_CONFIDENCE: $end_mode = sprintf(__('The experiment will be automatically stopped when confidence reaches %s%%.', 'nelioab'), $exp->get_finalization_value()); break; } } ?> <div id="exp-info-end-mode"> <span><?php _e('Finalization Mode', 'nelioab'); ?> </span> <span class="exp-end-mode"><?php echo $end_mode; ?> </span> </div> <?php if (empty($descr)) { $descr = __('No description provided', 'nelioab'); } ?> <div id="exp-info-descr"> <span><?php _e('Description', 'nelioab'); ?> </span> <span><?php echo $descr; ?> </span> </div> <?php }