function display_data($table_name, $type)
{
    $acl = new data_manipulation();
    $get = $acl->get_data($table_name);
    foreach ($get as $key => $value) {
        $val = $value[$type];
        echo "<option value='{$val}'>{$val}</option>";
    }
}
function user_info()
{
    $acl = new data_manipulation();
    $get_user_info = json_encode($acl->get_data('user'));
    return $get_user_info;
}
<?php

require_once 'acl_class.php';
if (isset($_POST['role_id'])) {
    $acl = new data_manipulation();
    $role_id = $_POST['role_id'];
    $length = strlen($role_id);
    $x = strpos($role_id, 'role');
    $role_id = (int) substr($role_id, $x + 4, $length - $x - 4);
    if (isset($_POST['id'])) {
        $acl->delete_data('manage_privilege', 'role_id', $role_id);
        foreach ($_POST['id'] as $key => $value) {
            $a['val'] = $value;
            $length = strlen($a['val']);
            $x = strpos($a['val'], 'action');
            // substr(string,starting position,length of substing to be extracted)
            $resource_id = (int) substr($a['val'], 8, $x - 8);
            $action_id = (int) substr($a['val'], $x + 6, $length - $x - 6);
            $acl->assign_privilege($role_id, $resource_id, $action_id);
        }
    }
}
echo json_encode($a);
?>

function display_data($table_name)
{
    $acl = new data_manipulation();
    $get = $acl->get_data($table_name);
    return $get;
}
<?php

error_reporting(-1);
ini_set('display_errors', 'On');
$acl = new data_manipulation();
// for role
if (isset($_POST['add_role'])) {
    $text = $_POST['role_type'];
    $acl->add_data('role', 'role', $text);
}
if (isset($_POST['delete_role'])) {
    $text = $_POST['role'];
    $acl->delete_data('role', 'role', $text);
}
// for action
if (isset($_POST['add_action'])) {
    $text = $_POST['action_type'];
    $acl->add_data('action', 'operation', $text);
}
if (isset($_POST['delete_action'])) {
    $text = $_POST['action'];
    $acl->delete_data('action', 'operation', $text);
}
//for resource
if (isset($_POST['add_resource'])) {
    $text = $_POST['resource_type'];
    $acl->add_data('resource', 'resource', $text);
}
if (isset($_POST['delete_resource'])) {
    $text = $_POST['resource'];
    $acl->delete_data('resource', 'resource', $text);