Initial commit

This commit is contained in:
Joey Kimsey
2024-08-04 21:15:59 -04:00
parent c9d1fb983f
commit 0d469501ee
695 changed files with 70184 additions and 71 deletions

View File

@ -0,0 +1,42 @@
<?php
/**
* app/controllers/api/users.php
*
* This is the users' api controller.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Controllers\Api;
use TheTempusProject\Models\User;
use TheTempusProject\Classes\ApiController;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Classes\Forms;
use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Models\Timers as Timer;
class Timers extends ApiController {
public static $timers;
public function __construct() {
parent::__construct();
self::$timers = new Timer;
Template::setTemplate( 'api' );
}
public function create() {
$name = Input::exists('name') ? Input::post('name') : '';
$type = Input::exists('type') ? Input::post('type') : 'stopwatch';
$currentSeconds = Input::exists('currentSeconds') ? Input::post('currentSeconds') : 0;
$pausedAt = 0;
$hours = Input::exists('hours') ? Input::post('hour') : '00';
$minutes = Input::exists('minutes') ? Input::post('minute') : '00';
$seconds = Input::exists('seconds') ? Input::post('seconds') : '00';
$response = self::$timers->create( $name, $currentSeconds, $type, $pausedAt, $hours, $minutes, $seconds);
Views::view( 'api.response', ['response' => json_encode( [ 'data' => $response ], true )]);
}
}