mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-12-23 17:11:26 +03:00
24 lines
474 B
PHP
24 lines
474 B
PHP
|
<?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
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
}
|