private function addFilter(&$query, $id, $active, $table, $table_id, $user_id, $title, $description, $date, $symble_date, $order_type) { if ($id > 0) { $query .= " AND id = '" . DataHandler::forceInt($id) . "'"; } if ($active !== NULL) { $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'"; } if ($table !== NULL) { $query .= " AND `table` = '" . DataHandler::forceString($table) . "'"; } if ($table_id > 0) { $query .= " AND `table_id` = '" . DataHandler::forceInt($table_id) . "'"; } if ($user_id > 0) { $query .= " AND `user_id` = '" . DataHandler::forceInt($user_id) . "'"; } if ($title !== NULL) { $query .= " AND `title` = '" . DataHandler::forceString($title) . "'"; } if ($description !== NULL) { $query .= " AND `description` = '" . DataHandler::forceString($description) . "'"; } if ($date !== NULL) { $symble_date = parent::compareSimble($symble_date); $date = parent::dateHandlerScape($date); $query .= " AND `date` {$symble_date} {$date} "; } //adiciona a ordenação na query $orderBy = ""; if ($order_type != NULL) { $order_type = parent::verifyOrderType($order_type); $orderBy .= ", `order` " . $order_type; } if ($orderBy != NULL) { $query .= " ORDER BY " . $orderBy; } $query .= "ORDER BY date DESC"; }
private function addFilter(&$query, $id, $active, $name, $link, $content, $image_url, $date, $date_symbol, $date_in, $date_in_symbol, $date_out, $date_out_symbol, $order_type) { if ($id !== NULL) { $query .= " AND id = '" . DataHandler::forceInt($id) . "'"; } if ($active !== NULL) { $query .= " AND `active` = '" . DataHandler::forceInt($active) . "'"; } if ($name !== NULL) { $query .= " AND `name` = '" . DataHandler::forceString($name) . "'"; } if ($link !== NULL) { $query .= " AND `link` = '" . DataHandler::forceString($link) . "'"; } if ($content !== NULL) { $query .= " AND `content` = '" . DataHandler::forceString($content) . "'"; } if ($image_url !== NULL) { $query .= " AND `image_url` = '" . DataHandler::removeSpecialCharacters($image_url) . "'"; } if ($date !== NULL) { $date_symbol = parent::compareSimble($date_symbol); $date = parent::dateHandlerScape($date); $query .= " AND `date` {$date_symbol} {$date} "; } if ($date_in !== NULL) { $date_in_symbol = parent::compareSimble($date_in_symbol); $date_in = parent::dateHandlerScape($date_in); $query .= " AND `date_in` {$date_in_symbol} {$date_in} "; } if ($date_out !== NULL) { $date_out_symbol = parent::compareSimble($date_out_symbol); $date_out = parent::dateHandlerScape($date_out); $query .= " AND `date_out` {$date_out_symbol} {$date_out} "; } //adiciona a ordenação na query $orderBy = ""; if ($order_type != NULL) { $order_type = parent::verifyOrderType($order_type); $orderBy .= ", `order` " . $order_type; } if ($orderBy != NULL) { $query .= " ORDER BY " . $orderBy; } }
private function addFilter(&$query, $id, $active, $name, $title, $hat, $description, $content, $author, $template_url, $slug, $key_words, $date, $date_symbol, $date_in, $date_in_symbol, $date_out, $date_out_symbol, $order_type) { if ($id !== NULL) { $query .= " AND `content`.id = '" . DataHandler::forceInt($id) . "'"; } if ($active !== NULL) { $query .= " AND `content`.active = '" . DataHandler::forceInt($active) . "'"; } if ($name !== NULL) { $query .= " AND `content`.name = '" . DataHandler::forceString($name) . "'"; } if ($title !== NULL) { $query .= " AND `content`.title = '" . DataHandler::forceString($title) . "'"; } if ($hat !== NULL) { $query .= " AND `content`.hat = '" . DataHandler::forceString($hat) . "'"; } if ($description !== NULL) { $query .= " AND `content`.description = '" . DataHandler::forceString($description) . "'"; } if ($content !== NULL) { $query .= " AND `content`.content = '" . DataHandler::forceString($content) . "'"; } if ($author !== NULL) { $query .= " AND `content`.author = '" . DataHandler::forceString($author) . "'"; } if ($template_url !== NULL) { $query .= " AND `content`.template_url = '" . DataHandler::removeSpecialCharacters($template_url) . "'"; } if ($slug !== NULL) { $query .= " AND `content`.slug = '" . DataHandler::removeSpecialCharacters($slug) . "'"; } if ($key_words !== NULL) { $query .= " AND `content`.key_words = '" . DataHandler::removeSpecialCharacters($key_words) . "'"; } if ($date !== NULL) { $date_symbol = parent::compareSimble($date_symbol); $date = parent::dateHandlerScape($date); $query .= " AND `date` {$date_symbol} {$date} "; } if ($date_in !== NULL) { $date_in_symbol = parent::compareSimble($date_in_symbol); $date_in = parent::dateHandlerScape($date_in); $query .= " AND `date_in` {$date_in_symbol} {$date_in} "; } if ($date_out !== NULL) { $date_out_symbol = parent::compareSimble($date_out_symbol); $date_out = parent::dateHandlerScape($date_out); $query .= " AND `date_out` {$date_out_symbol} {$date_out} "; } //adiciona a ordenação na query $orderBy = ""; if ($order_type != NULL) { $order_type = parent::verifyOrderType($order_type); $orderBy .= ", `order` " . $order_type; } if ($orderBy != NULL) { $query .= " ORDER BY " . $orderBy; } }
private function addFilter(&$query, $id = NULL, $address_id = NULL, $name = NULL, $last_name = NULL, $birthday = NULL, $mobile = NULL, $telephone = NULL, $email = NULL, $rg = NULL, $cpf = NULL, $company = NULL, $website = NULL, $sex = NULL, $recive_news = NULL, $registred = NULL, $user_type_id = NULL, $date = NULL, $date_symbol = ">=") { if ($id !== NULL) { $query .= " AND user.id = '" . DataHandler::forceInt($id) . "'"; } if ($name !== NULL) { $query .= " AND `name` LIKE '%" . DataHandler::forceString($name) . "%'"; } if ($last_name !== NULL) { $query .= " AND `last_name` ='" . DataHandler::forceString($last_name) . "'"; } if ($birthday !== NULL) { $query .= " AND `birthday` =" . $this->dateHandlerScape($birthday); } if ($mobile !== NULL) { $query .= " AND `mobile` ='" . DataHandler::forceString($mobile) . "'"; } if ($telephone !== NULL) { $query .= " AND `telephone` ='" . DataHandler::forceString($telephone) . "'"; } if ($email !== NULL) { $query .= " AND `email` ='" . DataHandler::forceString($email) . "'"; } if ($rg !== NULL) { $query .= " AND `rg` ='" . DataHandler::forceString($rg) . "'"; } if ($cpf !== NULL) { $query .= " AND `cpf` ='" . DataHandler::forceString($cpf) . "'"; } if ($company !== NULL) { $query .= " AND `company` ='" . DataHandler::forceString($company) . "'"; } if ($website !== NULL) { $query .= " AND `website` ='" . DataHandler::forceString($website) . "'"; } if ($sex !== NULL) { $query .= " AND `sex` ='" . DataHandler::forceInt($sex) . "'"; } if ($recive_news !== NULL) { $query .= " AND `recive_news` ='" . DataHandler::forceInt($recive_news) . "'"; } if ($registred !== NULL) { $query .= " AND `registred` =" . $this->dateHandlerScape($registred) . ""; } if ($user_type_id != NULL) { $query .= " AND `user_type_id` =" . DataHandler::forceInt($user_type_id) . ""; } if ($date !== NULL) { $date_symbol = parent::compareSimble($date_symbol); $date = parent::dateHandlerScape(DataHandler::convertDateToDB($date)); $query .= " AND `registred` {$date_symbol} {$date} "; } }