<?php

/*
 * awframework from aw.inc present aw controller
 * it will help you develop easy and fast with secure tools
 * you can edit and add what you feel right
 * don't change in strucure of file
 */

# the action get from request
$action = filter_input(INPUT_GET, 'ac');
if (!$action) {
    $action = 'index';
}
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    $ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
    $ip = $_SERVER['REMOTE_ADDR'];
}

#here call the class and function
$call_func = new Controllers();

//logger()->addInfo($_SERVER['REQUEST_URI'],[$action,$_SESSION['user_name'],'start time',date('Y-m-d H:i:s'),$ip]);

//check if there mehod or not
if (method_exists($call_func, $action)) {
    $call_func->$action();
} else {
    $call_func->index();
}

//logger()->addInfo($_SERVER['REQUEST_URI'],[$action,$_SESSION['user_name'],'end time',date('Y-m-d H:i:s'),$ip]);
//logger()->addInfo("=====================================================================================================");
