Beispiel #1
0
<?php

$array = array();
$array = $_REQUEST;
$user_model = new user_model();
if (!empty($array['listuser'])) {
    if ($array['page_number'] == NULL) {
        $page_number = 0;
    } else {
        $page_number = $array['page_number'];
    }
    $start = $page_number;
    $limit = 8;
    $total_record = $user_model->totalPage('tbl_user');
    $total_page = ceil($total_record / $limit);
    if ($total_record >= $page_number) {
        $data = array();
        $data = $user_model->listUser($start, $limit);
        $response['code'] = 0;
        $response['status'] = $user_model::$api_response_code[$response['code']]['HTTP Response'];
        $response['data'] = $data;
        $response['start'] = $start;
        $response['limit'] = $limit;
        $response['totalpage'] = $total_page;
        $user_model->deliver_response($response);
    } else {
        $response['code'] = 23;
        $response['status'] = $trade_model::$api_response_code[$response['code']]['HTTP Response'];
        $response['data'] = $trade_model::$api_response_code[$response['code']]['Message'];
        $trade_model->deliver_response($response);
    }