Skip to content

Commit

Permalink
also video search into tags
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel authored and daniel committed Feb 15, 2019
1 parent 416b48f commit ead938a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions objects/bootGrid.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php
class BootGrid {

static function getSqlFromPost($searchFieldsNames = array(), $keyPrefix = "", $alternativeOrderBy = "") {
$sql = self::getSqlSearchFromPost($searchFieldsNames);

static function getSqlFromPost($searchFieldsNames = array(), $keyPrefix = "", $alternativeOrderBy = "", $doNotSearch=false) {
if(empty($doNotSearch)){
$sql = self::getSqlSearchFromPost($searchFieldsNames);
}else{
$sql = "";
}

if(empty($_POST['sort']) && !empty($_GET['order'][0]['dir'])){
$index = intval($_GET['order'][0]['column']);
Expand Down Expand Up @@ -37,7 +40,7 @@ static function getSqlFromPost($searchFieldsNames = array(), $keyPrefix = "", $a
return $sql;
}

static function getSqlSearchFromPost($searchFieldsNames = array()) {
static function getSqlSearchFromPost($searchFieldsNames = array(), $connection = "AND") {
$sql = "";
if(!empty($_POST['searchPhrase'])){
global $global;
Expand All @@ -48,9 +51,9 @@ static function getSqlSearchFromPost($searchFieldsNames = array()) {
$like[] = " {$value} LIKE '%{$search}%' ";
}
if(!empty($like)){
$sql .= " AND (". implode(" OR ", $like).")";
$sql .= " {$connection} (". implode(" OR ", $like).")";
}else{
$sql .= " AND 1=1 ";
$sql .= " {$connection} 1=1 ";
}
}

Expand Down

0 comments on commit ead938a

Please sign in to comment.