<?php

/*
 * To change ci template, choose Tools | Templates
 * and open the template in the editor.
 */

function hari() { return date("d"); }
function bulan() { return date("m"); }
function tahun() { return date("Y"); }
function awal() { return date('Y-m').'-01'; }
function sekarang() { return date('Y-m-d'); }

// bulan
function blnindo($bln) {
    $bulan_id = array("", "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
    return $bulan_id[(date('m', strtotime($bln)) * 1)];
}

// IP
function ip() {
    $ci = & get_instance();
    $ci->load->database();

    $ci->db->select('nomorip, port, aktif');
    $ci->db->from('config');
    $ci->db->where('aktif', 1);
    $data = $ci->db->get()->row();

    $ip = $data->nomorip;
    $port = $data->port;
    
	return $ip.':'.$port;
	// return $ip;
}

function ConvertBulan ($bulan){
    if($bulan == 1){
        return "Januari";
    }else if($bulan == 2){
        return "Februari";
    }else if($bulan == 3){
        return "Maret";
    }else if($bulan == 4){
        return "April";
    }else if($bulan == 5){
        return "Mei";
    }else if($bulan == 6){
        return "Juni";
    }else if($bulan == 7){
        return "Juli";
    }else if($bulan == 8){
        return "Agustus";
    }else if($bulan == 9){
        return "September";
    }else if($bulan == 10){
        return "Oktober";
    }else if($bulan == 11){
        return "Novenber";
    }else{
        return "Desember";
    }
}

function color($color){
    if($color == 1){
        return "#FF0F00";
    }else if($color == 2){
        return "#FF6600";
    }else if($color == 3){
        return "#FF9E01";
    }else if($color == 4){
        return "#FCD202";
    }else if($color == 5){
        return "#F8FF01";
    }else if($color == 6){
        return "#B0DE09";
    }else if($color == 7){
        return "#04D215";
    }else if($color == 8){
        return "#0D8ECF";
    }else if($color == 9){
        return "#0D52D1";
    }else if($color == 10){
        return "#2A0CD0";
    }else if($color == 11){
        return "#8A0CCF";
    }else if($color == 12){
        return "#CD0D74";
    }else if($color){
        return "#754DEB";
    }else if($color == 14){
        return "#DDDDDD";
    }else if($color == 15){
        return "#999999";
    }else{
        return "#000000";
    }
}
?>