我想知道codeigniter中这个函数sorting()的位置

时间:2014-10-17 10:06:27

标签: codeigniter frameworks

我想知道codeigniter中这个sorting()函数的位置 致命错误:在

中调用未定义的函数排序() C:\xampp\htdocs\ezee\application\models\api_model.php

上的

line 559

今天只有我已经启动了codeigniter,只是我的老板给了文件夹,他要求使用codeIgniter文件,可以任何人指导我吗?

这是api_model.php下的代码 ?PHP的

class api_model扩展CI_Model {

function __construct() {
    $this->_namespace_id = _get_namespace_id();
    $this->_user_hash = _get_user_hash();
}

/* Verify login & get user auth token */

function getAuthToken($param) {
    return $this->_getJson('post', config_item('api_get_auth_token'), $param);
}

function getUserProfile($param) {
    $url = '/' . $param['authtoken'] . config_item('api_get_user_profile');
    return $this->_getJson('get', $url, $param);
}

/* Get user information from auth token */

function getUserInfo($param) {
    return $this->_getJson('get', config_item('api_get_auth_token'), $param);
}

function getStationsByState($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_station') . '/' . $param['statecode'];
    return $this->_getJson('get', $url, $param);
}

function updateStation($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_station');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getAllStates($param) {
    $url = '/' . $this->_user_hash . config_item('api_all_states');
    return $this->_getJson('get', $url, $param);
}

function getStationPointsByStation($param) {
    $url = '/' . $this->_user_hash . config_item('api_station_points') . '/' . $param['stationcode'];
    return $this->_getJson('get', $url, $param);
}

function updateStationPoint($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_station_point');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getRoutes($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_routes');
    return $this->_getJson('get', $url, $param);
}

function updateRoutesDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_routes');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getAmenities($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_amenities');
    return $this->_getJson('get', $url, $param);
}

function updateAmenitiesDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_amenties');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateNamespaceDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_namespace');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getGroup($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_Group');
    return $this->_getJson('get', $url, $param);
}

function updateGroupDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_Group');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getNamespaceStation($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_station_namespace');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getNamespaceStationPoint($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_stationpoints_namespace');
    return $this->_getJson('get', $url, $param);
}

function getAllNamespaceStation($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_station_namespace');
    //$param = json_encode($param);
    return $this->_getJson('post', $url, $param);
}

function updateNamespaceStation($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_station_namespace');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateNamespaceStationPoint($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_stationpoints_namespace');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

//  bus activities
function getBusCategory($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_bus_category');
    return $this->_getJson('get', $url, $param);
}

function getBusSeatType($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_bus_seattype');
    return $this->_getJson('get', $url, $param);
}

function getBuses($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_buses');
    return $this->_getJson('get', $url, $param);
}

function getBusbyCode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_buses') . '/' . $param['buscode'];
    return $this->_getJson('get', $url);
}

function getOrganization($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_organization');
    return $this->_getJson('get', $url, $param);
}

function updateOrganizationDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_organization');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getCredentials($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_credential');
    return $this->_getJson('get', $url, $param);
}

function updateCredentialDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_credential');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getSchedules($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_payment_schedule');
    return $this->_getJson('get', $url, $param);
}

function updatePaymentScheduleDetails($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_payment_schedule');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateRecharge($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_recharge');
    $param = json_encode($param);

    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getInventory($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_inventory');
    return $this->_getJson('get', $url, $param);
}

function updateInventory($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_inventory');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getTemplate($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_template');
    return $this->_getJson('get', $url, $param);
}

function getVehicle($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_vehicle');
    return $this->_getJson('get', $url, $param);
}

function updateVehicle($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_vehicle');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getNotifications($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_notification_admin');
    return $this->_getJson('get', $url, $param);
}



function updateAdminNotify($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_notification_admin');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateUserNotify($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_notification');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

 function updateTemplate($param) {
    $url = '/' . $this->_user_hash . config_item('api_update_template');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getUser($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_user');
    return $this->_getJson('get', $url, $param);
}

function getSchedulesBycode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule') . '/' . $param['code'];
    return $this->_getJson('get', $url, $param);
}

function getSchedulesStationPointsBycode($param) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_station_point') . '/' . $param['stationcode'];
    return $this->_getJson('get', $url, $param);
}

function getSchedulesStationBycode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_station') . '/' . $param['code'];
    return $this->_getJson('get', $url, $param);
}

function getBusSchedules($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_station') . '/' . $param['code'];
    return $this->_getJson('get', $url, $param);
}

function updateBus($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_buses');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateBusLayer($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_buses') . "/" . $param['buscode'] . "/layout/update";
    $param = json_encode($param['buslayer']);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getBusLayerbyCode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_buses') . '/' . $param['buscode'] . "/layout";
    return $this->_getJson('get', $url);
}

function getswitchNamespace($param = array()) {
    $url = config_item('api_auth_token') . '/' . $this->_user_hash . '/switch/' . $param['code'];
    return $this->_getJson('post', $url);
}

function getMenu($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_menu');
    return $this->_getJson('get', $url);
}

function getMenuPrivileges($param = array()) {
    $url = config_item('api_auth_token') . '/' . $this->_user_hash . config_item('api_get_menu_privileges');
    return $this->_getJson('post', $url);
}

function getGrpMenu($param = array()) {
    $param['rolename'] = 'NS';
    $url = '/' . $this->_user_hash . config_item('api_get_menu') . '/role/' . $param['rolename'];
    return $this->_getJson('post', $url);
}

function getGroupPrevilege($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_menu');
    return $this->_getJson('get', $url);
}

