<?php
class StatusCodes {

    public static function getStatusCode($filter) {
        $filter = strtolower($filter);
        switch($filter) {
            case 'draft':
                return 0;
                break;
            case 'awaiting review':
                return 1;
                break;
            case 'approved':
                return 2;
                break;
            case 'declined':
                return 3;
                break;
            case 'partially approved':
                return 4;
                break;
            case 'authorized': 

                return 5;
                break;
            case 'paid':
                return 6;
                break;
            case 'deleted':
                return 7;
                break;
            case 'sent':
                return 8;
                break;
            case 'viewed':
                return 9;
                break;
            case 'invoiced':
                return 10;
                break;
            case 'registered':
                return 11;
                break;
            case 'Unpaid':
                return 12;
                break;
            case 'partially paid':
                return 13;
                break;
            case 'Available':
                return 14;
                break;
            case 'UnderMaintenance':
                return 15;
                break;
            case 'Maintenance':
                return 16;
                break;
            case 'Loaded Not Paid':
                return 17;
                break;
            case 'Not Loaded':
                return 18;
                break;
            case 'Requested':
                return 19;
                break;
            case 'Transfered Not Confirmed':
                return 20;
                break;
            case 'Transfered and Confirmed':
                return 21;
                break;
            case 'Rejected':
                return 22;
                break;
            case 'Loaded and Paid':
                return 23;
                break;
            case 'Cancelled':
                return 24;
                break;
            case 'Not Assigned':
                return 25;
                break;
            case 'Assigned':
                return 26;
                break;
            case 'On Market':
                return 27;
                break;
            case 'Delivered':
                return 28;
                break;
            case 'Confirmed':
                return 29;
                break;
            default:
                return -1;
        }
    }

    public static function getStatus($code) {
        switch($code) {
            case 0:
                return CommonLanguage::getMessage('draft');
                break;
            case 1:
                return CommonLanguage::getMessage('awaiting_review');
                break;
            case 2:
                return CommonLanguage::getMessage('approved');
                break;
            case 3:
                return CommonLanguage::getMessage('declined');
                break;
            case 4:
                return CommonLanguage::getMessage('partially_approved');
                break;
            case 5:
                return CommonLanguage::getMessage('authorized');
                break;
            case 6:
                return CommonLanguage::getMessage('paid');
                break;
            case 7:
                return CommonLanguage::getMessage('deleted');
                break;
            case 8:
                return CommonLanguage::getMessage('sent');
                break;
            case 9:
                return CommonLanguage::getMessage('viewed');
                break;
            case 10:
                return CommonLanguage::getMessage('invoiced');
                break;
            case 11:
                return CommonLanguage::getMessage('registered');
                break;
            case 12:
                return CommonLanguage::getMessage('unpaid');
                break;
            case 13:
                return CommonLanguage::getMessage('partially_paid');
                break;
            case 14:
                return CommonLanguage::getMessage('available');
                break;
            case 15:
                return CommonLanguage::getMessage('undermaintenance');
                break;
            case 16:
                return CommonLanguage::getMessage('maintenance');
                break;
            case 17:
                return CommonLanguage::getMessage('loaded_not_paid');
                break;
            case 18:
                return CommonLanguage::getMessage('not_loaded');
                break;
            case 19:
                return CommonLanguage::getMessage('requested');
                break;
            case 20:
                return CommonLanguage::getMessage('transfered_not_confirmed');
                break;
            case 21:
                return CommonLanguage::getMessage('transfered_and_confirmed');
                break;
            case 22:
                return CommonLanguage::getMessage('rejected');
                break;
            case 23:
                return CommonLanguage::getMessage('loaded_and_paid');
                break;
            case 24:
                return CommonLanguage::getMessage('canceled');
                break;
            case 25:
                return CommonLanguage::getMessage('not_assigned');
                break;
            case 26:
                return CommonLanguage::getMessage('assigned');
                break;
            case 27:
                return CommonLanguage::getMessage('onmarket');
                break;
            case 28:
                return CommonLanguage::getMessage('delivered');
                break;
            case 29:
                return CommonLanguage::getMessage('confirmed');
                break;
            case 30:
                return CommonLanguage::getMessage('exceed_limit');
                break;
            case 31:
                return CommonLanguage::getMessage('under_limit');
                break;
            case 34:
                return CommonLanguage::getMessage('oil_exchange');
                break;
            case 35:
                return CommonLanguage::getMessage('checkup');
                break;
            default:
                return CommonLanguage::getMessage('unknown');
        }
    }
    public static function getStatusColor($code){
        switch($code) {
           
            case 19:
                return "#label-important";
                break;
            case 28:
                return "#label-master";
                break;
            case 29:
                return "#label-warning";
                break;
            case 1:
                return "label-important";
                break;
            case 2:
                return "label-master";
                break;
            default:
                return "#label-info";
        }
    }

}