|
13
|
public static function addNews($author, $title, $content, $image, $type) {
|
13
|
public static function addNews($author, $title, $content, $image, $type) {
|
|
16
|
$type = filter_var(trim($type), FILTER_SANITIZE_NUMBER_INT);
|
17
|
$type = filter_var(trim($type), FILTER_SANITIZE_NUMBER_INT);
|
|
17
|
$sql = "INSERT INTO `news` (`id`, `author`, `time`, `title`, `type`, `content`, `img`) VALUES (NULL, '$author', '" . $time->getTimestamp() . "', '$title', '$type', '$content', '$image');";
|
18
|
$sql = "INSERT INTO `news` (`id`, `author`, `time`, `title`, `type`, `content`, `img`) VALUES (NULL, '$author', '" . $time->getTimestamp() . "', '$title', '$type', '$content', '$image');";
|
|
23
|
public static function editNews($id, $title, $content, $image, $type) {
|
24
|
public static function editNews($id, $title, $content, $image, $type) {
|
|
25
|
$type = filter_var(trim($type), FILTER_SANITIZE_NUMBER_INT);
|
27
|
$type = filter_var(trim($type), FILTER_SANITIZE_NUMBER_INT);
|
|
27
|
$sql = "UPDATE `news` SET `title` = '$title', `img` = '$image', `content` = '$content', `type` = '$type' WHERE `news`.`id` = $id;";
|
29
|
$sql = "UPDATE `news` SET `title` = '$title', `img` = '$image', `content` = '$content', `type` = '$type' WHERE `news`.`id` = $id;";
|