An Error Was Encountered
Non-existent class: fungsi
Class Fungsi
{
function Fungsi()
{
$this->CI =& get_instance();
$this->CI->load->library(array('session','JSON'));
//$this->CI->load->library('fpdf',array('orientasi'=>'P','unit'=>'cm','format'=>'legal'));
@$kbase="8aHe3nUv9Wo4";
}
function jam()
{
$wjam=date('H');
$wmin=date('i');
$wsec=date('s');
$output="$wjam:$wmin:$wsec";
return $output;
}
function complete($in,$max)
{
$len = $max;
$len_in = strlen($in);
$zero_len = $len - $len_in;
$zero = "";
for($i=1;$i<=$zero_len;$i++)
{
$zero .= '0';
}
return $zero.$in;
}
function bulan()
{
$input=date('n');
if($input=='1'){$output='Januari';}
if($input=='2'){$output='Februari';}
if($input=='3'){$output='Maret';}
if($input=='4'){$output='April';}
if($input=='5'){$output='Mei';}
if($input=='6'){$output='Juni';}
if($input=='7'){$output='Juli';}
if($input=='8'){$output='Agustus';}
if($input=='9'){$output='September';}
if($input=='10'){$output='Oktober';}
if($input=='11'){$output='November';}
if($input=='12'){$output='Desember';}
return $output;
}
function bulan2($rrr)
{
if($rrr=='1' || $rrr=='01'){$ttt='Januari';}
if($rrr=='2' || $rrr=='02'){$ttt='Februari';}
if($rrr=='3' || $rrr=='03'){$ttt='Maret';}
if($rrr=='4' || $rrr=='04'){$ttt='April';}
if($rrr=='5' || $rrr=='05'){$ttt='Mei';}
if($rrr=='6' || $rrr=='06'){$ttt='Juni';}
if($rrr=='7' || $rrr=='07'){$ttt='Juli';}
if($rrr=='8' || $rrr=='08'){$ttt='Agustus';}
if($rrr=='9' || $rrr=='09'){$ttt='September';}
if($rrr=='10'){$ttt='Oktober';}
if($rrr=='11'){$ttt='November';}
if($rrr=='12'){$ttt='Desember';}
return $ttt;
}
function bulan3($rrr)
{
if($rrr=='1' || $rrr=='01'){$ttt='Jan';}
if($rrr=='2' || $rrr=='02'){$ttt='Feb';}
if($rrr=='3' || $rrr=='03'){$ttt='Mar';}
if($rrr=='4' || $rrr=='04'){$ttt='Apr';}
if($rrr=='5' || $rrr=='05'){$ttt='Mei';}
if($rrr=='6' || $rrr=='06'){$ttt='Jun';}
if($rrr=='7' || $rrr=='07'){$ttt='Jul';}
if($rrr=='8' || $rrr=='08'){$ttt='Ags';}
if($rrr=='9' || $rrr=='09'){$ttt='Sep';}
if($rrr=='10'){$ttt='Okt';}
if($rrr=='11'){$ttt='Nop';}
if($rrr=='12'){$ttt='Des';}
return $ttt;
}
function hari()
{
$input=date('D');
if($input=='Sun'){$output='Minggu';}
if($input=='Mon'){$output='Senin';}
if($input=='Tue'){$output='Selasa';}
if($input=='Wed'){$output='Rabu';}
if($input=='Thu'){$output='Kamis';}
if($input=='Fri'){$output='Jumat';}
if($input=='Sat'){$output='Sabtu';}
return $output;
}
function hari2($in)
{
$tgl = substr($in,8,2);
$bln = substr($in,5,2);
$thn = substr($in,0,4);
$stamp = mktime(0,0,0,$bln,$tgl,$thn);
$input= date('D',$stamp);
if($input=='Sun'){$output='Minggu';}
if($input=='Mon'){$output='Senin';}
if($input=='Tue'){$output='Selasa';}
if($input=='Wed'){$output='Rabu';}
if($input=='Thu'){$output='Kamis';}
if($input=='Fri'){$output='Jumat';}
if($input=='Sat'){$output='Sabtu';}
return $output;
}
function tanggal_lengkap()
{
$output=$this->hari()." ".date('j')."-".$this->bulan()."-".date('Y');
return $output;
}
function tanggal_resmi()
{
$output=date('d')." ".$this->bulan()." ".date('Y');
return $output;
}
function timestamp_to_tanggal($timestamp)
{
$tgl = date('d',$timestamp);
$bln = date('n',$timestamp);
$thn = date('Y',$timestamp);
$output=$tgl." ".$this->bulan2($bln)." ".$thn;
return $output;
}
function timestamp_to_tanggal2($timestamp)
{
$tgl = date('d',$timestamp);
$bln = date('n',$timestamp);
$thn = date('Y',$timestamp);
$output=$tgl." ".$this->bulan3($bln)." ".$thn;
return $output;
}
function date_to_tanggal($in)
{
$tgl = substr($in,8,2);
$bln = substr($in,5,2);
$thn = substr($in,0,4);
if(checkdate($bln,$tgl,$thn))
{
$out=substr($in,8,2)." ".$this->bulan2(substr($in,5,2))." ".substr($in,0,4);
}
else
{
$out = "-error-";
}
return $out;
}
function date_to_tanggal2($in)
{
$tgl = substr($in,8,2);
$bln = substr($in,5,2);
$thn = substr($in,0,4);
if(checkdate($bln,$tgl,$thn))
{
$out=substr($in,8,2)." ".$this->bulan3(substr($in,5,2))." ".substr($in,0,4);
}
else
{
$out = "-error-";
}
return $out;
}
function tanggal()
{
$output=date('j')."x".$this->bulan()."x".date('Y');
return $output;
}
function tanggal_pendek()
{
$tgl=date('d');
$bln=date('m');
$thn=date('y');
$output=$tgl."-".$bln."-".$thn;
return $output;
}
function pecah_tanggal($in)
{
$out=substr($in,0,2)." ".$this->bulan2(substr($in,2,2))." 20".substr($in,4,2);
return $out;
}
function tanggal_jurnal($in)
{ // yyyy-mm-dd
$out[]=$this->bulan2(substr($in,5,2)).' '.substr($in,0,4);
$out[]=substr($in,8,2);
return $out;
}
function tg_to_array($in)
{
// yyyy-mm-dd
$out[]=substr($in,0,4);
$out[]=substr($in,5,2);
$out[]=substr($in,8,2);
return $out;
}
function query($db,$query,$id)
{
$result=mysql_db_query($db,$query,$id) or die("Kesalahan pada query= ".mysql_error()."
$query");
return $result;
}
function query_lanjut($db,$query,$id)
{
$result=mysql_db_query($db,$query,$id) or print("Kesalahan pada query= ".mysql_error()."
$query");
return $result;
}
function close($id)
{
mysql_close($id);
}
function get_rnd_iv($iv_len)
{
$iv = '';
while ($iv_len-- > 0)
{
$iv .= chr(mt_rand() & 0xff);
}
return $iv;
}
function getip()
{
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
$ip_lok = getenv("HTTP_CLIENT_IP");
else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
$ip_lok = getenv("HTTP_X_FORWARDED_FOR");
else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
$ip_lok = getenv("REMOTE_ADDR");
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
$ip_lok = $_SERVER['REMOTE_ADDR'];
else
$ip_lok = "unknown";
return($ip_lok);
}
function cet_tanggal($a) {
$b=substr($a,8,2); //tanggal
$c=substr($a,5,2); //bulan
$d=substr($a,0,4); //tahun
if ($b>0 && $c>0 && $d>0){
echo $b."-";
if ($c==1){
echo "Januari";
} elseif ($c==2){
echo "Februari";
} elseif ($c==3){
echo "Maret";
} elseif ($c==4){
echo "April";
} elseif ($c==5){
echo "Mei";
} elseif ($c==6){
echo "Juni";
} elseif ($c==7){
echo "Juli";
} elseif ($c==8){
echo "Agustus";
} elseif ($c==9){
echo "September";
} elseif ($c==10){
echo "Oktober";
} elseif ($c==11){
echo "November";
} elseif ($c==12){
echo "Desember";
} else {
echo " xx ";
}
echo "-".$d;
}else{
echo "(data tanggal tidak tersedia)";
}
}
function tanggalan($a) {
$b=substr($a,8,2); //tanggal
$c=substr($a,5,2); //bulan
$d=substr($a,0,4); //tahun
if ($b>0 && $c>0 && $d>0){
echo $b.".".$c.".".$d;
}else{
echo "(data tanggal tidak tersedia)";
}
}
function warning($input,$goTo='')
{
if($goTo=='')
{
$goTo = site_url().'/home/admin';
}
$output="";
return $output;
}
function rupiah($uang)
{
$rupiah="";
$panjang = strlen($uang);
while($panjang > 3)
{
$rupiah = "." . substr($uang,-3) . $rupiah;
$lebar=strlen($uang)-3;
$uang = substr($uang,0,$lebar);
$panjang = strlen($uang);
}
$rupiah = "Rp ".$uang.$rupiah.",-";
return $rupiah;
}
function pecah($uang,$delimiter='.')
{
if($uang == '' || $uang == 0)
{
$rupiah = '0';
return $rupiah;
}
$neg = false;
if($uang<0)
{
$neg = true;
$uang = abs($uang);
}
$rupiah = number_format($uang,0,',',$delimiter);
if($neg)
{
$rupiah = '('.$rupiah.')';
}
return $rupiah;
}
function terbilang($bilangan)
{
if($bilangan=='' || $bilangan==0)
return "nol";
$angka = array('0','0','0','0','0','0','0','0','0','0',
'0','0','0','0','0','0');
$kata = array('','satu','dua','tiga','empat','lima',
'enam','tujuh','delapan','sembilan');
$tingkat = array('','ribu','juta','milyar','triliun');
$panjang_bilangan = strlen($bilangan);
/* pengujian panjang bilangan */
if ($panjang_bilangan > 15) {
$kalimat = "Diluar Batas";
return $kalimat;
}
/* mengambil angka-angka yang ada dalam bilangan,
dimasukkan ke dalam array */
for ($i = 1; $i <= $panjang_bilangan; $i++) {
$angka[$i] = substr($bilangan,-($i),1);
}
$i = 1;
$j = 0;
$kalimat = "";
/* mulai proses iterasi terhadap array angka */
while ($i <= $panjang_bilangan) {
$subkalimat = "";
$kata1 = "";
$kata2 = "";
$kata3 = "";
/* untuk ratusan */
if ($angka[$i+2] != "0") {
if ($angka[$i+2] == "1") {
$kata1 = "seratus";
} else {
$kata1 = $kata[$angka[$i+2]] . " ratus";
}
}
/* untuk puluhan atau belasan */
if ($angka[$i+1] != "0") {
if ($angka[$i+1] == "1") {
if ($angka[$i] == "0") {
$kata2 = "sepuluh";
} elseif ($angka[$i] == "1") {
$kata2 = "sebelas";
} else {
$kata2 = $kata[$angka[$i]] . " belas";
}
} else {
$kata2 = $kata[$angka[$i+1]] . " puluh";
}
}
/* untuk satuan */
if ($angka[$i] != "0") {
if ($angka[$i+1] != "1") {
$kata3 = $kata[$angka[$i]];
}
}
/* pengujian angka apakah tidak nol semua,
lalu ditambahkan tingkat */
if (($angka[$i] != "0") OR ($angka[$i+1] != "0") OR
($angka[$i+2] != "0")) {
$subkalimat = "$kata1 $kata2 $kata3 " . $tingkat[$j] . " ";
}
/* gabungkan variabe sub kalimat (untuk satu blok 3 angka)
ke variabel kalimat */
$kalimat = $subkalimat . $kalimat;
$i = $i + 3;
$j = $j + 1;
}
/* mengganti satu ribu jadi seribu jika diperlukan */
if (($angka[5] == "0") AND ($angka[6] == "0")) {
$kalimat = str_replace("satu ribu","seribu",$kalimat);
}
return trim($kalimat);
}
function catat($kegiatan,$awal ='',$isData=false)
{
$this->CI->load->database();
if($isData)
{
$gab='';
foreach($kegiatan as $key=>$val):
if($val==''){ $val='kosong';}
$keg='
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/sianggar/public_html/system/application/libraries/fungsi.php:658)
Filename: codeigniter/Common.php
Line Number: 360
Non-existent class: fungsi