This is the my ApiController.php file:
<?php
/**
* Info Contoller Class
* @category Controller
*/
class ApiController extends BaseController
{
/**
* call model action to retrieve data
* @return json data
*/
function json($action, $arg1 = null, $arg2 = null)
{
$model = new SharedController;
$args = array($arg1, $arg2);
$data = call_user_func_array(array($model, $action), $args);
render_json($data);
}
function insertattendance()
{
if(!empty($_GET)){ // we check if the get variable is not empty.
$table_data = array(
$_GET['RFIDTAG'],
$_GET['Data'],
$_GET['Ora'],
$_GET['Stato']
);
$db = $this->GetModel();
$db->insert("attendance", $table_data);
}
}
This is the error produced:
Error Message
syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST)
File
C:\xampp\htdocs\alumniattendance\app\controllers\ApiController.php On Line 38
Stack Trace
1 unknown file(unknown line): autoloadController('ApiController')
2 unknown file(unknown line): spl_autoload_call('ApiController')
3 C:\xampp\htdocs\alumniattendance\system\Router.php(148): class_exists('ApiController', true)
4 C:\xampp\htdocs\alumniattendance\system\Router.php(109): Router->run('api/insertattendance/')
5 C:\xampp\htdocs\alumniattendance\index.php(106): Router->init()
Where i wrong ? Thanks in advance