function updateMenu($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_menu') . "/update";
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updatePrivilege($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_menu') . '/role/' . $param['rolename'] . "/update";
    $param = json_encode($param['privilege']);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getRole($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_menu') . '/role/' . $param['rolename'];
    return $this->_getJson('post', $url);
}

function updateSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateStationSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_station');
    $param = json_encode($param);        
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateStationPointSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_station_point');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getBustypeScheduleBycode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_bustype') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function updateBustypeSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_bustype');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateRoutesFareSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_routes');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getRoutesFareScheduleByCode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_routes') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function getScheduleStationByCode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_station_code') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function updateCancelSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_cancellationterm');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getCancelScheduleByCode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_cancellationterm') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function updateBookingSchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_booking');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getBookingScheduleBycode($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_booking') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function updateSeatVisibilitySchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_schedule_seat');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getSeatVisibilitySchedule($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_seat') . '/' . $param['code'];
    return $this->_getJson('get', $url);
}

function updateSchedulesRefresh($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule') . '/' . $param['scheduleCode'] . '/refresh';
    return $this->_getJson('post', $url);
}

function getScheduleTrip($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_trip') . '/' . $param['tripDate'];
    return $this->_getJson('get', $url);
}

function getSearchBus($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_commerce_search') . '/' . $param['fromCode'] . '/' . $param['toCode'] . '/' . $param['tripDate'];
    return $this->_getJson('get', $url);
}

function getTripBusmap($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_commerce_search') . '/' . $param['fromCode'] . '/' . $param['toCode'] . '/' . $param['tripDate'];
    return $this->_getJson('get', $url);
}

function getScheduleByType($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_schedule_list') . '/' . $param['type'];
    return $this->_getJson('get', $url);
}

function updatePassengerDetails($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_commerce_passenger');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getScheduleBusMap($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_commerce_bus') . '/' . $param['stageCode'];
    return $this->_getJson('get', $url);
}

function ticketDetails($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_ticket_details') . '/' . $param['ticketCode'];
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function templateDetails($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_template_details') . '/' . $param['templateCode'];
    return $this->_getJson('get', $url);
}

function ticketCancelDetails($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_ticket_cancel_details') . '/' . $param['ticketCode'];
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function cancelTicket($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_ticket_cancel_details') . '/' . $param['ticketCode'] . '/confirm?cancellationOverRideFlag='.$param['cancellationOverRideFlag'].'&cancellationOverRideRefundAmount='.$param['cancellationOverRideRefundAmount'].'&seatCodeList='.$param['seatCodeList'];
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function approveVoucher($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_voucher');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateTicketConfim($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_ticket_confirm'). '/' . $param['ticketCode'];
    return $this->_getJson('post', $url, $param);
}

function updateTicketConfimByPhone($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_ticket_confirm_phone');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}
function updateTicketCancelByPhone($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_ticket_cancel_phone');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}
function updateTicketpayment($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_payment_request');
    return $this->_getJson('post', $url, $param);
}

function checkCancelBooking($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_ticket_confirm_phone') . '?' . $param['ticketCode'];
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getTripsHead($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_trips_head');
    return $this->_getJson('get', $url);
}
function getTripsTerms($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_ticket_cancel_terms'). '/' . $param['stageCode'];
    return $this->_getJson('get', $url);
}
function getTripsExpensive($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_trips_expensive') . '/' . $param['tripCode'];
    return $this->_getJson('get', $url);
}

function updateTripsHead($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_trips_head');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function updateSchedulesExpensive($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_update_trips_expensive');
    $param = json_encode($param);
    return $this->_getJson('post', $url, $param, array('Content-Type' => 'application/json'));
}

function getCommerceStation($param = array()) {
    $url = '/' . $this->_user_hash . config_item('api_get_commerce_station');
    return $this->_getJson('get', $url);
}

function getAppMenu() {

    if ($this->session->userdata('user_id') != '') {
        $param = array('authtoken' => $this->_user_hash);

        $menu = $this->getMenuPrivileges(array('authtoken' => $this->_user_hash));
        $menu = json_decode($menu);

        if (is_array($menu->data) && $menu->status == 1) {
            foreach ($menu->data AS $mn) {

                if ($mn->lookup->code != '') {
                    $sub_temp[$mn->lookup->code][] = array(
                        'code' => $mn->code,
                        'name' => $mn->name,
                        'link' => $mn->link,
                        'activeFlag' => $mn->activeFlag,
                        'defaultFlag' => $mn->defaultFlag,
                        'lookup' => $mn->lookup
                    );
                } else {
                    $mn_temp[$mn->code] = array(
                        'code' => $mn->code,
                        'name' => $mn->name,
                        'link' => $mn->link,
                        'activeFlag' => $mn->activeFlag,
                        'defaultFlag' => $mn->defaultFlag,
                        'lookup' => $mn->lookup
                    );
                }

                if (is_array($mn->eventList) && $mn->eventList != '') {  // Get events of menu
                    foreach ($mn->eventList as $event) {
                        if (empty($event->operationCode))
                            continue;
                        if ($event->permissionType == 'IDL')
                            $events[strtoupper($event->operationCode)] = 2;
                        else
                            $events[strtoupper($event->operationCode)] = 1;
                    }
                }
            }
        }
        if (is_array($mn_temp)) {
            usort($mn_temp, sorting('name')); // Master Menu Sorting
        }
        $sorted_submenu = array();        // Child Menu Sorting
        if (is_array($sub_temp)) {
            foreach ($sub_temp as $key => $sub_asc_menu) {
                usort($sub_asc_menu, sorting('name'));
                $sorted_submenu[$key] = $sub_asc_menu;
            }
        }

        $data['parent'] = $mn_temp;
        $data['submenu'] = $sorted_submenu;
        $data['action_rights'] = $events;
        return $data;
    }
}

&GT?;在这下面还有一些功能可以取消

0 个答案:

没有答案