Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
style and typo correction
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 committed Oct 28, 2019
1 parent 9888c69 commit 11c505f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
include_once _CENTREON_PATH_ . "www/class/centreonService.class.php";

// Create XML Request Objects
CentreonSession::start();
CentreonSession::start();
$obj = new CentreonXMLBGRequest($dependencyInjector, session_id(), 1, 1, 0, 1);
$svcObj = new CentreonService($obj->DB);

Expand All @@ -68,8 +68,8 @@
$sort_type = $obj->checkArgument("sort_type", $_GET, "host_name");
$order = $obj->checkArgument("order", $_GET, "ASC");
$dateFormat = $obj->checkArgument("date_time_format_status", $_GET, "Y/m/d H:i:s");
$queryValues = array();
$queryValues2 = array();
$queryValues = [];
$queryValues2 = [];

// Backup poller selection
$obj->setInstanceHistory($instance);
Expand Down Expand Up @@ -128,7 +128,7 @@
if ($hSearch != "") {
$h_search .= " AND h.name LIKE :hSearch ";
// as this partial request is used in two queries, we need to bound it two times using two arrays
//to avoid unconsistent number of bound variables in the second query
// to avoid incoherent number of bound variables in the second query
$queryValues['hSearch'] = $queryValues2['hSearch'] = [
\PDO::PARAM_STR => "%" . $hSearch . "%"
];
Expand All @@ -145,13 +145,12 @@
\PDO::PARAM_INT => $instance
];
}
$query .= " ORDER BY sg.name " . $order
. " LIMIT :numLimit, :limit";
$query .= " ORDER BY sg.name " . $order . " LIMIT :numLimit, :limit";
$queryValues['numLimit'] = [
\PDO::PARAM_INT => (int) ($num * $limit)
\PDO::PARAM_INT => (int)($num * $limit)
];
$queryValues['limit'] = [
\PDO::PARAM_INT => (int) $limit
\PDO::PARAM_INT => (int)$limit
];

$dbResult = $obj->DBC->prepare($query);
Expand Down Expand Up @@ -200,8 +199,8 @@
if ($sgSearch != "") {
$sg_search .= "AND sg.name = :sgSearch";
$queryValues2['sgSearch'] = [
\PDO::PARAM_STR => $sgSearch
];
\PDO::PARAM_STR => $sgSearch
];
}

$query2 = "SELECT SQL_CALC_FOUND_ROWS DISTINCT sg.name AS sg_name,
Expand All @@ -228,7 +227,7 @@
$obj->access->queryBuilder("AND", "group_id", $obj->access->getAccessGroupsString()) . " " .
$obj->access->queryBuilder("AND", "sg.servicegroup_id", $obj->access->getServiceGroupsString("ID")) . " ";
}
$query2 .= $sg_search . $h_search . $s_search . " ORDER BY sg.name, tri ASC";
$query2 .= $sg_search . $h_search . $s_search . " ORDER BY sg_name, tri ASC";

$dbResult = $obj->DBC->prepare($query2);
foreach ($queryValues2 as $bindId => $bindData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
if ($hSearch != "") {
$h_search .= " AND h.name LIKE :hSearch ";
// as this partial request is used in two queries, we need to bound it two times using two arrays
//to avoid unconsistent number of bound variables in the second query
// to avoid incoherent number of bound variables in the second query
$queryValues['hSearch'] = $queryValues2['hSearch'] = [
\PDO::PARAM_STR => "%" . $hSearch . "%"
];
Expand All @@ -150,10 +150,10 @@

$query .= "ORDER BY sg.name " . $order . " LIMIT :numLimit, :limit";
$queryValues['numLimit'] = [
\PDO::PARAM_INT => (int) ($num * $limit)
\PDO::PARAM_INT => (int)($num * $limit)
];
$queryValues['limit'] = [
\PDO::PARAM_INT => (int) $limit
\PDO::PARAM_INT => (int)$limit
];

$dbResult = $obj->DBC->prepare($query);
Expand Down

0 comments on commit 11c505f

Please sign in to comment.