Skip to content

Commit

Permalink
Removed unused methods in Maintanace controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Gu committed Dec 18, 2014
1 parent 90263a0 commit bf78adb
Showing 1 changed file with 1 addition and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,7 @@ public function crontabAction() {
endif;
endforeach;

echo "NGINAD MAINTENANCE<br />\n";
exit;
}

public function excelAction() {
define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
// Create new PHPExcel object
echo date('H:i:s'), " Create new PHPExcel object", EOL;
$objPHPExcel = new \PHPExcel();

var_dump($objPHPExcel);
echo "EXCEL MAINTENANCE ACTION<br />\n";
echo "NGINAD MAINTENANCE\n";
exit;
}

Expand Down Expand Up @@ -216,69 +205,4 @@ private function updateAdCampaignBannerTotals() {
endforeach;
}

private function getPerTime($obj, $config, $is_admin, $extra_params = null) {


$params = $this->params()->fromQuery();
if (!empty($params['step'])) {
$step = $params['step'];
} else {
$step = 1;
}

$DateCreatedGreater = date('Y-m-d H:i:s', time() - 15 * $step * 60);
$DateCreatedLower = date('Y-m-d H:i:s', time() - 15 * ($step - 1) * 60);

if (!empty($params['step'])) {

switch ($params['interval']) {

case '0':
$where_params = array(
'DateCreatedGreater' => $DateCreatedGreater,
'DateCreatedLower' => $DateCreatedLower,
);
break;

case '1':
$where_params = array(
'DateCreatedGreater' => ($params['time_from'] < $params['time_to']) ? $params['time_from'] : $params['time_to'],
'DateCreatedLower' => ($params['time_from'] > $params['time_to']) ? $params['time_from'] : $params['time_to'],
);
break;

default:
return false;
break;
}
} else {
$where_params = array(
'DateCreatedGreater' => $DateCreatedGreater,
'DateCreatedLower' => $DateCreatedLower,
);
}

if ($extra_params !== null && count($extra_params) > 0):
foreach ($extra_params as $key => $value):
$where_params[$key] = $value;
endforeach;
endif;


if (!empty($params['refresh'])) {
$refresh = true;
} else {
$refresh = false;
}

$data = array(
// 'data' => $obj->getPerTimeCached($config, $where_params, 900, $refresh, $is_admin),
'data' => $obj->getPerTime($where_params),
'step' => $step
);

return json_encode($data);

}

}

0 comments on commit bf78adb

Please sign in to comment.