changeAccess($cid[0], 0);
        break;
    case 'accessregistered':
        changeAccess($cid[0], 1);
        break;
    case 'accessspecial':
        changeAccess($cid[0], 2);
        break;
    case 'saveorder':
        saveOrder($cid);
        break;
    case 'cancel':
        cancelStudent();
        break;
    default:
        showStudent($option);
        break;
}
/**
* List the records
* @param string The current GET/POST option
*/
function showStudent($option)
{
    global $mainframe;
    $db =& JFactory::getDBO();
    $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
    $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
    // get the total number of records
    $query = 'SELECT COUNT(*)' . ' FROM #__contact_details ';
    $db->setQuery($query);
<?php

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    include 'connection.php';
    showStudent();
}
function showStudent()
{
    global $connect;
    $query = " Select * FROM STUDENT; ";
    $result = mysqli_query($connect, $query);
    $number_of_rows = mysqli_num_rows($result);
    $temp_array = array();
    if ($number_of_rows > 0) {
        while ($row = mysqli_fetch_assoc($result)) {
            $temp_array[] = $row;
        }
    }
    header('Content-Type: application/json');
    echo json_encode(array("students" => $temp_array));
    mysqli_close($connect);
}