<?php
    function get_status($status) {
        switch($status) {
            case 0 : 
                    $status = "Waiting For DP";
            break;
            case 1 : 
                    $status = "On Progress";
            break;
            case 2 : 
                    $status = "Finished";
            break;
            case 3 : 
                    $status = "Suspended";
            break;
            case 4 : 
                    $status = "Need App. Mgr.";
            break;
            case 5 : 
                    $status = "Need App. Dir.";
            break;
            case 6 : 
                    $status = "App. Dir & Mgr";
            break;
            case 7 :
                    $status = "App. Limit";
            break;
			case 8 :
                    $status = "Suspend Item";
            break;
			case 9 :
                    $status = "Cancel By Dir.";
            break;
        }
        
        return $status;
    }
	
	/* function get_status_by_name_for_master($status) {
        switch($status) {
            case "Waiting" : 
                    $status = 0;
            break;
            case "On Progress" : 
                    $status = 1;
            break;
            case "Active" : 
                    $status = 2;
            break;
            case "Suspended" : 
                    $status = 3;
            break;
            case "Need Approval Mgr." : 
                    $status = 4;
            break;
            case "Need Approval Dir." : 
                    $status = 5;
            break;
            case "Need Approval Dir. & Mgr." : 
                    $status = 6;
            break;
            case "Approval Limit" :
                    $status = 7;
            break;
        }
        
        return $status;
    } */
	
    /* function get_status_transaction($status) {
        switch($status) {
            case 0 : 
                    $status = "Waiting";
            break;
            case 1 : 
                    $status = "On Progress";
            break;
            case 2 : 
                    $status = "Finished";
            break;
            case 3 : 
                    $status = "Suspended";
            break;
        }

        return $status;
    } */
	
    function get_status_master($status) {
        switch($status) {
            case 0 : 
                    $status = "Active";
            break;
            case 1 : 
                    $status = "Active";
            break;
            case 2 : 
                    $status = "Finished";
            break;
            case 3 : 
                    $status = "Suspended";
            break;
            case 4 : 
                    $status = "Need App. Mgr.";
            break;
            case 5 : 
                    $status = "Need App. Dir.";
            break;
            case 6 : 
                    $status = "App. Dir & Mgr";
            break;
            case 7 :
                    $status = "App. Limit";
            break;
        }	
        return $status;
    }
	
    function get_depreciate_method($status) {
        switch($status) {
            case 1 : 
                    $status = "Non Depreciable Method";
            break;
            case 2 : 
                    $status = "Straight Line Method";
            break;
            case 3 : 
                    $status = "Double Declining Method";
            break;
        }
		
        return $status;
    }  
	
	function get_status_approval_header($trans_status){
		switch($trans_status){
			case 4 : 
                    $status = "Need Manager Approval";
            break;
			case 5 : 
                    $status = "Need Director Approval";
            break;
			case 6 : 
                    $status = "App Dir & Mgr Approval";
            break;
		}
		return $status;
	}
	
	function check_end_periode($trans_no){
		$arr_no 			= explode("/", $trans_no);
		$no_transaction 	= substr($arr_no[1], 0, 4);
		$month_transaction = (int)substr($no_transaction, 0, 2);
		$year_transaction = ((int) substr($no_transaction, 2, 2)) + 2000;
		$date_transaction 	= $year_transaction . $month_transaction;
		
		return $date_transaction;
	}
	
	function label_grid($type_field){
		if($type_field == "no_trans"){
			$field = "No. Transaction";
		}
		else if($type_field == "date"){
			$field = "Date";
		}
		else if($type_field == "desc"){
			$field = "Description";
		}
		else if($type_field == "created"){
			$field = "Created By";
		}
		else if($type_field == "amount"){
			$field = "Amount";
		}
		else if($type_field == "check_no"){
			$field = "Check No";
		}
		else if($type_field == "no_seri"){
			$field = "V.Item Code";
		}
		else if($type_field == "rate"){
			$field = "Currency Rate";
		}
		else if($type_field == "curr_code"){
			$field = "Currency Code";
		}
		return $field;
	}
?>