nativegallery/app/Controllers/Api/Admin/CreateNews.php

24 lines
474 B
PHP
Raw Normal View History

2024-07-21 17:22:27 +03:00
<?php
namespace App\Controllers\Api\Admin;
use App\Services\{Auth, Router, GenerateRandomStr, DB, Json, EXIF};
use App\Models\{User, Vote, Photo};
class CreateNews
{
public function __construct()
{
DB::query('INSERT INTO news VALUES (\'0\', :body, :time)', array(':body' => $_POST['body'], ':time' => time()));
echo json_encode(
array(
'errorcode' => 0,
'error' => 0
)
);
}
}